packages: eventum/eventum-irc.init - unify with template.init

glen glen at pld-linux.org
Wed Apr 14 16:16:24 CEST 2010


Author: glen                         Date: Wed Apr 14 14:16:24 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- unify with template.init

---- Files affected:
packages/eventum:
   eventum-irc.init (1.13 -> 1.14) 

---- Diffs:

================================================================
Index: packages/eventum/eventum-irc.init
diff -u packages/eventum/eventum-irc.init:1.13 packages/eventum/eventum-irc.init:1.14
--- packages/eventum/eventum-irc.init:1.13	Wed Apr 14 16:14:45 2010
+++ packages/eventum/eventum-irc.init	Wed Apr 14 16:16:19 2010
@@ -25,58 +25,60 @@
 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
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/eventum/eventum-irc.init?r1=1.13&r2=1.14&f=u



More information about the pld-cvs-commit mailing list