diff options
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 + + |