From b939e5079448dfb3ef3b75beabb65ad982c4b45b Mon Sep 17 00:00:00 2001 From: Joey Turner Date: Thu, 5 Sep 2024 17:11:33 -0500 Subject: [PATCH] Update config.ng.functions.sh fix: 2nd , Cannot iterate over null (null) --- lib/armbian-configng/config.ng.functions.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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"