From: Thierry Parmentelat Date: Wed, 8 Apr 2009 15:20:27 +0000 (+0000) Subject: check for existence of the node-config file X-Git-Tag: BootCD-4.2-13~2 X-Git-Url: http://git.onelab.eu/?p=bootcd.git;a=commitdiff_plain;h=fb6ffc1739a8dbb44acd7ee96cd607b2be3e7e6f check for existence of the node-config file also make the command robust to relative paths, as we change dir over time and thus need abs. paths --- diff --git a/build.sh b/build.sh index cfce5e2..0d7dff1 100755 --- a/build.sh +++ b/build.sh @@ -174,6 +174,18 @@ function parse_command_line () { [ -z "$VARIANT" ] && VARIANT="build" [ "$CONSOLE_INFO" == "default" ] && CONSOLE_INFO=$SERIAL_CONSOLE + if [ -n "$NODE_CONFIGURATION_FILE" ] ; then + # check existence of NODE_CONFIGURATION_FILE and normalize as we will change directory + if [ ! -f "$NODE_CONFIGURATION_FILE" ] ; then + echo "Node configuration file $NODE_CONFIGURATION_FILE not found - exiting" + exit 1 + fi + cf_dir="$(dirname $NODE_CONFIGURATION_FILE)" + cf_dir="$(cd $cf_dir; pwd -P)" + cf_file="$(basename $NODE_CONFIGURATION_FILE)" + NODE_CONFIGURATION_FILE="$cf_dir"/"$cf_file" + fi + # check TYPES local matcher="XXX$(echo $ALL_TYPES | sed -e 's,\W,XXX,g')XXX" for t in $TYPES; do