SOURCES: autofs.init - use functions

glen glen at pld-linux.org
Tue Sep 26 20:52:17 CEST 2006


Author: glen                         Date: Tue Sep 26 18:52:17 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- use functions

---- Files affected:
SOURCES:
   autofs.init (1.29 -> 1.30) 

---- Diffs:

================================================================
Index: SOURCES/autofs.init
diff -u SOURCES/autofs.init:1.29 SOURCES/autofs.init:1.30
--- SOURCES/autofs.init:1.29	Mon Jun 26 23:32:08 2006
+++ SOURCES/autofs.init	Tue Sep 26 20:52:12 2006
@@ -102,10 +102,7 @@
 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/autofs ]; then
 		msg_starting automounter
@@ -117,8 +114,9 @@
 	else
 		msg_already_running automounter
 	fi
-	;;
-  stop)
+}
+
+stop() {
 	if [ -f /var/lock/subsys/autofs ]; then
 		msg_stopping automounter
 		killproc automount
@@ -126,11 +124,20 @@
 	else
 		msg_not_running automounter
 	fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+  	start
+	;;
+  stop)
+  	stop
 	;;
   restart|force-reload)
-	$0 stop
-	$0 start
-	exit $?
+	stop
+	start
 	;;
   status)
 	nls "Configured Mount Points:"
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/autofs.init?r1=1.29&r2=1.30&f=u



More information about the pld-cvs-commit mailing list