X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Froles%2Ffiles%2Fstatic-mirroring%2Fstatic-update-component;h=455d17d38b7adaae3db39255a0a4ae10a9b609ab;hb=0aac917e02155dbb1b9f06d317f389feac08911d;hp=27b9318e19df4278000813e2c5841b2f46d4018e;hpb=e34de125f490a23dbc1a9ce7d4101d946fe93083;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 27b9318e1..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,10 +77,10 @@ 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 -o ServerAliveInterval=300 -o PreferredAuthentications=publickey "$masterhost" static-master-update-component "$component" + ssh -o AddressFamily=inet -t -t -o ServerAliveInterval=300 -o PreferredAuthentications=publickey "$masterhost" static-master-update-component "$component" fi # vim:set et: