From e554c6a96718235a50d979daf2be1a8f41f3a2b5 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 20 May 2015 21:58:59 +0200 Subject: lib/cac.sh: add cac_getserver_by_servername --- lib/cac.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib') diff --git a/lib/cac.sh b/lib/cac.sh index 482e4dd..c78576e 100644 --- a/lib/cac.sh +++ b/lib/cac.sh @@ -1,5 +1,15 @@ . ./lib/url.sh + +cac_getserver_by_servername() {( + serverlist=$(cac_listservers) + echo $serverlist \ + | jq \ + --arg name "$1" \ + '.[]|select(.servername==$name)' +)} + + cac_listservers() {( listservers=$(_cac_get_api_v1 listservers) status=$(echo "$listservers" | jq -r .status) -- cgit v1.2.3