summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2015-05-20 21:34:24 +0200
committertv <tv@krebsco.de>2015-05-20 21:34:24 +0200
commitfc870549e7bb85d1482877784853d31e39a6fe09 (patch)
treeb01c4227dcd0b3246bce107f67b8afc20e94b9d1
parent4fae1fdb0d2b7769a8ba6468eee79d109c00d8ab (diff)
lib/cac.sh cac_listservers: return maybe data
-rwxr-xr-xinfest2
-rw-r--r--lib/cac.sh2
-rwxr-xr-xnetworking-configuration2
3 files changed, 3 insertions, 3 deletions
diff --git a/infest b/infest
index f2ccd12..c6d509a 100755
--- a/infest
+++ b/infest
@@ -22,7 +22,7 @@ main() {
listservers=$(cac_listservers)
config=$(echo $listservers \
- | jq -r ".data|map(select(.servername == \"$cac_servername\"))[]")
+ | jq -r ".[]|select(.servername==\"$cac_servername\")")
serverstatus=$(echo $config | jq -r .status)
case $serverstatus in
diff --git a/lib/cac.sh b/lib/cac.sh
index 7ed0601..482e4dd 100644
--- a/lib/cac.sh
+++ b/lib/cac.sh
@@ -4,7 +4,7 @@ cac_listservers() {(
listservers=$(_cac_get_api_v1 listservers)
status=$(echo "$listservers" | jq -r .status)
if [ "$status" = ok ]; then
- echo "$listservers"
+ echo "$listservers" | jq -r .data
else
echo "$0: bad listservers status: $status" >&2
exit 1
diff --git a/networking-configuration b/networking-configuration
index b9725c7..2cae396 100755
--- a/networking-configuration
+++ b/networking-configuration
@@ -23,7 +23,7 @@ main() {
listservers=$(cac_listservers)
config=$(echo $listservers \
- | jq -r ".data|map(select(.servername == \"$cac_servername\"))[]")
+ | jq -r ".[]|select(.servername==\"$cac_servername\")")
print_networking_configuraton "$config"
}