SOURCES: sendmail.init - use functions

glen glen at pld-linux.org
Wed Dec 27 19:23:33 CET 2006


Author: glen                         Date: Wed Dec 27 18:23:33 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- use functions

---- Files affected:
SOURCES:
   sendmail.init (1.20 -> 1.21) 

---- Diffs:

================================================================
Index: SOURCES/sendmail.init
diff -u SOURCES/sendmail.init:1.20 SOURCES/sendmail.init:1.21
--- SOURCES/sendmail.init:1.20	Thu Dec  8 02:02:49 2005
+++ SOURCES/sendmail.init	Wed Dec 27 19:23:28 2006
@@ -36,10 +36,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/sendmail ]; then
 		show "Prepare sendmail db"
@@ -70,8 +67,9 @@
 	else
 		msg_already_running sm-client
 	fi
-	;;
-  stop)
+}
+
+stop() {
 	if [ -f /var/lock/subsys/sendmail ]; then
 		# Stop daemons.
 		msg_stopping sendmail
@@ -89,11 +87,20 @@
 	else
 		msg_not_running sm-client
 	fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+  	start
+	;;
+  stop)
+  	stop
 	;;
   restart)
-	$0 stop
-	$0 start
-	exit $?
+	stop
+	start
 	;;
   reload|force-reload)
   	# TODO: make it better for sm-client
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/sendmail.init?r1=1.20&r2=1.21&f=u



More information about the pld-cvs-commit mailing list