]> git.pld-linux.org Git - packages/nfs-utils.git/commitdiff
- use functions
authorElan Ruusamäe <glen@pld-linux.org>
Mon, 2 Oct 2006 19:56:45 +0000 (19:56 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    nfs.init -> 1.32

nfs.init

index 1bd626414337bed1d0ea0f8834f1fbce7aeee593..bd30a39a95cde8e442e02cac9ec39476c09616bc 100644 (file)
--- a/nfs.init
+++ b/nfs.init
@@ -41,10 +41,7 @@ if ! is_yes "$NFS4" ; then
        RPCMOUNTOPTIONS="$RPCMOUNTOPTIONS --no-nfs-version 4"
 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/nfs ]; then
                # Start daemons.
@@ -77,8 +74,9 @@ case "$1" in
        else
                msg_already_running "NFS"
        fi
-       ;;
-  stop)
+}
+
+stop() {
        if [ -f /var/lock/subsys/nfs ]; then
                # Stop daemons.
                msg_stopping "NFS mountd"
@@ -102,6 +100,16 @@ case "$1" in
        else
                msg_not_running "NFS"
        fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
        ;;
   status)
        status rpc.mountd
@@ -111,8 +119,8 @@ case "$1" in
        [ $RETVAL -eq 0 ] && RETVAL=$RET
        ;;
   restart)
-       $0 stop
-       $0 start
+       stop
+       start
        exit $?
        ;;
   force-reload)
This page took 0.136614 seconds and 4 git commands to generate.