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