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