SOURCES: amavis-stats.init - use functions

glen glen at pld-linux.org
Tue May 13 00:32:21 CEST 2008


Author: glen                         Date: Mon May 12 22:32:21 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- use functions

---- Files affected:
SOURCES:
   amavis-stats.init (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: SOURCES/amavis-stats.init
diff -u SOURCES/amavis-stats.init:1.1 SOURCES/amavis-stats.init:1.2
--- SOURCES/amavis-stats.init:1.1	Mon May 12 23:42:57 2008
+++ SOURCES/amavis-stats.init	Tue May 13 00:32:16 2008
@@ -24,10 +24,7 @@
 	exit 0
 fi
 
-RETVAL=0
-# See how we were called.
-case "$1" in
-  start)
+start() {
 	# Start daemons.
 	if [ ! -f /var/lock/subsys/amavis-stats ]; then
 		msg_starting Amavis-Stats
@@ -37,8 +34,9 @@
 	else
 		msg_already_running Amavis-Stats
 	fi
-	;;
-  stop)
+}
+
+stop() {
 	# Stop daemons.
 	if [ -f /var/lock/subsys/amavis-stats ]; then
 		msg_stopping Amavis-Stats
@@ -47,11 +45,20 @@
 	else
 		msg_not_running amavis-stats
 	fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+  	start
+	;;
+  stop)
+  	stop
 	;;
   restart|reload|force-restart|force-reload)
-	$0 stop
-	$0 start
-	exit $?
+	stop
+	start
 	;;
   status)
 	status Amavis-Stats Amavis-Stats
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/amavis-stats.init?r1=1.1&r2=1.2&f=u



More information about the pld-cvs-commit mailing list