diff --git a/lib/armbian-configng/config.ng.functions.sh b/lib/armbian-configng/config.ng.functions.sh index 67ec9498b..c3997800c 100644 --- a/lib/armbian-configng/config.ng.functions.sh +++ b/lib/armbian-configng/config.ng.functions.sh @@ -540,7 +540,14 @@ module_options+=( # function execute_command() { local id=$1 - local commands=$(jq -r --arg id "$id" '.menu[] | .. | objects | select(.id==$id) | .command[]' "$json_file") + #local commands=$(jq -r --arg id "$id" '.menu[] | .. | objects | select(.id==$id) | .command[]' "$json_file") + local commands=$(jq -r --arg id "$id" ' + .menu[] | + .. | + objects | + select(.id == $id) | + .command[]?' "$json_file") + for command in "${commands[@]}"; do # Check if the command is not in the list of restricted commands [[ -n "$debug" ]] && echo "$command"