Skip to content

Instantly share code, notes, and snippets.

@Calpicow
Created August 13, 2015 22:41
Show Gist options
  • Select an option

  • Save Calpicow/eda8837fd90c5252cff8 to your computer and use it in GitHub Desktop.

Select an option

Save Calpicow/eda8837fd90c5252cff8 to your computer and use it in GitHub Desktop.
#!/bin/sh
USAGE="Usage: $0 -p <pidfile>"
NEO4J_HOME="`dirname $0`/.."
die() {
echo $1
exit 1
}
while getopts “hp:” OPTION; do
case $OPTION in
h)
echo $USAGE
exit 1
;;
p)
PID_FILE=$OPTARG
;;
esac
done
[ -n "$PID_FILE" ] || die "$USAGE"
mkdir -p $NEO4J_HOME/data/graph.db
cd $NEO4J_HOME
CLASSPATH=`find $NEO4J_HOME -name '*.jar' | xargs echo | tr ' ' ':'`
java -cp "${CLASSPATH}" \
-Dneo4j.home="${NEO4J_HOME}" \
-Dfile.encoding=UTF-8 \
-Dorg.neo4j.server.properties=conf/neo4j-server.properties \
org.neo4j.server.CommunityBootstrapper > /var/log/neo4j/console.log 2>&1 &
echo $! > $PID_FILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment