0
0
mirror of https://github.com/letic/Shell-Scripts.git synced 2024-09-27 21:46:03 +00:00

Update cosmos_config.sh

This commit is contained in:
Mark McDonnell 2016-04-22 09:25:53 +01:00
parent 3003ce4c82
commit 2c08c93422

View File

@ -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: <id>,<ip>