diff --git a/.vscode/numbered-bookmarks.json b/.vscode/numbered-bookmarks.json index b575bcb..a33e492 100644 --- a/.vscode/numbered-bookmarks.json +++ b/.vscode/numbered-bookmarks.json @@ -4,15 +4,15 @@ "fsPath": "$ROOTPATH$/borghelper.sh", "bookmarks": [ -1, - 261, - 159, + 151, + 168, -1, -1, -1, -1, -1, -1, - 92 + 105 ] } ] diff --git a/borghelper.sh b/borghelper.sh index 9e54172..23755e9 100755 --- a/borghelper.sh +++ b/borghelper.sh @@ -103,6 +103,10 @@ while [ $# -gt 0 ]; do # list all backup archives operation='listall' ;; + --makevars) + # make a borgvars template file + operation='makevars' + ;; -p|--path) # path to restore files if [ -z "$2" ]; then @@ -145,6 +149,15 @@ while [ $# -gt 0 ]; do 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 # no operation