2010-05-03 03:49:50 -04:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
CLASSPATH=$CLASSPATH:$ES_HOME/lib/*
|
|
|
|
|
2011-03-18 21:00:27 -04:00
|
|
|
exec $JAVA -Delasticsearch -Des.path.home="$ES_HOME" -cp $CLASSPATH org.elasticsearch.plugins.PluginManager $*
|