From 04b8bcbb6e5d7b8158e8ba161c0e5a8c99e7f765 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20Ob=C5=AFrka?= Date: Mon, 3 Apr 2017 12:25:20 +0200 Subject: Add ssh_use_connection as a configuration option --- backuper.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/backuper.sh b/backuper.sh index 3297780..436b791 100644 --- a/backuper.sh +++ b/backuper.sh @@ -25,6 +25,7 @@ EXCLUDE="" GPG_RECIPIENTS="" TAR_EXTRA_PARAMS="" SSH_EXTRA_PARAMS="" +SSH_CONNECTION="" STORE="" AFTER="" FILE_TYPE="" @@ -169,6 +170,11 @@ ssh_use_key() { ssh_extra_param "-i "$KEY_PATH"" } +ssh_use_connection() { + CONNSTR="$1" + SSH_CONNECTION="$CONNSTR" +} + store() { STORE="$@" } @@ -192,8 +198,11 @@ store_file() { ## This is not standart feature but it is common for several project I know store_ssh() { - [ -z "$1" ] && error "Specify server" - CONNECTION="$1" + [ -z "$1" -a -z "$SSH_CONNECTION" ] && error "Specify server" + CONNECTION="$SSH_CONNECTION" + if [ -n "$1" ]; then + CONNECTION="$1" + fi add_custom_stage "echo_and_copy "$FILENAME"" store "ssh $SSH_EXTRA_PARAMS "$CONNECTION"" -- cgit v1.2.3