have to report absent state no matter what the desired state is
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
		
					parent
					
						
							
								cad2097d05
							
						
					
				
			
			
				commit
				
					
						ef81f03e89
					
				
			
		
					 1 changed files with 5 additions and 2 deletions
				
			
		| 
						 | 
					@ -29,10 +29,13 @@ value="$(cat "$__object/parameter/value" 2>/dev/null \
 | 
				
			||||||
 | 
					
 | 
				
			||||||
case "$state" in
 | 
					case "$state" in
 | 
				
			||||||
   absent)
 | 
					   absent)
 | 
				
			||||||
 | 
					      if egrep -q "^$key$delimiter+" "$file"; then
 | 
				
			||||||
         # if the key exists, with whatever value, we will have to remove it
 | 
					         # if the key exists, with whatever value, we will have to remove it
 | 
				
			||||||
         # so report it as present
 | 
					         # so report it as present
 | 
				
			||||||
      if egrep -q "^$key$delimiter+" "$file"; then
 | 
					 | 
				
			||||||
         echo present
 | 
					         echo present
 | 
				
			||||||
 | 
					      else
 | 
				
			||||||
 | 
					         # key does not exist
 | 
				
			||||||
 | 
					         echo absent
 | 
				
			||||||
      fi
 | 
					      fi
 | 
				
			||||||
   ;;
 | 
					   ;;
 | 
				
			||||||
   present)
 | 
					   present)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue