summaryrefslogtreecommitdiffstats
path: root/lib/cac.sh
diff options
context:
space:
mode:
authortv <tv@shackspace.de>2015-05-20 21:58:59 +0200
committertv <tv@shackspace.de>2015-05-20 21:58:59 +0200
commit3cc354008a76f061ab4708922b7c0f3a8d37097b (patch)
tree5a2ae5f940941d76320c3dd6e43417103c940be1 /lib/cac.sh
parenta2970fcae78b9973c20bdcb78a8a4ec0170aac93 (diff)
lib/cac.sh: add cac_getserver_by_servername
Diffstat (limited to 'lib/cac.sh')
-rw-r--r--lib/cac.sh10
1 files changed, 10 insertions, 0 deletions
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)