diff options
author | Suren A. Chilingaryan <csa@suren.me> | 2019-10-06 05:53:11 +0200 |
---|---|---|
committer | Suren A. Chilingaryan <csa@suren.me> | 2019-10-06 05:53:11 +0200 |
commit | b794f84da1aaf446a3965f9b9363f997b3183872 (patch) | |
tree | d59f80c7587b8748b79cdeecfb112892e7ccf083 /katrin.d/kaas-auto-gen.sh | |
download | iperouter-b794f84da1aaf446a3965f9b9363f997b3183872.tar.gz iperouter-b794f84da1aaf446a3965f9b9363f997b3183872.tar.bz2 iperouter-b794f84da1aaf446a3965f9b9363f997b3183872.tar.xz iperouter-b794f84da1aaf446a3965f9b9363f997b3183872.zip |
Initial configuration
Diffstat (limited to 'katrin.d/kaas-auto-gen.sh')
-rwxr-xr-x | katrin.d/kaas-auto-gen.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/katrin.d/kaas-auto-gen.sh b/katrin.d/kaas-auto-gen.sh new file mode 100755 index 0000000..2f3e635 --- /dev/null +++ b/katrin.d/kaas-auto-gen.sh @@ -0,0 +1,24 @@ +#! /bin/bash + +function oc { + cfg="/root/security/kaas.kit.edu.kubeconfig" + /usr/local/bin/oc --config "$cfg" "$@" +} + + +function gen { + sites=$(oc get route --all-namespaces | grep -P "^(adei|katrin|status|web) | grep kaas.kit.edu" | awk '{ print $3 }' | cut -d '.' -f 1) # " + + for site in $sites; do + adei=$(echo $site | grep -P "^adei-") + + url="" + [ -n "$adei" ] && url="/adei" + + cat kaas-auto.template | sed -re "s|@name@|$site|g; s|@url@|$url|g" + done +} + +gen > kaas-auto.conf + + |