]> git.pld-linux.org Git - packages/eventum.git/commitdiff
- unify with template.init
authorElan Ruusamäe <glen@pld-linux.org>
Wed, 14 Apr 2010 14:16:19 +0000 (14:16 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    eventum-irc.init -> 1.14

eventum-irc.init

index 5894ab85d08145484016bb18c5e078bea120b5b7..d7e57025b4f28845835fe57be0ad2da9eec3e530 100644 (file)
@@ -25,58 +25,60 @@ else
 fi
 
 start() {
-       if [ ! -f /var/lock/subsys/eventum-irc ]; then
-               msg_starting "Eventum IRC Bot"
-               start-stop-daemon --start \
-                       --exec /usr/sbin/eventum-irc-bot \
-                       --pidfile $PIDFILE \
-                       --chuid http \
-                       --background
+       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
-       else
+       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
 }
 
 RETVAL=0
 # See how we were called.
 case "$1" in
-start)
+  start)
        start
-;;
-stop)
+       ;;
+  stop)
        stop
-;;
-restart)
+       ;;
+  restart)
        stop
        start
-;;
-status)
+       ;;
+  status)
        status eventum-irc-bot php
        exit $?
-;;
-*)
+       ;;
+  *)
        msg_usage "$0 {start|stop|restart|status}"
        exit 3
 esac
This page took 0.086679 seconds and 4 git commands to generate.