2010-05-03 03:49:50 -04:00
|
|
|
#!/bin/sh
|
|
|
|
|
2011-07-05 21:07:27 -04:00
|
|
|
CDPATH=""
|
2010-05-03 03:49:50 -04:00
|
|
|
SCRIPT="$0"
|
|
|
|
|
|
|
|
# SCRIPT may be an arbitrarily deep series of symlinks. Loop until we have the concrete path.
|
|
|
|
while [ -h "$SCRIPT" ] ; do
|
|
|
|
ls=`ls -ld "$SCRIPT"`
|
|
|
|
# Drop everything prior to ->
|
|
|
|
link=`expr "$ls" : '.*-> \(.*\)$'`
|
|
|
|
if expr "$link" : '/.*' > /dev/null; then
|
|
|
|
SCRIPT="$link"
|
|
|
|
else
|
|
|
|
SCRIPT=`dirname "$SCRIPT"`/"$link"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# determine elasticsearch home
|
|
|
|
ES_HOME=`dirname "$SCRIPT"`/..
|
|
|
|
|
|
|
|
# make ELASTICSEARCH_HOME absolute
|
2011-03-18 21:00:27 -04:00
|
|
|
ES_HOME=`cd "$ES_HOME"; pwd`
|
2010-05-03 03:49:50 -04:00
|
|
|
|
|
|
|
|
2011-03-18 21:00:27 -04:00
|
|
|
if [ -x "$JAVA_HOME/bin/java" ]; then
|
2010-05-03 03:49:50 -04:00
|
|
|
JAVA=$JAVA_HOME/bin/java
|
|
|
|
else
|
|
|
|
JAVA=`which java`
|
|
|
|
fi
|
|
|
|
|
2011-11-13 12:16:01 -05:00
|
|
|
exec $JAVA -Delasticsearch -Des.path.home="$ES_HOME" -cp $ES_HOME/lib/* org.elasticsearch.plugins.PluginManager $*
|