SOURCES: cyrus-imapd.init - use functions

glen glen at pld-linux.org
Mon Mar 26 18:04:55 CEST 2007


Author: glen                         Date: Mon Mar 26 16:04:55 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- use functions

---- Files affected:
SOURCES:
   cyrus-imapd.init (1.9 -> 1.10) 

---- Diffs:

================================================================
Index: SOURCES/cyrus-imapd.init
diff -u SOURCES/cyrus-imapd.init:1.9 SOURCES/cyrus-imapd.init:1.10
--- SOURCES/cyrus-imapd.init:1.9	Thu Dec  8 02:02:49 2005
+++ SOURCES/cyrus-imapd.init	Mon Mar 26 18:04:49 2007
@@ -22,10 +22,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/cyrus-imapd ]; then
 		msg_starting cyrus-imapd
@@ -40,8 +37,9 @@
 	else
 		msg_already_running cyrus-imapd
 	fi
-	;;
-  stop)
+}
+
+stop() {
 	# Stop daemons.
 	if [ -f /var/lock/subsys/cyrus-imapd ]; then
 		msg_stopping cyrus-imapd
@@ -50,11 +48,20 @@
 	else
 		msg_not_running cyrus-imapd
 	fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+  	start
+	;;
+  stop)
+  	stop
 	;;
   restart|force-reload)
-	$0 stop
-	$0 start
-	RETVAL=$?
+	stop
+	start
 	;;
   status)
 	status cyrus-master
@@ -66,6 +73,3 @@
 esac
 
 exit $RETVAL
-
-# This must be last line !
-# vi:syntax=sh:tw=78:ts=8:sw=4
================================================================

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



More information about the pld-cvs-commit mailing list