X-Git-Url: http://git.pld-linux.org/?p=packages%2Feventum.git;a=blobdiff_plain;f=eventum-irc.init;h=6a0aff87de5decb56cfa43709063b2c817698f59;hp=18b41083f869f4fbdd2a6bfa43e39dbcb2380bc7;hb=HEAD;hpb=9d20707017eb93c3b194af4b311a296be12f367e diff --git a/eventum-irc.init b/eventum-irc.init deleted file mode 100755 index 18b4108..0000000 --- a/eventum-irc.init +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/sh -# -# chkconfig: 345 29 71 -# description: Eventum IRC Notification Bot - -# Source function library -. /etc/rc.d/init.d/functions - -# Get network config -. /etc/sysconfig/network - -PIDFILE=/var/run/eventum/irc_bot.pid - -# Get service config -[ -f /etc/sysconfig/eventum-irc ] && . /etc/sysconfig/eventum-irc - -# Check that networking is up. -if is_yes "${NETWORKING}"; then - if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status -a "$1" != init ]; then - msg_network_down "Eventum IRC Bot" - exit 1 - fi -else - exit 0 -fi - -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/share/eventum/bin/irc-bot.php \ - --pidfile $PIDFILE \ - --chuid http \ - --background - - RETVAL=$? - if [ $RETVAL -eq 0 ]; then - touch /var/lock/subsys/eventum-irc - 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 - - 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 --pidfile $PIDFILE eventum-irc php - exit $? - ;; - *) - msg_usage "$0 {start|stop|restart|force-reload|status}" - exit 3 -esac - -exit $RETVAL