Parse elasticsearch.in.sh before setting JAVA dir as we could define JAVA_HOME in elasticsearch.in.sh

This commit is contained in:
David Pilato 2012-05-24 10:28:40 +03:00 committed by Shay Banon
parent 7b2e1b7b4f
commit 2ea77782a1
1 changed files with 6 additions and 6 deletions

View File

@ -68,12 +68,6 @@ ES_HOME=`dirname "$SCRIPT"`/..
ES_HOME=`cd "$ES_HOME"; pwd` ES_HOME=`cd "$ES_HOME"; pwd`
if [ -x "$JAVA_HOME/bin/java" ]; then
JAVA=$JAVA_HOME/bin/java
else
JAVA=`which java`
fi
# If an include wasn't specified in the environment, then search for one... # If an include wasn't specified in the environment, then search for one...
if [ "x$ES_INCLUDE" = "x" ]; then if [ "x$ES_INCLUDE" = "x" ]; then
# Locations (in order) to use when searching for an include file. # Locations (in order) to use when searching for an include file.
@ -92,6 +86,12 @@ elif [ -r "$ES_INCLUDE" ]; then
. "$ES_INCLUDE" . "$ES_INCLUDE"
fi fi
if [ -x "$JAVA_HOME/bin/java" ]; then
JAVA=$JAVA_HOME/bin/java
else
JAVA=`which java`
fi
if [ -z "$ES_CLASSPATH" ]; then if [ -z "$ES_CLASSPATH" ]; then
echo "You must set the ES_CLASSPATH var" >&2 echo "You must set the ES_CLASSPATH var" >&2
exit 1 exit 1