Reverting change in bin/plugin due to d3980ee184f11efcbd2b38421f4946de9198fe20 commit

This commit is contained in:
David Pilato 2013-09-11 16:28:25 +02:00
parent bbce6e8588
commit b5c9807ba2
1 changed files with 50 additions and 0 deletions

50
bin/plugin Normal file
View File

@ -0,0 +1,50 @@
#!/bin/sh
CDPATH=""
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
ES_HOME=`cd "$ES_HOME"; pwd`
if [ -x "$JAVA_HOME/bin/java" ]; then
JAVA=$JAVA_HOME/bin/java
else
JAVA=`which java`
fi
# this is a poor mans getopt replacement
# real getopt cannot be used because we need to hand options over to the PluginManager
while [ $# -gt 0 ]; do
case $1 in
-D*=*)
properties="$properties $1"
;;
-D*)
var=$1
shift
properties="$properties $var=$1"
;;
*)
args="$args $1"
esac
shift
done
exec $JAVA $JAVA_OPTS -Xmx64m -Xms16m -Delasticsearch -Des.path.home="$ES_HOME" $properties -cp "$ES_HOME/lib/*" org.elasticsearch.plugins.PluginManager $args