SOURCES: courier-authlib.init - use functions

glen glen at pld-linux.org
Tue Nov 6 21:14:46 CET 2007


Author: glen                         Date: Tue Nov  6 20:14:46 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- use functions

---- Files affected:
SOURCES:
   courier-authlib.init (1.4 -> 1.5) 

---- Diffs:

================================================================
Index: SOURCES/courier-authlib.init
diff -u SOURCES/courier-authlib.init:1.4 SOURCES/courier-authlib.init:1.5
--- SOURCES/courier-authlib.init:1.4	Thu Dec  8 02:02:49 2005
+++ SOURCES/courier-authlib.init	Tue Nov  6 21:14:41 2007
@@ -25,10 +25,7 @@
 	exit 0
 fi
 
-RETVAL=0
-# See how we were called.
-case "$1" in
-  start)
+start() {
 	# Check if the service is already running?
 	if [ ! -f /var/lock/subsys/courier-authlib ]; then
 		msg_starting courier-authlib
@@ -38,8 +35,9 @@
 	else
 		msg_already_running courier-authlib
 	fi
-	;;
-  stop)
+}
+
+stop() {
 	# Stop daemons.
 	if [ -f /var/lock/subsys/courier-authlib ]; then
 		msg_stopping courier-authlib
@@ -48,14 +46,24 @@
 	else
 		msg_not_running courier-authlib
 	fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+  	start
+	;;
+  stop)
+  	stop
 	;;
   status)
 	status authdaemond
 	RETVAL=$?
 	;;
   restart)
-  	$0 stop
-	$0 start
+  	stop
+	start
 	;;
   reload|force-reload|graceful)
 	if [ -f /var/lock/subsys/courier-authlib ]; then
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/courier-authlib.init?r1=1.4&r2=1.5&f=u



More information about the pld-cvs-commit mailing list