summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorJoerg Jaspert <joerg@debian.org>2009-12-28 16:47:20 +0100
committerJoerg Jaspert <joerg@debian.org>2009-12-28 16:47:20 +0100
commit5533b44c10b35725d13276b1d7f3194250ac4add (patch)
tree29a71133542762dc3ccb2a65ed050acf3e0c1b73 /bin
parentc8b0797f49ed9af655f5c7a6e57ffd2075fdb293 (diff)
ftpsync. call runmirrors with getopts args
call runmirrors with the getopts args it has now. always present -a and -f. only set -s and -k when appropriate. Signed-off-by: Joerg Jaspert <joerg@debian.org>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ftpsync39
1 files changed, 27 insertions, 12 deletions
diff --git a/bin/ftpsync b/bin/ftpsync
index b6d9d95..2808d34 100755
--- a/bin/ftpsync
+++ b/bin/ftpsync
@@ -458,18 +458,33 @@ function mainroutine() {
rm -f "${LOCK}"
if [ x${HUB} = "xtrue" ]; then
- # Only trigger slave mirrors if we had a push for stage2 or all
- if [ "xtruex" = "x${SYNCSTAGE2}x" ] || [ "xtruex" = "x${SYNCALL}x" ]; then
- log "Trigger slave mirrors"
- ${BASEDIR}/bin/runmirrors "${ARCHIVE}"
- log "Trigger slave done"
-
- HOOK=(
- HOOKNR=5
- HOOKSCR=${HOOK5}
- )
- hook $HOOK
- fi
+ # Trigger slave mirrors if we had a push for stage2 or all, or if its mhop
+ if [ "xtruex" = "x${SYNCSTAGE2}x" ] || [ "xtruex" = "x${SYNCALL}x" ] || [ "xtruex" = "x${SYNCMHOP}x" ]; then
+ # We tell runmirrors about the archive we are running on. Might be empty.
+ RUNMIRRORARGS="-a ${ARCHIVE}"
+ # We also tell runmirrors that we are running it from within ftpsync, so it can change
+ # the way it works with mhop based on that.
+ RUNMIRRORARGS="${RUNMIRRORARGS} -f"
+
+ if [ "xtruex" = "x${SYNCSTAGE1}x" ]; then
+ # This is true when we have a mhop sync. And only then, due to the earlier if.
+ # So if that happens, tell runmirrors we are doing mhop stage1.
+ RUNMIRRORARGS="${RUNMIRRORARGS} -s stage1 -k mhop"
+ elif [ "xtruex" = "x${SYNCSTAGE2}x" ]; then
+ RUNMIRRORARGS="${RUNMIRRORARGS} -s stage2"
+ elif [ "xtruex" = "x${SYNCALL}x" ]; then
+ RUNMIRRORARGS="${RUNMIRRORARGS} -s all"
+ fi
+ log "Trigger slave mirrors"
+ ${BASEDIR}/bin/runmirrors "${RUNMIRRORARGS}"
+ log "Trigger slave done"
+
+ HOOK=(
+ HOOKNR=5
+ HOOKSCR=${HOOK5}
+ )
+ hook $HOOK
+ fi
fi
# All done, lets call cleanup