aboutsummaryrefslogtreecommitdiff
path: root/handlers
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2013-07-23 12:01:37 +0200
committerintrigeri <intrigeri@boum.org>2013-07-23 12:01:37 +0200
commit7a5045baf1ee3f76a5e08ae86d86e67ed5a398d2 (patch)
tree4ea587fed8667c89660b6ca0180a06cdc52972d2 /handlers
parentb3275eb7b15788049576e2ab96e1e82cce398240 (diff)
downloadbackupninja-7a5045baf1ee3f76a5e08ae86d86e67ed5a398d2.tar.gz
backupninja-7a5045baf1ee3f76a5e08ae86d86e67ed5a398d2.tar.bz2
dup: Gracefully handle legacy spaces between -o and IdentityFile.
Diffstat (limited to 'handlers')
-rw-r--r--handlers/dup.in12
1 files changed, 10 insertions, 2 deletions
diff --git a/handlers/dup.in b/handlers/dup.in
index 36db959..a67848f 100644
--- a/handlers/dup.in
+++ b/handlers/dup.in
@@ -125,8 +125,16 @@ duplicity_sub="`echo $duplicity_version | @AWK@ -F '.' '{print $3}'`"
## duplicity >= 0.6.17 : paramiko backend
if [ "$duplicity_major" -ge 0 -a "$duplicity_minor" -ge 6 -a "$duplicity_sub" -ge 17 ]; then
if [ -n "$sshoptions" ]; then
- echo "$sshoptions" | grep -Eqs '^-o[[:space:]]*IdentityFile=[^ ]+$' \
- || warning 'duplicity >= 0.6.17 only supports the IdentityFile SSH option'
+ if echo "$sshoptions" | grep -Eqs '^-o[[:space:]]*IdentityFile=[^ ]+$' ; then
+ spaceless_sshoptions="$(echo -n "$sshoptions" | @SED@ 's/^-o[[:space:]]*/-o/')"
+ if [ "$spaceless_sshoptions" != "$sshoptions" ] ; then
+ warning 'Since duplicity >= 0.6.17, sshoptions option requires no space between -o and IdentityFile.'
+ warning 'The bad space has been ignored. Update your duplicity handler config file to suppress this message.'
+ sshoptions="$spaceless_sshoptions"
+ fi
+ else
+ warning 'duplicity >= 0.6.17 only supports the IdentityFile SSH option'
+ fi
fi
execstr_options="${execstr_options} --ssh-options '$sshoptions'"
if [ "$bandwidthlimit" != 0 ]; then