Created
October 2, 2017 19:01
-
-
Save turbo-ele/3a7f0e263bd807789b95a4105a19336a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 crate home | |
CRATE_HOME=`dirname "$SCRIPT"`/.. | |
# make CRATE_HOME absolute | |
CRATE_HOME=`cd "$CRATE_HOME"; pwd` | |
# If an include wasn't specified in the environment, then search for one... | |
if [ "x$CRATE_INCLUDE" = "x" ]; then | |
# Locations (in order) to use when searching for an include file. | |
for include in /usr/share/crate/crate.in.sh \ | |
/usr/local/share/crate/crate.in.sh \ | |
/opt/crate/crate.in.sh \ | |
~/.crate.in.sh \ | |
`dirname "$0"`/crate.in.sh; do | |
if [ -r "$include" ]; then | |
. "$include" | |
break | |
fi | |
done | |
# ...otherwise, source the specified include. | |
elif [ -r "$CRATE_INCLUDE" ]; then | |
. "$CRATE_INCLUDE" | |
fi | |
if [ -x "$JAVA_HOME/bin/java" ]; then | |
JAVA="$JAVA_HOME/bin/java" | |
else | |
JAVA=java | |
fi | |
if [ -z "$CRATE_CLASSPATH" ]; then | |
echo "CRATE_CLASSPATH should've been initialized via crate.in.sh" >&2 | |
exit 1 | |
fi | |
# Special-case path variables. | |
case `uname` in | |
CYGWIN*) | |
CRATE_CLASSPATH=`cygpath -p -w "$CRATE_CLASSPATH"` | |
CRATE_HOME=`cygpath -p -w "$CRATE_HOME"` | |
;; | |
esac | |
props="-Cpath.home=/Users/elias/Development/crate/app/build/install/crate -Ccluster.name=\"Cluster Name\" -Cnode.name=\"Node name\"" | |
exec "$JAVA" $JAVA_OPTS $CRATE_JAVA_OPTS $javaProperties -cp "$CRATE_CLASSPATH" \ | |
io.crate.bootstrap.CrateDB $props | |
exit $? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment