From 3cc354008a76f061ab4708922b7c0f3a8d37097b 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 482e4ddea..c78576ebf 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