]> git.pld-linux.org Git - packages/nfs-utils.git/commitdiff
- use functions
authorElan Ruusamäe <glen@pld-linux.org>
Thu, 19 Oct 2006 10:32:50 +0000 (10:32 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    nfsfs.init -> 1.27
    nfslock.init -> 1.12

nfsfs.init
nfslock.init

index 38e567a13d1274760981522da0afa7cb4877bf0d..933ca32994a69a6433a6c02879da6713c700b8e8 100644 (file)
@@ -36,9 +36,7 @@ else
        exit 0
 fi
 
-# See how we were called.
-case "$1" in
-  start)
+start() {
        if [ ! -f /var/lock/subsys/nfsfs ]; then
                if is_yes "$NFS4" ; then
                    if grep -q nfs4 /proc/filesystems; then
@@ -61,8 +59,9 @@ case "$1" in
        else
            msg_already_running "NFSFS"
        fi
-       ;;
-  stop)
+}
+
+stop() {
        if [ -f /proc/mounts ]; then
                fsfile="/proc/mounts"
        else
@@ -94,6 +93,15 @@ case "$1" in
                fi
        fi
        rm -f /var/lock/subsys/nfsfs
+}
+
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
        ;;
   status)
        if [ -f /proc/mounts ]; then
@@ -108,8 +116,8 @@ case "$1" in
        fi
        ;;
   restart)
-       $0 stop
-       $0 start
+       stop
+       start
        ;;
   reload|force-reload)
        mount -a -t nfs
index df555d7f9b491b68c559fdd8f9de3822313a095f..4ab609fcc8c61562f331694e942126b1d42f2ea7 100644 (file)
@@ -35,10 +35,7 @@ fi
 # Sanity checks
 [ -x /usr/sbin/rpc.statd ] || exit 0
 
-RETVAL=0
-# See how we were called.
-case "$1" in
-  start)
+start() {
        # Check if the service is already running?
        if [ ! -f /var/lock/subsys/nfslock ]; then
                # Start daemons.
@@ -49,8 +46,9 @@ case "$1" in
        else
                msg_already_running "NFS statd"
        fi
-       ;;
-  stop)
+}
+
+stop() {
        if [ -f /var/lock/subsys/nfslock ]; then
                # Stop daemons.
                msg_stopping "NFS statd"
@@ -59,15 +57,24 @@ case "$1" in
        else
                msg_not_running "NFS statd"
        fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
        ;;
   status)
        status rpc.statd
        exit $?
        ;;
   restart|force-reload)
-       $0 stop
-       $0 start
-       exit $?
+       stop
+       start
        ;;
   probe)
        if [ ! -f /var/lock/subsys/nfslock ]; then
This page took 0.062385 seconds and 4 git commands to generate.