diff options
author | Joerg Jaspert <joerg@debian.org> | 2008-10-02 20:42:18 +0200 |
---|---|---|
committer | Joerg Jaspert <joerg@debian.org> | 2008-10-02 20:42:18 +0200 |
commit | 7e1b496648fb47cbab85cd9304a16c70cd398f4e (patch) | |
tree | f40b389636b1a4c0d5c478f4b58befd0281e1996 /bin/ftpsync | |
parent | ddb3c9f2286f6e18dbaf9855dc28cb7fb82587fb (diff) |
ftpsync
also allow anonymous syncs
Signed-off-by: Joerg Jaspert <joerg@debian.org>
Diffstat (limited to 'bin/ftpsync')
-rwxr-xr-x | bin/ftpsync | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/bin/ftpsync b/bin/ftpsync index 2b6bc44..0d92b2b 100755 --- a/bin/ftpsync +++ b/bin/ftpsync @@ -158,6 +158,14 @@ if [ -n "${HOOK1}" ]; then log "Back from hook1, got returncode ${result}" fi +# Now, we might want to sync from anonymous too. +# This is that deep in this script so hook1 could, if wanted, change things! +if [ -z ${RSYNC_USER} ]; then + RSYNCPTH="${RSYNC_HOST}" +else + RSYNCPTH="${RSYNC_USER}@${RSYNC_HOST}" +fi + # Now do the actual mirroring, and run as long as we have an updaterequired file. while [ -e "${UPDATEREQUIRED}" ]; do log "Running mirrorsync, update is required, ${UPDATEREQUIRED} exists" @@ -165,7 +173,7 @@ while [ -e "${UPDATEREQUIRED}" ]; do # Step one, sync everything except Packages/Releases ${RSYNC} ${RSYNC_OPTIONS} ${RSYNC_OPTIONS1} ${EXCLUDE} ${SOURCE_EXCLUDE} \ - ${RSYNC_USER}@${RSYNC_HOST}::${RSYNC_PATH} ${TO} + ${RSYNCPTH}::${RSYNC_PATH} ${TO} result=$? # 24 - vanished source files. Ignored, that should be the target of $UPDATEREQUIRED @@ -182,7 +190,7 @@ while [ -e "${UPDATEREQUIRED}" ]; do # We are lucky, it worked. Now do step 2 and sync again, this time including # the packages/releases files ${RSYNC} ${RSYNC_OPTIONS} ${RSYNC_OPTIONS2} ${EXCLUDE} ${SOURCE_EXCLUDE} \ - ${RSYNC_USER}@${RSYNC_HOST}::${RSYNC_PATH} ${TO} + ${RSYNCPTH}::${RSYNC_PATH} ${TO} result=$? if [ $result -eq 0 ] || [ $result -eq 24 ]; then if [ -n "${HOOK3}" ]; then |