From 4a2516ccab863ddac20c12c9edb4fc9be721b43f Mon Sep 17 00:00:00 2001 From: Simon Paillard Date: Tue, 21 May 2013 16:26:00 +0200 Subject: 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 --- etc/common | 5 +++-- 1 file 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 } -- cgit v1.2.3