__file: implement --state exists
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
		
					parent
					
						
							
								8f525fbc83
							
						
					
				
			
			
				commit
				
					
						f769b395c2
					
				
			
		
					 2 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -27,7 +27,7 @@ exists="$(cat "$__object/explorer/exists")"
 | 
			
		|||
 | 
			
		||||
[ "$state_should" = "exists" -a "$exists" = "yes" ] && exit 0 # nothing to do
 | 
			
		||||
 | 
			
		||||
if [ "$state_should" = "present" ]; then
 | 
			
		||||
if [ "$state_should" = "present" -o "$state_should" = "exists" ]; then
 | 
			
		||||
   if [ -f "$__object/parameter/source" ]; then
 | 
			
		||||
      source="$(cat "$__object/parameter/source")"
 | 
			
		||||
      if [ "$source" = "-" ]; then
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -26,7 +26,7 @@ state_should="$(cat "$__object/parameter/state")"
 | 
			
		|||
exists="$(cat "$__object/explorer/exists")"
 | 
			
		||||
 | 
			
		||||
case "$state_should" in
 | 
			
		||||
   present)
 | 
			
		||||
   present|exists)
 | 
			
		||||
      # No source? Create empty file
 | 
			
		||||
      if [ ! -f "$__object/parameter/source" ]; then
 | 
			
		||||
         if [ "$exists" = "no" ]; then
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue