summaryrefslogtreecommitdiffstats
path: root/networking-configuration
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 /networking-configuration
parenta2970fcae78b9973c20bdcb78a8a4ec0170aac93 (diff)
lib/cac.sh: add cac_getserver_by_servername
Diffstat (limited to 'networking-configuration')
-rwxr-xr-xnetworking-configuration20
1 files changed, 8 insertions, 12 deletions
diff --git a/networking-configuration b/networking-configuration
index 2cae39663..77b9a45be 100755
--- a/networking-configuration
+++ b/networking-configuration
@@ -19,22 +19,18 @@ hostname=$2
# hostname=
-main() {
- listservers=$(cac_listservers)
-
- config=$(echo $listservers \
- | jq -r ".[]|select(.servername==\"$cac_servername\")")
-
- print_networking_configuraton "$config"
-}
+main() {(
+ server=$(cac_getserver_by_servername "$cac_servername")
+ print_networking_configuraton "$server"
+)}
print_networking_configuraton() {
- config=$1
- address=$(echo $config | jq -r .ip)
- gateway=$(echo $config | jq -r .gateway)
+ server=$1
+ address=$(echo $server | jq -r .ip)
+ gateway=$(echo $server | jq -r .gateway)
nameserver=8.8.8.8
- netmask=$(echo $config | jq -r .netmask)
+ netmask=$(echo $server | jq -r .netmask)
prefixLength=$(netmaskToPrefixLengh $netmask)
# TODO generate all config and put it into a temp dir, then rsync that