diff options
author | Robin Obůrka <r.oburka@gmail.com> | 2017-04-03 11:19:12 +0200 |
---|---|---|
committer | Robin Obůrka <r.oburka@gmail.com> | 2017-04-03 16:10:42 +0200 |
commit | 1ca9a4ebcabc4c359b1807feadf7daa89630153c (patch) | |
tree | 7fefef543ea2bae8dc221cc5f1858772ce6d8ded | |
parent | fix: Remove ' ' from warning parameter (diff) | |
download | backuper-1ca9a4ebcabc4c359b1807feadf7daa89630153c.tar.xz |
Add support for -i definition trough interface
-rw-r--r-- | backuper.sh | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/backuper.sh b/backuper.sh index 801c229..6b297ee 100644 --- a/backuper.sh +++ b/backuper.sh @@ -27,6 +27,7 @@ COMMAND="" PLACES="" EXCLUDE="" TAR_EXTRA_PARAMS="" +SSH_EXTRA_PARAMS="" STORE="" AFTER="" FILE_TYPE="" @@ -151,6 +152,18 @@ numeric_owner() { tar_extra_param "--numeric-owner" } +ssh_extra_param() { + PARAM="$1" + if ! echo "$SSH_EXTRA_PARAMS" | grep -q -- "$PARAM" ; then + SSH_EXTRA_PARAMS="$SSH_EXTRA_PARAMS $PARAM" + fi +} + +ssh_use_key() { + KEY_PATH="$1" + ssh_extra_param "-i "$KEY_PATH"" +} + store() { STORE="$@" } @@ -178,7 +191,7 @@ store_ssh() { CONNECTION="$1" add_custom_stage "echo_and_copy "$FILENAME"" - store "ssh "$CONNECTION"" + store "ssh $SSH_EXTRA_PARAMS "$CONNECTION"" } echo_and_copy() { |