]> git.pld-linux.org Git - packages/netatalk.git/commitdiff
- use functions
authorElan Ruusamäe <glen@pld-linux.org>
Fri, 9 Mar 2007 09:55:24 +0000 (09:55 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    netatalk.init -> 1.10

netatalk.init

index ba2d414c717851f914ff1e5f38cd51d3f921abca..4fd4578f4ebb6d4e73870666addcbb4852b154e6 100644 (file)
@@ -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_ATALKD=0
 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 @@ case "$1" in
                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 @@ case "$1" in
                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
This page took 0.349253 seconds and 4 git commands to generate.