forked from ungleich-public/cdist
		
	check for existence before (re-)creation
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
		
					parent
					
						
							
								e48458f27f
							
						
					
				
			
			
				commit
				
					
						03502567e3
					
				
			
		
					 1 changed files with 15 additions and 12 deletions
				
			
		| 
						 | 
					@ -70,6 +70,8 @@ if [ -f "$__object/parameter/source" ]; then
 | 
				
			||||||
   fi
 | 
					   fi
 | 
				
			||||||
# No source? Create empty file/dir
 | 
					# No source? Create empty file/dir
 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
 | 
					   # Only touch / create if it does not exist
 | 
				
			||||||
 | 
					   if [ no = "$(cat "$__object/explorer/exists")" ]; then
 | 
				
			||||||
      case "$type" in
 | 
					      case "$type" in
 | 
				
			||||||
         directory)
 | 
					         directory)
 | 
				
			||||||
            echo mkdir \"$destination\"
 | 
					            echo mkdir \"$destination\"
 | 
				
			||||||
| 
						 | 
					@ -84,6 +86,7 @@ else
 | 
				
			||||||
            exit 1
 | 
					            exit 1
 | 
				
			||||||
         ;;
 | 
					         ;;
 | 
				
			||||||
      esac
 | 
					      esac
 | 
				
			||||||
 | 
					   fi
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if [ -f "$__object/parameter/mode" ]; then
 | 
					if [ -f "$__object/parameter/mode" ]; then
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue