make sample borgvars file
This commit is contained in:
		
							parent
							
								
									846789efe7
								
							
						
					
					
						commit
						9ef05505a6
					
				
							
								
								
									
										6
									
								
								.vscode/numbered-bookmarks.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								.vscode/numbered-bookmarks.json
									
									
									
									
										vendored
									
									
								
							| @ -4,15 +4,15 @@ | ||||
| 			"fsPath": "$ROOTPATH$/borghelper.sh", | ||||
| 			"bookmarks": [ | ||||
| 				-1, | ||||
| 				261, | ||||
| 				159, | ||||
| 				151, | ||||
| 				168, | ||||
| 				-1, | ||||
| 				-1, | ||||
| 				-1, | ||||
| 				-1, | ||||
| 				-1, | ||||
| 				-1, | ||||
| 				92 | ||||
| 				105 | ||||
| 			] | ||||
| 		} | ||||
| 	] | ||||
|  | ||||
| @ -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 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user