make sample borgvars file

This commit is contained in:
Asif Bacchus 2020-03-26 05:49:23 -06:00
parent 846789efe7
commit 9ef05505a6
2 changed files with 16 additions and 3 deletions

View File

@ -4,15 +4,15 @@
"fsPath": "$ROOTPATH$/borghelper.sh", "fsPath": "$ROOTPATH$/borghelper.sh",
"bookmarks": [ "bookmarks": [
-1, -1,
261, 151,
159, 168,
-1, -1,
-1, -1,
-1, -1,
-1, -1,
-1, -1,
-1, -1,
92 105
] ]
} }
] ]

View File

@ -103,6 +103,10 @@ while [ $# -gt 0 ]; do
# list all backup archives # list all backup archives
operation='listall' operation='listall'
;; ;;
--makevars)
# make a borgvars template file
operation='makevars'
;;
-p|--path) -p|--path)
# path to restore files # path to restore files
if [ -z "$2" ]; then if [ -z "$2" ]; then
@ -145,6 +149,15 @@ while [ $# -gt 0 ]; do
done done
### process 'makevars' operation
if [ "$operation" = 'makevars' ]; then
if ! printf "sshKeyFile=\nborgBaseDir=\nborgRepo=\nborgRepoPassword=\nborgRemote=\n" > ./sample.borgvars; then
consoleError 4 'Could not write sample borgvars file.'
else
exit 0
fi
fi
### check parameter validity ### check parameter validity
# no operation # no operation