aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--backuper.sh13
1 files 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""