summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Paillard <spaillard@debian.org>2013-05-21 16:26:00 +0200
committerSimon Paillard <spaillard@debian.org>2013-05-21 16:26:00 +0200
commit4a2516ccab863ddac20c12c9edb4fc9be721b43f (patch)
treec0d7b0226811b45efba29b0364e9d62bba4fab40
parent84818416816a609a01031e2f5b000e9167f7be43 (diff)
rsync_protocol(): fix regex for bash 3.2
Thanks to maswan for the notice: etc/common: line 239: unexpected argument `(' to conditional binary operator' Introduced by 8d734b / a37134
-rw-r--r--etc/common5
1 files changed, 3 insertions, 2 deletions
diff --git a/etc/common b/etc/common
index de3cfac..49ca038 100644
--- a/etc/common
+++ b/etc/common
@@ -236,8 +236,9 @@ savelog() {
# Return rsync version
rsync_protocol() {
RSYNC_VERSION="$(${RSYNC} --version)"
- if [[ $RSYNC_VERSION =~ (protocol[ ]+version[ ]+([0-9]+)) ]]; then
+ RSYNC_REGEX="(protocol[ ]+version[ ]+([0-9]+))"
+ if [[ ${RSYNC_VERSION} =~ ${RSYNC_REGEX} ]]; then
echo ${BASH_REMATCH[2]}
fi
- unset RSYNC_VERSION
+ unset RSYNC_VERSION RSYNC_REGEX
}