forked from ungleich-public/cdist
		
	add breaking if var not defined, execute config base
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
		
					parent
					
						
							
								60a6051cf8
							
						
					
				
			
			
				commit
				
					
						2f415ad240
					
				
			
		
					 1 changed files with 15 additions and 6 deletions
				
			
		| 
						 | 
					@ -25,7 +25,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
. cdist-config
 | 
					. cdist-config
 | 
				
			||||||
 | 
					
 | 
				
			||||||
set -ax
 | 
					set -aux
 | 
				
			||||||
# all types cdist is aware of
 | 
					# all types cdist is aware of
 | 
				
			||||||
export cdist_types="file service user"
 | 
					export cdist_types="file service user"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -37,7 +37,9 @@ cdist_tree_wrapper="./cdist_tree_wrapper"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# used to build the tree and other stuff
 | 
					# used to build the tree and other stuff
 | 
				
			||||||
tmpdir=/tmp/cdist-test-hardcoded
 | 
					tmpdir=/tmp/cdist-test-hardcoded
 | 
				
			||||||
export cdist_bindir="${tmpdir}/bin"
 | 
					cdist_bindir="${tmpdir}/bin"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					cdist_type_prefix="__"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
################################################################################
 | 
					################################################################################
 | 
				
			||||||
# Begin execution
 | 
					# Begin execution
 | 
				
			||||||
| 
						 | 
					@ -56,13 +58,20 @@ mkdir -p "${cdist_bindir}"
 | 
				
			||||||
   set -e
 | 
					   set -e
 | 
				
			||||||
   cd "${cdist_bindir}"
 | 
					   cd "${cdist_bindir}"
 | 
				
			||||||
   for bin in $cdist_types; do
 | 
					   for bin in $cdist_types; do
 | 
				
			||||||
      ln -s "${cdist_tree_wrapper_abs}" "${bin}"
 | 
					      ln -s "${cdist_tree_wrapper_abs}" "${cdist_type_prefix}${bin}"
 | 
				
			||||||
   done
 | 
					   done
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Cdist_tree_wrapper does not need any other tool, so remove them from the path.
 | 
					# Cdist_tree_wrapper does not need any other tool, so remove them from the path.
 | 
				
			||||||
unset PATH
 | 
					#unset PATH
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# prepend our path
 | 
				
			||||||
 | 
					PATH="${cdist_bindir}:$PATH"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# force -x, so the user is aware the file is executed
 | 
				
			||||||
 | 
					if [ -x "${config_base}" ]; then
 | 
				
			||||||
 | 
					   "${config_base}"
 | 
				
			||||||
 | 
					else
 | 
				
			||||||
 | 
					   echo Throw some error, as you forgot to +x it.
 | 
				
			||||||
 | 
					   exit 1
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue