SOURCES: netatalk.init - use functions

glen glen at pld-linux.org
Fri Mar 9 10:55:30 CET 2007


Author: glen                         Date: Fri Mar  9 09:55:30 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- use functions

---- Files affected:
SOURCES:
   netatalk.init (1.9 -> 1.10) 

---- Diffs:

================================================================
Index: SOURCES/netatalk.init
diff -u SOURCES/netatalk.init:1.9 SOURCES/netatalk.init:1.10
--- SOURCES/netatalk.init:1.9	Thu Dec  8 02:02:49 2005
+++ SOURCES/netatalk.init	Fri Mar  9 10:55:24 2007
@@ -3,7 +3,7 @@
 # description:	This package enables Linux to talk to Macintosh \
 #		computers via the AppleTalk networking protocol and \
 #		provides printer, file sharing, and AppleTalk routing \
-#		services.
+#		services. 
 #
 # AppleTalk daemons. Make sure not to start atalkd in the background:
 # its data structures must have time to stablize before running the
@@ -27,6 +27,7 @@
 # Check that networking is up.
 if is_yes "${NETWORKING}"; then
 	if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
+		# nls "ERROR: Networking is down. %s can't be run." <service>
 		msg_network_down "AppleTalk"
 		exit 1
 	fi
@@ -40,15 +41,13 @@
 RETVAL_PAPD=0
 RETVAL_AFPD=0
 
-# startup code for everything
-case "$1" in
-  start)
+start() {
 	if [ -f /var/lock/subsys/atalk ]; then
 		msg_already_running "AppleTalk"
 		exit 0
 	fi
 
-	if is_yes "${ATALKD_RUN}"; then
+	if is_yes "${ATALKD_RUN}"; then 
 		msg_starting "atalkd"
 		daemon atalkd
 		RETVAL_ATALKD=$?
@@ -76,9 +75,9 @@
 		RETVAL=0
 		touch /var/lock/subsys/atalk || RETVAL=1
 	fi
-	;;
+}
 
-  stop)
+stop() {
 	if [ ! -f /var/lock/subsys/atalk ]; then
 		msg_not_running "AppleTalk"
 		exit 0
@@ -106,25 +105,33 @@
 		msg_stopping "afpd"
 		killproc afpd
 	fi
-
-	RETVAL=0
 	rm -f /var/lock/subsys/atalk >/dev/null 2>&1
+}
+
+RETVAL=0
+# startup code for everything
+case "$1" in
+  start)
+  	start
+	;;
+
+  stop)
+  	stop
 	;;
   restart|force-reload)
-	$0 stop
-	$0 start
-	exit $?
+	stop
+	start
 	;;
   status)
-	if is_yes "${ATALKD_RUN}"; then
+	if is_yes "${ATALKD_RUN}"; then 
 	    if is_yes "${PAPD_RUN}"; then
 		status papd
 	    fi
-
+	    
 	    if is_yes "${TIMELORD_RUN}"; then
 		status timelord
 	    fi
-
+	    
 	    if  is_yes "${AFPD_RUN}"; then
 		status afpd
 	    fi
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/netatalk.init?r1=1.9&r2=1.10&f=u



More information about the pld-cvs-commit mailing list