diff --git a/cosmos_config.sh b/cosmos_config.sh index d829a0e..59c769b 100644 --- a/cosmos_config.sh +++ b/cosmos_config.sh @@ -33,6 +33,9 @@ EOF exit 1 fi +# check the jq dependency is available +type foo >/dev/null 2>&1 || { printf >&2 "\nThe jq dependency is missing. Please first run 'brew install jq'\n"; exit 1; } + instances=($(curl --silent --cert $cert "$api/instances" | jq --raw-output ".[] | .id,.private_ip_address")) num_of_instances=$((${#instances[@]} / 2)) # we know the data arrives in a pair: ,