From 9cbba66bc8ff183ca0d138533698b63792e2a578 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sat, 8 Dec 2012 18:20:14 +0100 Subject: [PATCH] Let provider hosts trigger updates --- .../files/static-mirroring/static-master-ssh-wrap | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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 } -- 2.20.1