diff --git a/bin/bgeti b/bin/bgeti index 9d8e7653..77a6ec56 100755 --- a/bin/bgeti +++ b/bin/bgeti @@ -33,6 +33,6 @@ if [[ ${JSON} = \{* ]] ; then elif [[ "${JSON}" = \[* ]] ; then echo "${JSON}" | jq -r .[].uuid else - echo "not sure what to do with JSON:" - echo "${JSON}" + die "Invalid JSON received: +${JSON}" fi diff --git a/bin/bgeti1 b/bin/bgeti1 index f463bf51..b993b976 100755 --- a/bin/bgeti1 +++ b/bin/bgeti1 @@ -33,6 +33,6 @@ if [[ ${JSON} = \{* ]] ; then elif [[ "${JSON}" = \[* ]] ; then echo "${JSON}" | jq -r .[].uuid | head -1 else - echo "not sure what to do with JSON:" - echo "${JSON}" + die "Invalid JSON received: +${JSON}" fi diff --git a/bin/bgetn b/bin/bgetn index 5b38a86a..503cdd75 100755 --- a/bin/bgetn +++ b/bin/bgetn @@ -33,6 +33,6 @@ if [[ ${JSON} = \{* ]] ; then elif [[ "${JSON}" = \[* ]] ; then echo "${JSON}" | jq -r .[].name else - echo "not sure what to do with JSON:" - echo "${JSON}" + die "Invalid JSON received: +${JSON}" fi diff --git a/bin/bgetn1 b/bin/bgetn1 index beba4cab..f9bb35ef 100755 --- a/bin/bgetn1 +++ b/bin/bgetn1 @@ -33,6 +33,6 @@ if [[ ${JSON} = \{* ]] ; then elif [[ "${JSON}" = \[* ]] ; then echo "${JSON}" | jq -r .[].name | head -1 else - echo "not sure what to do with JSON:" - echo "${JSON}" + die "Invalid JSON received: +${JSON}" fi diff --git a/bin/vultr/vultr_list_instance_labels.sh b/bin/vultr/vultr_list_instance_labels.sh new file mode 100755 index 00000000..db25db23 --- /dev/null +++ b/bin/vultr/vultr_list_instance_labels.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# +# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://getbubblenow.com/bubble-license/ +# +THISDIR=$(cd $(dirname ${0}) && pwd) +VCURL=${THISDIR}/vcurl +LABEL=${1} + +${VCURL} server/list | jq -r '.[].label'