summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xinfest8
-rw-r--r--lib/cac.sh13
-rwxr-xr-xnetworking-configuration8
3 files changed, 10 insertions, 19 deletions
diff --git a/infest b/infest
index 255ba2422..f2ccd12f5 100755
--- a/infest
+++ b/infest
@@ -21,14 +21,6 @@ nix_find_sha1sum=86f8775bd4f0841edd4c816df861cebf509d58c3
main() {
listservers=$(cac_listservers)
- listserversstatus=$(echo $listservers | jq -r .status)
- case $listserversstatus in
- ok) : ;;
- *)
- echo $0: bad listservers status: $listserversstatus >&2
- exit 1
- esac
-
config=$(echo $listservers \
| jq -r ".data|map(select(.servername == \"$cac_servername\"))[]")
diff --git a/lib/cac.sh b/lib/cac.sh
index 0bc9d3369..7ed06012a 100644
--- a/lib/cac.sh
+++ b/lib/cac.sh
@@ -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
diff --git a/networking-configuration b/networking-configuration
index 4b7a85d2b..b9725c7e1 100755
--- a/networking-configuration
+++ b/networking-configuration
@@ -22,14 +22,6 @@ hostname=$2
main() {
listservers=$(cac_listservers)
- listserversstatus=$(echo $listservers | jq -r .status)
- case $listserversstatus in
- ok) : ;;
- *)
- echo $0: bad listservers status: $listserversstatus >&2
- exit 1
- esac
-
config=$(echo $listservers \
| jq -r ".data|map(select(.servername == \"$cac_servername\"))[]")