SOURCES: fam.init - use functions

glen glen at pld-linux.org
Tue Sep 26 21:10:36 CEST 2006


Author: glen                         Date: Tue Sep 26 19:10:36 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- use functions

---- Files affected:
SOURCES:
   fam.init (1.4 -> 1.5) 

---- Diffs:

================================================================
Index: SOURCES/fam.init
diff -u SOURCES/fam.init:1.4 SOURCES/fam.init:1.5
--- SOURCES/fam.init:1.4	Thu Dec  8 01:41:26 2005
+++ SOURCES/fam.init	Tue Sep 26 21:10:31 2006
@@ -30,10 +30,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/famd ]; then
 		msg_starting "File Alteration Monitor"
@@ -43,8 +40,9 @@
 	else
 		msg_already_running "File Alteration Monitor"
 	fi
-	;;
-  stop)
+}
+
+stop() {
 	# Stop daemons.
 	if [ -f /var/lock/subsys/famd ]; then
 		msg_stopping "File Alteration Monitor"
@@ -53,15 +51,24 @@
 	else
 		msg_not_running "File Alteration Monitor"
 	fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+  	start
+	;;
+  stop)
+  	stop
 	;;
   status)
 	status famd
 	exit $?
 	;;
   restart|force-reload)
-	$0 stop
-	$0 start
-	exit $?
+	stop
+	start
 	;;
   *)
 	msg_usage "$0 {start|stop|restart|force-reload|status}"
================================================================

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



More information about the pld-cvs-commit mailing list