Fix commands not working

This commit is contained in:
ItsDrike 2022-08-23 19:15:47 +02:00
parent c9555e60ad
commit 637955f2f2
No known key found for this signature in database
GPG key ID: B014E761034AF742

View file

@ -186,11 +186,11 @@ get_module_output() {
while read -r cmd <&5; do while read -r cmd <&5; do
# Get the key (prefix) and the actual text (output) from the received cmd # Get the key (prefix) and the actual text (output) from the received cmd
prefix="$(echo $cmd | cut -d " " -f1)" prefix="$(echo $cmd | cut -d " " -f1)"
output="$(echo $cmd | cut -d " " -f2-)" output="$(echo $cmd | cut -d " " -s -f2-)"
if [[ "$prefix" == "cmd" ]]; then if [[ "$prefix" == "cmd" ]]; then
key="$(echo $output | cut -d " " -f1)" key="$(echo $output | cut -d " " -f1)"
args="$(echo $output | cut -d " " -f2-)" args="$(echo $output | cut -d " " -s -f2-)"
run_str="${CMDS[$key]} $args" run_str="${CMDS[$key]} $args"
>&2 echo "CMD: $run_str ($key)" >&2 echo "CMD: $run_str ($key)"
eval $run_str eval $run_str