diff options
author | Simon Paillard <spaillard@debian.org> | 2013-05-21 16:26:00 +0200 |
---|---|---|
committer | Simon Paillard <spaillard@debian.org> | 2013-05-21 16:26:00 +0200 |
commit | 4a2516ccab863ddac20c12c9edb4fc9be721b43f (patch) | |
tree | c0d7b0226811b45efba29b0364e9d62bba4fab40 | |
parent | 84818416816a609a01031e2f5b000e9167f7be43 (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/common | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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 } |