Skip to content

Instantly share code, notes, and snippets.

@krusynth
Created June 1, 2015 19:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krusynth/7bc1169dad3e880061f7 to your computer and use it in GitHub Desktop.
Save krusynth/7bc1169dad3e880061f7 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# solr APACHE SOLR 4.10
#
# chkconfig: 2345 85 15
# description: Startup Script for APACHE SOLR 4.10
#
# processname: solr
SOLR_BIN="/opt/solr/bin/solr"
SOLR_PORT="8983"
start() {
$SOLR_BIN start -p $SOLR_PORT
RETVAL=$?
return $RETVAL
}
stop() {
$SOLR_BIN stop -p $SOLR_PORT
RETVAL=$?
return $RETVAL
}
restart() {
$SOLR_BIN restart -p $SOLR_PORT
RETVAL=$?
return $RETVAL
}
status() {
$SOLR_BIN -i
RETVAL=$?
return $RETVAL
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
status)
status
;;
*)
echo "Usage: service solr {start|stop|restart|status}"
esac
exit $RETVAL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment