SOURCES: eventum-irc.init - use functions

glen glen at pld-linux.org
Fri Feb 9 00:38:35 CET 2007


Author: glen                         Date: Thu Feb  8 23:38:35 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- use functions

---- Files affected:
SOURCES:
   eventum-irc.init (1.9 -> 1.10) 

---- Diffs:

================================================================
Index: SOURCES/eventum-irc.init
diff -u SOURCES/eventum-irc.init:1.9 SOURCES/eventum-irc.init:1.10
--- SOURCES/eventum-irc.init:1.9	Fri Feb  9 00:37:41 2007
+++ SOURCES/eventum-irc.init	Fri Feb  9 00:38:30 2007
@@ -24,10 +24,7 @@
 	exit 0
 fi
 
-RETVAL=0
-# See how we were called.
-case "$1" in
-start)
+start() {
 	if [ ! -f /var/lock/subsys/eventum-irc ]; then
 		msg_starting "Eventum IRC Bot"
 		start-stop-daemon --start \
@@ -46,8 +43,9 @@
 	else
 		msg_already_running "Eventum IRC Bot"
 	fi
-;;
-stop)
+}
+
+stop() {
 	if [ -f /var/lock/subsys/eventum-irc ]; then
 		msg_stopping "Eventum IRC Bot"
 		if start-stop-daemon --stop --oknodo --pidfile $PIDFILE; then
@@ -59,11 +57,20 @@
 	else
 		msg_not_running "Eventum IRC Bot"
 	fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+start)
+	start
+;;
+stop)
+	stop
 ;;
 restart)
-	$0 stop
-	$0 start
-	exit $?
+	stop
+	start
 ;;
 status)
 	status eventum-bot php
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/eventum-irc.init?r1=1.9&r2=1.10&f=u



More information about the pld-cvs-commit mailing list