-
-
Save hexfusion/8169741 to your computer and use it in GitHub Desktop.
This file contains 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/bash | |
# | |
# Very basic init script for usage with eShop. | |
# | |
# Copyright 2013 Stefan Hornburg (Racke) <[email protected]>. | |
SOLR_HOME="$HOME/solr/example" | |
SOLR_LOGFILE=$(readlink -f ../../logs/solr.log) | |
SOLR_PIDFILE=$(readlink -f ../../run/solr.pid) | |
COMMAND="java $SOLR_OPTIONS -jar start.jar" | |
cd $SOLR_HOME | |
start() { | |
nohup $COMMAND > $SOLR_LOGFILE 2>&1 & | |
echo $! > $SOLR_PIDFILE | |
return $? | |
} | |
stop() { | |
/sbin/start-stop-daemon --stop --oknodo --pidfile $SOLR_PIDFILE | |
} | |
# See how we were called. | |
case "$1" in | |
start) | |
start | |
;; | |
stop) | |
stop | |
;; | |
restart) | |
$0 stop | |
$0 start | |
;; | |
*) | |
echo "Usage: $0 {start|stop|restart}" | |
exit 1 | |
esac | |
exit $? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment