lib/cac.sh cac_listservers: return maybe data
This commit is contained in:
parent
952ea06725
commit
a2970fcae7
2
infest
2
infest
@ -22,7 +22,7 @@ main() {
|
|||||||
listservers=$(cac_listservers)
|
listservers=$(cac_listservers)
|
||||||
|
|
||||||
config=$(echo $listservers \
|
config=$(echo $listservers \
|
||||||
| jq -r ".data|map(select(.servername == \"$cac_servername\"))[]")
|
| jq -r ".[]|select(.servername==\"$cac_servername\")")
|
||||||
|
|
||||||
serverstatus=$(echo $config | jq -r .status)
|
serverstatus=$(echo $config | jq -r .status)
|
||||||
case $serverstatus in
|
case $serverstatus in
|
||||||
|
@ -4,7 +4,7 @@ cac_listservers() {(
|
|||||||
listservers=$(_cac_get_api_v1 listservers)
|
listservers=$(_cac_get_api_v1 listservers)
|
||||||
status=$(echo "$listservers" | jq -r .status)
|
status=$(echo "$listservers" | jq -r .status)
|
||||||
if [ "$status" = ok ]; then
|
if [ "$status" = ok ]; then
|
||||||
echo "$listservers"
|
echo "$listservers" | jq -r .data
|
||||||
else
|
else
|
||||||
echo "$0: bad listservers status: $status" >&2
|
echo "$0: bad listservers status: $status" >&2
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -23,7 +23,7 @@ main() {
|
|||||||
listservers=$(cac_listservers)
|
listservers=$(cac_listservers)
|
||||||
|
|
||||||
config=$(echo $listservers \
|
config=$(echo $listservers \
|
||||||
| jq -r ".data|map(select(.servername == \"$cac_servername\"))[]")
|
| jq -r ".[]|select(.servername==\"$cac_servername\")")
|
||||||
|
|
||||||
print_networking_configuraton "$config"
|
print_networking_configuraton "$config"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user