4 # description: Eventum IRC Notification Bot
6 # Source function library
7 . /etc/rc.d/init.d/functions
10 . /etc/sysconfig/network
13 PIDFILE=/var/run/eventum/irc_bot.pid
16 [ -f /etc/sysconfig/eventum-irc ] && . /etc/sysconfig/eventum-irc
18 # Check that networking is up.
19 if is_yes "${NETWORKING}"; then
20 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status -a "$1" != init ]; then
21 msg_network_down eventum-irc
29 # See how we were called.
32 if [ ! -f /var/lock/subsys/eventum-irc ]; then
33 msg_starting eventum-irc
34 start-stop-daemon --start \
38 --chdir /usr/share/eventum/misc/irc \
39 --background -- -q bot.php
42 if [ $RETVAL -eq 0 ]; then
43 touch /var/lock/subsys/eventum-irc
49 msg_already_running eventum-irc
53 if [ -f /var/lock/subsys/eventum-irc ]; then
54 msg_stopping eventum-irc
55 if start-stop-daemon --stop --oknodo --pidfile $PIDFILE; then
56 rm -f $PIDFILE /var/lock/subsys/eventum-irc >/dev/null 2>&1
62 msg_not_running eventum-irc
75 msg_usage "$0 {start|stop|restart|status}"