From 8b201ca04777169cae55a44c3c6af5b276aadddc Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Sat, 15 May 2021 09:05:04 -0600 Subject: [PATCH] feature(add option for separate keyfile): --- borghelper.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/borghelper.sh b/borghelper.sh index 7c52c40..ed13a27 100755 --- a/borghelper.sh +++ b/borghelper.sh @@ -224,7 +224,7 @@ done ### process 'makevars' operation if [ "$operation" = 'makevars' ]; then - if ! printf "sshKeyFile=\nborgBaseDir=\nborgRepo=\nborgRepoPassword=\nborgRemote=\n" > ./sample.borgvars; then + if ! printf "sshKeyFile=\nborgBaseDir=\nborgRepo=\nborgRepoPassword=\nborgRepoKey=\nborgRemote=\n" > ./sample.borgvars; then consoleError 4 'Could not write sample borgvars file.' else exit 0 @@ -344,6 +344,11 @@ else consoleError 2 "$varsFile: 'borgRepoPassword' must be specified or must be 'none' if no password has been set (VERY INSECURE!)." fi +# check borg keyfile if supplied +if [ -n "${borgRepoKey}" ]; then + export BORG_KEY_FILE="${borgRepoKey}" +fi + # export borg remote path, if specified if [ -n "${borgRemote}" ]; then export BORG_REMOTE_PATH="${borgRemote}"; fi