aboutsummaryrefslogtreecommitdiff
path: root/handlers/dup.in
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2012-01-29 14:39:39 +0100
committerintrigeri <intrigeri@boum.org>2012-01-29 15:09:37 +0100
commit357a17b155f769f0bf290f3a11e2d84aa4350a60 (patch)
treeb35d8f93dfd345b36eaa719fb3743ebc87b00a15 /handlers/dup.in
parent0a0fbb46baa1fd5e6bb68c9e3f9f0b28dfa17e15 (diff)
downloadbackupninja-357a17b155f769f0bf290f3a11e2d84aa4350a60.tar.gz
backupninja-357a17b155f769f0bf290f3a11e2d84aa4350a60.tar.bz2
Use --ssh-options with dup >= 0.6.17.
... and warn about unsupported options.
Diffstat (limited to 'handlers/dup.in')
-rw-r--r--handlers/dup.in22
1 files changed, 16 insertions, 6 deletions
diff --git a/handlers/dup.in b/handlers/dup.in
index a3684c8..b358406 100644
--- a/handlers/dup.in
+++ b/handlers/dup.in
@@ -114,13 +114,23 @@ duplicity_minor="`echo $duplicity_version | @AWK@ -F '.' '{print $2}'`"
duplicity_sub="`echo $duplicity_version | @AWK@ -F '.' '{print $3}'`"
### ssh/scp/sftp options (duplicity < 0.4.3 is unsupported)
-scpoptions="$sshoptions"
-if [ "$bandwidthlimit" != 0 ]; then
- [ -z "$desturl" ] || warning 'The bandwidthlimit option is not used when desturl is set.'
- scpoptions="$scpoptions -l $bandwidthlimit"
+## 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'
+ fi
+ execstr_options="${execstr_options} --ssh-options '$sshoptions'"
+## duplicity < 0.6.17 : scp/sftp backend
+else
+ scpoptions="$sshoptions"
+ if [ "$bandwidthlimit" != 0 ]; then
+ [ -z "$desturl" ] || warning 'The bandwidthlimit option is not used when desturl is set.'
+ scpoptions="$scpoptions -l $bandwidthlimit"
+ fi
+ sftpoptions="$sshoptions"
+ execstr_options="${execstr_options} --scp-command 'scp $scpoptions' --sftp-command 'sftp $sftpoptions'"
fi
-sftpoptions="$sshoptions"
-execstr_options="${execstr_options} --scp-command 'scp $scpoptions' --sftp-command 'sftp $sftpoptions'"
### Symmetric or asymmetric (public/private key pair) encryption
if [ -n "$encryptkey" ]; then