SOURCES: dovecot.init - use functions

glen glen at pld-linux.org
Wed Mar 28 12:14:37 CEST 2007


Author: glen                         Date: Wed Mar 28 10:14:37 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- use functions

---- Files affected:
SOURCES:
   dovecot.init (1.3 -> 1.4) 

---- Diffs:

================================================================
Index: SOURCES/dovecot.init
diff -u SOURCES/dovecot.init:1.3 SOURCES/dovecot.init:1.4
--- SOURCES/dovecot.init:1.3	Wed Mar 28 12:13:34 2007
+++ SOURCES/dovecot.init	Wed Mar 28 12:14:32 2007
@@ -23,10 +23,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/dovecot ]; then
 		msg_starting "Dovecot"
@@ -36,20 +33,30 @@
 	else
 		msg_already_running "Dovecot"
 	fi
-	;;
-  stop)
-  	if [ -f /var/lock/subsys/dovecot ]; then
+}
+
+stop() {
+	if [ -f /var/lock/subsys/dovecot ]; then
 		msg_stopping "Dovecot"
 		killproc dovecot
 		rm -f /var/lock/subsys/dovecot
 	else
 		msg_not_running "Dovecot"
 	fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+  	start
+	;;
+  stop)
+  	stop
 	;;
   restart|force-reload)
-	$0 stop
-	$0 start
-	exit $?
+	stop
+	start
 	;;
   reload)
   	msg_reloading "Dovecot"
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/dovecot.init?r1=1.3&r2=1.4&f=u



More information about the pld-cvs-commit mailing list