Commit 33713451 authored by Matt Tucker's avatar Matt Tucker Committed by matt

Improved script (JM-833).

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@5409 b35dd754-fafc-0310-a699-88a17e54d16e
parent 5556893d
#!/bin/sh #!/bin/sh
# wildfired # wildfired Stops and starts the wildfire XMPP service
# #
# chkconfig: 2345 20 80 # chkconfig: 2345 99 1
# description: Used to start and stop the wildfire XMPP server # description: Used to start and stop the wildfire XMPP server
# #
# Script used to start wildfire as daemon # Script used to start wildfire as daemon
...@@ -52,6 +52,7 @@ function execCommand() { ...@@ -52,6 +52,7 @@ function execCommand() {
cd $WILDFIRE_HOME/bin cd $WILDFIRE_HOME/bin
CMD="./wildfire $1" CMD="./wildfire $1"
su -c "$CMD" $WILDFIRE_USER & su -c "$CMD" $WILDFIRE_USER &
sleep 1 # allows prompt to return
cd $OLD_PWD cd $OLD_PWD
} }
...@@ -72,8 +73,23 @@ case "$1" in ...@@ -72,8 +73,23 @@ case "$1" in
stop) stop)
stop stop
;; ;;
restart)
stop
sleep 10 # since stop is backgrounded
start
;;
status)
retval=$(pgrep -u $WILDFIRE_USER -f $WILDFIRE_HOME/bin/wildfire > /dev/null ; echo $?)
if [ "$retval" = "0" ] ; then
echo "wildfire is running"
exit 0
else
echo "wildfire is not running"
exit 0
fi
;;
*) *)
echo "Usage $0 {start|stop}" echo "Usage $0 {start|stop|restart|status}"
exit 1 exit 1
esac esac
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment