From f8e1f0ccf445a43b246f77100f0f0cbcbf6b6f05 Mon Sep 17 00:00:00 2001 From: Sebastian <379651+czarly@users.noreply.github.com> Date: Mon, 25 Mar 2024 00:10:51 +0100 Subject: [PATCH] rreadable --- endpoint-options.sh | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/endpoint-options.sh b/endpoint-options.sh index d2e139e1..aaa809bf 100755 --- a/endpoint-options.sh +++ b/endpoint-options.sh @@ -11,18 +11,14 @@ default_array=() for key in $(jq -r 'keys[]' <<< "$json"); do default_values=$(jq -r ".[\"$key\"].default[]" <<< "$json") default_array+=($default_values) + + for node in "${default_values[@]}"; do + size_in_gb=$($BASEPATH/restore-volumes.sh "$node" --print-size-only) + + if [ $? -eq 0 ]; then + echo "$key;$node;$size_in_gb" + fi + done + done -for node in "${default_array[@]}"; do -#echo "check $node" - size_in_gb=$($BASEPATH/restore-volumes.sh "$node" --print-size-only) - - if [ $? -eq 0 ]; then - echo "$node: $size_in_gb" -# else -# echo "$node can not" - fi -done - -# Print the combined array -#printf "%s\n" "${default_array[@]}"