From: Peter Palfrader Date: Sat, 8 Dec 2012 17:20:14 +0000 (+0100) Subject: Let provider hosts trigger updates X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=9cbba66bc8ff183ca0d138533698b63792e2a578;p=mirror%2Fdsa-puppet.git Let provider hosts trigger updates --- diff --git a/modules/roles/files/static-mirroring/static-master-ssh-wrap b/modules/roles/files/static-mirroring/static-master-ssh-wrap index 2b2ddea7f..df7e7217b 100755 --- a/modules/roles/files/static-mirroring/static-master-ssh-wrap +++ b/modules/roles/files/static-mirroring/static-master-ssh-wrap @@ -26,6 +26,7 @@ set -u MYLOGNAME="`basename "$0"`[$$]" BASEDIR="/home/staticsync/static-master" +COMPONENTLIST=/etc/static-components.conf usage() { echo "local Usage: $0 " @@ -109,15 +110,16 @@ do_update_component() { component="$1" shift - #if [ "$component" = "www.torproject.org" ] && [ "$remote_host" = "vescum.torproject.org" ]; then - # exec static-master-update-component "$component" - # echo >&2 "Exec failed" - # croak "exec failed" - #else + hit="$(awk -v component="$component" -v host="$remote_host" '$1 == component && $2 == host {print $3; exit}' "$COMPONENTLIST")" + if [ -n "$hit" ]; then + exec static-master-update-component "$component" + echo >&2 "Exec failed" + croak "exec failed" + else info "Not whitelisted: $remote_host update $component" echo >&2 "Not whitelisted: $remote_host update $component" exit 1 - #fi + fi }