Add logic to check for existence of files before interacting with them
if ${rcvar} or ${rcvar}.new don't exist, we can't rm/mv them.
	
	
This commit is contained in:
		
					parent
					
						
							
								34ca94ffa2
							
						
					
				
			
			
				commit
				
					
						a1793f66ff
					
				
			
		
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
					@ -36,6 +36,6 @@ fi
 | 
				
			||||||
rcvar=$(cat "$__object/explorer/rcvar")
 | 
					rcvar=$(cat "$__object/explorer/rcvar")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# --state absent, so ensure that .new doesn't exist and that conf is renamed to .old
 | 
					# --state absent, so ensure that .new doesn't exist and that conf is renamed to .old
 | 
				
			||||||
echo rm \"${rcvar}.new\"
 | 
					echo "[ -f \"${rcvar}.new\" ] && rm \"${rcvar}.new\""
 | 
				
			||||||
echo mv \"${rcvar}\" \"${rcvar}.old\"
 | 
					echo "[ -f \"${rcvar}\" ] && mv \"${rcvar}\" \"${rcvar}.old\""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue