X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Froles%2Ffiles%2Fstatic-mirroring%2Fstatic-update-component;h=455d17d38b7adaae3db39255a0a4ae10a9b609ab;hb=4658098c84ab6b11f6419fee7cc0e70f7eeb25df;hp=f8ca81ee060a418e7c7b46f95e1822f68bbe9e1c;hpb=e32a215b684c64e051ba9aa0c679bee15e48e58f;p=mirror%2Fdsa-puppet.git diff --git a/modules/roles/files/static-mirroring/static-update-component b/modules/roles/files/static-mirroring/static-update-component index f8ca81ee0..455d17d38 100755 --- a/modules/roles/files/static-mirroring/static-update-component +++ b/modules/roles/files/static-mirroring/static-update-component @@ -27,6 +27,11 @@ usage() { } componentlist=/etc/static-components.conf +. /etc/staticsync.conf +if ! [ -n "$staticuser" ]; then + echo >&2 "staticuser not configured!" + exit 1 +fi if [ "$#" = 1 ]; then component="$1" @@ -72,8 +77,8 @@ if [ "$srchost" = "$thishost" ] && ! [ -d "$srcdir" ]; then exit 1 fi -if [ "`id -nu`" != "staticsync" ]; then - sudo -u staticsync static-update-component "$@" +if [ "`id -nu`" != "$staticuser" ]; then + sudo -u "$staticuser" static-update-component "$@" else ssh -o AddressFamily=inet -t -t -o ServerAliveInterval=300 -o PreferredAuthentications=publickey "$masterhost" static-master-update-component "$component" fi