X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Froles%2Ffiles%2Fstatic-mirroring%2Fstatic-master-ssh-wrap;h=625d3d9b5df10229db79bf5637f68714f5784b8d;hb=c884c33d52f570673980578d2e43312004eda8ee;hp=06ab715f4d95460222b43da34d858f997878b34c;hpb=f42cb0499ff05950c567b58393e81ffe77292b49;p=mirror%2Fdsa-puppet.git diff --git a/modules/roles/files/static-mirroring/static-master-ssh-wrap b/modules/roles/files/static-mirroring/static-master-ssh-wrap index 06ab715f4..625d3d9b5 100755 --- a/modules/roles/files/static-mirroring/static-master-ssh-wrap +++ b/modules/roles/files/static-mirroring/static-master-ssh-wrap @@ -73,12 +73,12 @@ lock() { do_rsync() { local remote_host="$1"; shift - local args="--server --sender -vltrze.iLsf --safe-links ." - if [ "$*" = "$args -new-/" ] ; then + local args="--server --sender -vlHtrze.iLsf --safe-links ." + if [ "$*" = "$args -new-/" ] || [ "$*" = "$args ./-new-/" ] ; then local path="$BASEDIR/current-push" info "serving $remote_host with $path" rsync $args "$path/." - elif [ "$*" = "$args . -live-/" ] ; then + elif [ "$*" = "$args . -live-/" ] || [ "$*" = "$args . ./-live-/" ] ; then local path="$BASEDIR/current-live" info "host $remote_host wants $path, acquiring lock" lock 200 "$path" 0 @@ -97,7 +97,23 @@ do_update_component() { component="$1" shift - hit="$(awk -v component="$component" -v host="$remote_host" '$1 == component && $2 == host {print $3; exit}' "$COMPONENTLIST")" + hit="$( + awk -v component="$component" -v host="$remote_host" ' + $1 == component { + if ($2 == host) { + print $3 + exit + } + split($4,extra,",") + for (i in extra) { + if (host == extra[i]) { + printf "%s:%s\n", $2, $3 + exit + } + } + exit + }' "$COMPONENTLIST" + )" if [ -n "$hit" ]; then exec static-master-update-component "$component" echo >&2 "Exec failed"