diff --git a/webhcat/svr/src/main/bin/webhcat_config.sh b/webhcat/svr/src/main/bin/webhcat_config.sh index 1834036..fd9de7c 100644 --- a/webhcat/svr/src/main/bin/webhcat_config.sh +++ b/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 a/webhcat/svr/src/main/bin/webhcat_server.sh b/webhcat/svr/src/main/bin/webhcat_server.sh index 21d3285..449678e 100644 --- a/webhcat/svr/src/main/bin/webhcat_server.sh +++ b/webhcat/svr/src/main/bin/webhcat_server.sh @@ -58,11 +58,19 @@ function log() { # Find 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 }