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

View File

@ -224,7 +224,7 @@ done
### process 'makevars' operation ### process 'makevars' operation
if [ "$operation" = 'makevars' ]; then 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.' consoleError 4 'Could not write sample borgvars file.'
else else
exit 0 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!)." consoleError 2 "$varsFile: 'borgRepoPassword' must be specified or must be 'none' if no password has been set (VERY INSECURE!)."
fi fi
# check borg keyfile if supplied
if [ -n "${borgRepoKey}" ]; then
export BORG_KEY_FILE="${borgRepoKey}"
fi
# export borg remote path, if specified # export borg remote path, if specified
if [ -n "${borgRemote}" ]; then export BORG_REMOTE_PATH="${borgRemote}"; fi if [ -n "${borgRemote}" ]; then export BORG_REMOTE_PATH="${borgRemote}"; fi