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", | 			"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 | ||||||
| 			] | 			] | ||||||
| 		} | 		} | ||||||
| 	] | 	] | ||||||
|  | |||||||
| @ -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 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user