feature(add option for separate keyfile):

This commit is contained in:
Asif Bacchus 2021-05-15 09:05:04 -06:00
parent a86f13a1e5
commit 8b201ca047
1 changed files with 6 additions and 1 deletions

View File

@ -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