diff --git webhcat/svr/src/main/bin/webhcat_config.sh webhcat/svr/src/main/bin/webhcat_config.sh index 1834036..fd9de7c 100644 --- webhcat/svr/src/main/bin/webhcat_config.sh +++ webhcat/svr/src/main/bin/webhcat_config.sh @@ -38,7 +38,7 @@ ERROR_LOG=${WEBHCAT_LOG_DIR}/webhcat-console-error.log CONSOLE_LOG=${WEBHCAT_LOG_DIR}/webhcat-console.log # The name of the webhcat jar file -WEBHCAT_JAR=webhcat-0.5.0-SNAPSHOT.jar +WEBHCAT_JAR='webhcat-*.jar' # How long to wait before testing that the process started correctly SLEEP_TIME_AFTER_START=10 diff --git webhcat/svr/src/main/bin/webhcat_server.sh webhcat/svr/src/main/bin/webhcat_server.sh index 21d3285..0715b29 100644 --- webhcat/svr/src/main/bin/webhcat_server.sh +++ webhcat/svr/src/main/bin/webhcat_server.sh @@ -56,13 +56,21 @@ function log() { echo "webhcat: $@" } -# Find the webhcat jar +# return(print) the webhcat jar function find_jar_path() { - for dir in "." "build" "share/webhcat/svr/"; do - local jar="$base_dir/$dir/$WEBHCAT_JAR" + for dir in "." "build" "share/webhcat/svr/"; do + if (( `ls -1 $base_dir/$dir/$WEBHCAT_JAR 2>/dev/null| wc -l ` > 1 )) ; then + echo "Error: found more than one hcatalog jar in $base_dir/$dir/$WEBHCAT_JAR" + exit 1 + fi + if (( `ls -1 $base_dir/$dir/$WEBHCAT_JAR 2>/dev/null | wc -l` == 0 )) ; then + continue + fi + + local jar=`ls $base_dir/$dir/$WEBHCAT_JAR` if [[ -f $jar ]]; then - echo $jar - break + echo $jar + break fi done }