Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
de:update-sealer-example [2017/03/12 02:06] – Wolfgang Pempe | de:update-sealer-example [2021/10/20 12:09] (aktuell) – Inhalt wurde hier integriert: de:shibidp:config-sealer Silke Meyer | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
- | ==== Beispiel für ==== | ||
- | |||
- | [[de: | ||
- | |||
- | (Ein Klick auf den Dateinamen startet den Download) | ||
- | |||
- | <file bash update-sealer.sh> | ||
- | #!/bin/bash | ||
- | |||
- | # https:// | ||
- | # Pfad zur Java-Installation: | ||
- | export JAVA_HOME=/ | ||
- | |||
- | set -e | ||
- | set -u | ||
- | |||
- | |||
- | # Default IDP_HOME if not already set | ||
- | if [ ! -d " | ||
- | then | ||
- | echo " | ||
- | exit 1 | ||
- | fi | ||
- | |||
- | function get_config { | ||
- | # Key to lookup (escape . for regex lookup) | ||
- | local KEY=${1:?" | ||
- | # Passed default value | ||
- | local DEFAULT=" | ||
- | # Lookup key, strip spaces, replace idp.home with IDP_HOME value | ||
- | local RESULT=$(sed -rn '/ | ||
- | # Set if no result with default - exit if no default | ||
- | echo ${RESULT: | ||
- | } | ||
- | |||
- | # Get config values | ||
- | ## Official config items ## | ||
- | storefile=$(get_config idp.sealer.storeResource) | ||
- | versionfile=$(get_config idp.sealer.versionResource) | ||
- | storepass=$(get_config idp.sealer.storePassword) | ||
- | alias=$(get_config idp.sealer.aliasBase secret) | ||
- | ## Extended config items ## | ||
- | count=$(get_config idp.sealer._count 30) | ||
- | # default cannot be empty - so " | ||
- | sync_hosts=$(get_config idp.sealer._sync_hosts ${HOSTNAME}) | ||
- | |||
- | # Run the keygen utility | ||
- | ${0%/ | ||
- | --storefile " | ||
- | --storepass " | ||
- | --versionfile " | ||
- | --alias " | ||
- | --count " | ||
- | |||
- | # Display current version | ||
- | echo "INFO: $(tac " | ||
- | |||
- | for EACH in ${sync_hosts} | ||
- | do | ||
- | if [ " | ||
- | then | ||
- | echo "INFO: Host ' | ||
- | elif ! ping -q -c 1 -W 3 ${EACH} >/ | ||
- | then | ||
- | echo " | ||
- | else | ||
- | # run scp in the background | ||
- | scp " | ||
- | fi | ||
- | done | ||
- | </ |