diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cac.sh | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -1,8 +1,15 @@ . ./lib/url.sh -cac_listservers() { - _cac_get_api_v1 listservers -} +cac_listservers() {( + listservers=$(_cac_get_api_v1 listservers) + status=$(echo "$listservers" | jq -r .status) + if [ "$status" = ok ]; then + echo "$listservers" + else + echo "$0: bad listservers status: $status" >&2 + exit 1 + fi +)} cac_listtasks() { _cac_get_api_v1 listtasks |