From 2f415ad24006f687a2484d05969782fb04e25186 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 1 Dec 2010 20:01:39 +0100 Subject: [PATCH] add breaking if var not defined, execute config base Signed-off-by: Nico Schottelius --- test/cdist-cconfig-tree | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/test/cdist-cconfig-tree b/test/cdist-cconfig-tree index 95218e0d..10fe3903 100755 --- a/test/cdist-cconfig-tree +++ b/test/cdist-cconfig-tree @@ -25,7 +25,7 @@ . cdist-config -set -ax +set -aux # all types cdist is aware of export cdist_types="file service user" @@ -37,7 +37,9 @@ cdist_tree_wrapper="./cdist_tree_wrapper" # used to build the tree and other stuff tmpdir=/tmp/cdist-test-hardcoded -export cdist_bindir="${tmpdir}/bin" +cdist_bindir="${tmpdir}/bin" + +cdist_type_prefix="__" ################################################################################ # Begin execution @@ -56,13 +58,20 @@ mkdir -p "${cdist_bindir}" set -e cd "${cdist_bindir}" for bin in $cdist_types; do - ln -s "${cdist_tree_wrapper_abs}" "${bin}" + ln -s "${cdist_tree_wrapper_abs}" "${cdist_type_prefix}${bin}" done ) - - # 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