From 2f4bc11408c7d88ae9811cf6131cef0a489f1cba Mon Sep 17 00:00:00 2001 From: Sebastian <379651+czarly@users.noreply.github.com> Date: Sun, 24 Mar 2024 07:42:33 +0100 Subject: [PATCH] find options --- endpoint-options.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 endpoint-options.sh diff --git a/endpoint-options.sh b/endpoint-options.sh new file mode 100755 index 00000000..cdb73feb --- /dev/null +++ b/endpoint-options.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +BASEPATH="$(dirname "$0")" +source $BASEPATH/.env + +IFS=':' read -ra parts <<< $COMPOSE_FILE + +json=$(cat "$BASEPATH/reference-rpc-endpoint.json") + +default_array=() +for key in $(jq -r 'keys[]' <<< "$json"); do + default_values=$(jq -r ".[\"$key\"].default[]" <<< "$json") + default_array+=($default_values) +done + +for node in $default_array; do + size_in_gb=$($BASEPATH/restore-volumes.sh --print-size-only) + + if [ $? -eq 0 ]; then + echo "$node: $sizeG" + fi +done + +# Print the combined array +#printf "%s\n" "${default_array[@]}"