#!/bin/sh
#
-# chkconfig: 345 29 69
+# chkconfig: 345 29 71
# description: Eventum IRC Notification Bot
# Source function library
exit 0
fi
-RETVAL=0
-# See how we were called.
-case "$1" in
-start)
- if [ ! -f /var/lock/subsys/eventum-irc ]; then
- msg_starting "Eventum IRC Bot"
- start-stop-daemon --start \
- --exec /usr/sbin/eventum-bot \
- --pidfile $PIDFILE \
- --chuid eventum \
- --background
+start() {
+ if [ -f /var/lock/subsys/eventum-irc ]; then
+ msg_already_running "Eventum IRC Bot"
+ return
+ fi
+
+ msg_starting "Eventum IRC Bot"
+ start-stop-daemon --start \
+ --exec /usr/sbin/eventum-irc-bot \
+ --pidfile $PIDFILE \
+ --chuid http \
+ --background
- RETVAL=$?
- if [ $RETVAL -eq 0 ]; then
- touch /var/lock/subsys/eventum-irc
- ok
- else
- fail
- fi
+ RETVAL=$?
+ if [ $RETVAL -eq 0 ]; then
+ touch /var/lock/subsys/eventum-irc
+ ok
else
- msg_already_running "Eventum IRC Bot"
+ fail
fi
-;;
-stop)
- if [ -f /var/lock/subsys/eventum-irc ]; then
- msg_stopping "Eventum IRC Bot"
- if start-stop-daemon --stop --oknodo --pidfile $PIDFILE; then
- rm -f $PIDFILE /var/lock/subsys/eventum-irc >/dev/null 2>&1
- ok
- else
- fail
- fi
+}
+
+stop() {
+ if [ ! -f /var/lock/subsys/eventum-irc ]; then
+ msg_not_running "Eventum IRC Bot"
+ return
+ fi
+
+ msg_stopping "Eventum IRC Bot"
+ if start-stop-daemon --stop --oknodo --pidfile $PIDFILE; then
+ rm -f $PIDFILE /var/lock/subsys/eventum-irc >/dev/null 2>&1
+ ok
else
+ fail
+ fi
+}
+
+condrestart() {
+ if [ ! -f /var/lock/subsys/eventum-irc ]; then
msg_not_running "Eventum IRC Bot"
+ RETVAL=$1
+ return
fi
-;;
-restart)
- $0 stop
- $0 start
- exit $?
-;;
-status)
- status "Eventum IRC Bot" php
+
+ stop
+ start
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ force-reload)
+ condrestart 7
+ ;;
+ status)
+ status eventum-irc-bot php
exit $?
-;;
-*)
- msg_usage "$0 {start|stop|restart|status}"
+ ;;
+ *)
+ msg_usage "$0 {start|stop|restart|force-reload|status}"
exit 3
esac