aboutsummaryrefslogtreecommitdiff
path: root/lib/beam/common.in
diff options
context:
space:
mode:
Diffstat (limited to 'lib/beam/common.in')
-rw-r--r--lib/beam/common.in23
1 files changed, 21 insertions, 2 deletions
diff --git a/lib/beam/common.in b/lib/beam/common.in
index e99433e..4f2184b 100644
--- a/lib/beam/common.in
+++ b/lib/beam/common.in
@@ -1,6 +1,6 @@
#! /bin/sh
# This file is part of BEAM
-# Copyright (C) 2012 Sergey Poznyakoff
+# Copyright (C) 2012-2014 Sergey Poznyakoff
#
# BEAM is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -76,7 +76,7 @@ tarcode() {
}
load_config() {
- local delayed_exit
+ local delayed_exit remote
test -z "$BEAM_CONFIG" && BEAM_CONFIG=@SYSCONFDIR@/beam.conf
if [ -r $BEAM_CONFIG ]; then
@@ -130,6 +130,25 @@ $type"
. @LIBDIR@/beam/s3.sh
prologue_hook="s3_mount $prologue_hook"
fi
+
+ remote=${backup_archive_dir%%:*}
+ if [ "$remote" != "$backup_archive_dir" ]; then
+ beam_rsh="${backup_rsh:-ssh} $remote"
+ backup_local_archive_dir=${backup_archive_dir#*:}
+ else
+ beam_rsh=
+ backup_local_archive_dir=$backup_archive_dir
+ fi
+}
+
+beam_exec() {
+ if [ -z "$beam_rsh" ]; then
+ set -- $(echo "$@" | sed 's/\\\\\([bcfnrtv0]\)/\\\1/g')
+ "$@"
+ else
+ set -- $(echo "$@" | sed 's/\\\\\([bcfnrtv0]\)/\\\1/g;s/[]\[\\\*]/\\&/g')
+ $beam_rsh "$@"
+ fi
}
runhook() {

Return to:

Send suggestions and report system problems to the System administrator.