X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Froles%2Ffiles%2Fstatic-mirroring%2Fstatic-update-component;h=f8ca81ee060a418e7c7b46f95e1822f68bbe9e1c;hb=7f7434750332a872d97581f5970edbb2222fbc74;hp=7e847545537d978685a2992e2976777b564bd98b;hpb=651fe05d48395dc41a629de4567383db7c97fbb4;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 7e8475455..f8ca81ee0 100755 --- a/modules/roles/files/static-mirroring/static-update-component +++ b/modules/roles/files/static-mirroring/static-update-component @@ -41,12 +41,12 @@ if [ "${component%/*}" != "$component" ] ; then fi thishost=$(hostname -f) -masterhost="$(awk -v component="$component" '$2 == component {print $1; exit}' "$componentlist")" -srchost="$(awk -v component="$component" '$2 == component {print $3; exit}' "$componentlist")" -srcdir="$(awk -v component="$component" '$2 == component {print $4; exit}' "$componentlist")" +masterhost="$(awk -v component="$component" '!/^ *(#|$)/ && $2 == component {print $1; exit}' "$componentlist")" +srchost="$(awk -v component="$component" '!/^ *(#|$)/ && $2 == component {print $3; exit}' "$componentlist")" +srcdir="$(awk -v component="$component" '!/^ *(#|$)/ && $2 == component {print $4; exit}' "$componentlist")" inextralist="$( awk -v component="$component" -v host="$thishost" ' - $2 == component { + !/^ *(#|$)/ && $2 == component { split($5,extra,",") for (i in extra) { if (host == extra[i]) { @@ -72,10 +72,10 @@ if [ "$srchost" = "$thishost" ] && ! [ -d "$srcdir" ]; then exit 1 fi -if [ "`id -nu`" != "staticsync" ] && [ "$masterhost" = "`hostname -f`" ]; then - static-update-component "$@" +if [ "`id -nu`" != "staticsync" ]; then + sudo -u staticsync 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: