-
- if [ "$*" = "--server --sender -vlogDtprze.iLsf . -new-/" ] ; then
- serve_dir "$remote_host" "$BASEDIR/current-push"
- elif [ "$*" = "--server --sender -vlogDtprze.iLsf . -live-/" ] ; then
- local p="$BASEDIR/current-live"
- info "host $remote_host wants $p, acquiring lock"
- lock 200 "$p" 0
- serve_dir "$remote_host" "$p"
- else
- info "NOT allowed for $remote_host: rsync $*"
- echo >&2 "This rsync command ($@) not allowed."
- exit 1
- fi
+ local args="--server --sender -vlHtrze.iLsf --safe-links ."
+
+ for component in $(awk -v this_host="$(hostname -f)" '$1 == this_host {print $2}' $COMPONENTLIST); do
+ if [ "$*" = "$args $component/-new-/" ] || [ "$*" = "$args ./$component/-new-/" ] ; then
+ local path="$BASEDIR/$component-current-push"
+ info "serving $remote_host with $path"
+ rsync $args "$path/."
+ return
+ elif [ "$*" = "$args . $component/-live-/" ] || [ "$*" = "$args . ./$component/-live-/" ] ; then
+ local path="$BASEDIR/$component-current-live"
+ info "host $remote_host wants $path, acquiring lock"
+ lock 200 "$path" 0
+ rsync $args "$path/."
+ return
+ fi
+ done
+
+ info "NOT allowed for $remote_host: rsync $*"
+ echo >&2 "This rsync command ($@) not allowed."
+ exit 1