SOURCES: clamav.init - use functions

glen glen at pld-linux.org
Sun Nov 5 17:31:21 CET 2006


Author: glen                         Date: Sun Nov  5 16:31:21 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- use functions

---- Files affected:
SOURCES:
   clamav.init (1.11 -> 1.12) 

---- Diffs:

================================================================
Index: SOURCES/clamav.init
diff -u SOURCES/clamav.init:1.11 SOURCES/clamav.init:1.12
--- SOURCES/clamav.init:1.11	Sun Sep 17 18:17:31 2006
+++ SOURCES/clamav.init	Sun Nov  5 17:31:16 2006
@@ -17,10 +17,7 @@
 # Get service config
 [ -f /etc/sysconfig/clamd ] && . /etc/sysconfig/clamd
 
-RETVAL=0
-# See how we were called.
-case "$1" in
-  start)
+start() {
 	# Check if the service is already running?
 	if [ ! -f /var/lock/subsys/clamd ]; then
 		msg_starting clamd
@@ -30,8 +27,9 @@
 	else
 		msg_already_running clamd
 	fi
-	;;
-  stop)
+}
+
+stop() {
 	if [ -f /var/lock/subsys/clamd ]; then
 		msg_stopping clamd
 		killproc --pidfile clamav/clamd.pid clamd
@@ -39,11 +37,20 @@
 	else
 		msg_not_running clamd
 	fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+  	start
+	;;
+  stop)
+  	stop
 	;;
   restart)
-	$0 stop
-	$0 start
-	exit $?
+	stop
+	start
 	;;
   status)
 	status clamd
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/clamav.init?r1=1.11&r2=1.12&f=u



More information about the pld-cvs-commit mailing list