From 2c08c93422e0e409274b1f1f43e1ae8970707a6b Mon Sep 17 00:00:00 2001 From: Mark McDonnell Date: Fri, 22 Apr 2016 09:25:53 +0100 Subject: [PATCH] Update cosmos_config.sh --- cosmos_config.sh | 3 +++ 1 file changed, 3 insertions(+) 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: ,