Init script para SOLR 4.10.2

#!/bin/sh
# description: Solr Server
# Solr Server service start, stop, restart

#solr start -d /opt/solr/core

SOLR_DIR="/opt/solr"
SOLR_CORE="/opt/solr/core"
SOLR_PORT="8983"
case $1 in
start)
echo "Starting Solr..."
$SOLR_DIR/bin/solr start -d $SOLR_CORE
sleep 1
lsof -i :8983
;;
stop)
echo "Stopping Solr..."
$SOLR_DIR/bin/solr stop -d $SOLR_CORE -p $SOLR_PORT
;;
restart)
$0 stop
sleep 2
$0 start
;;
*)
echo "Usage: $0 [start|stop|restart]"
exit 1
;;
esac

exit 0