lib/cac.sh cac_listservers: return maybe data

This commit is contained in:
tv 2015-05-20 21:34:24 +02:00
parent 952ea06725
commit a2970fcae7
3 changed files with 3 additions and 3 deletions

2
infest
View File

@ -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

View File

@ -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

View File

@ -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"
}