summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Paillard <spaillard@debian.org>2013-05-21 16:42:50 +0200
committerSimon Paillard <spaillard@debian.org>2013-05-21 16:43:30 +0200
commit6372cc4f99943a8b0865603d7871e7d79e4b8b4e (patch)
tree3583287cd2cb4517c10a580500b1bcc5438ea5a3
parent4a2516ccab863ddac20c12c9edb4fc9be721b43f (diff)
RSYNC_OPTIONS and delete-method: fix regex for bash 3.2
Introduced by 8d734b614f2f6a33f71cc0
-rwxr-xr-xbin/ftpsync4
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/ftpsync b/bin/ftpsync
index 6c91970..9ac18ab 100755
--- a/bin/ftpsync
+++ b/bin/ftpsync
@@ -323,9 +323,11 @@ RSYNC_EXTRA=${RSYNC_EXTRA:-""}
RSYNC_OPTIONS="${RSYNC_EXTRA} --bwlimit=${RSYNC_BW} ${RSYNC_OPTIONS}"
# Finally, make sure RSYNC_OPTIONS2 has either --delete-after or --deleter-delay
-if ! [[ ${RSYNC_OPTIONS2} =~ --delete-(after|delay) ]]; then
+RSYNC_OPTION_REGEX="--delete-(after|delay)"
+if ! [[ ${RSYNC_OPTIONS2} =~ ${RSYNC_OPTION_REGEX} ]]; then
RSYNC_OPTIONS2+=" --delete-${RSYNC_DELETE_METHOD}"
fi
+unset RSYNC_OPTION_REGEX
# We have no default host to sync from, but will error out if its unset
RSYNC_HOST=${RSYNC_HOST:-""}