From 1ca9a4ebcabc4c359b1807feadf7daa89630153c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20Ob=C5=AFrka?= Date: Mon, 3 Apr 2017 11:19:12 +0200 Subject: Add support for -i definition trough interface --- backuper.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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() { -- cgit v1.2.3