]> git.pld-linux.org Git - packages/nfs-utils.git/commitdiff
- Added $CONFIGUREDNFSMOUNTPOINTS and $ACTIVENFSMOUNTPOINTS
authorjack <jack@pld-linux.org>
Mon, 7 Jan 2002 14:41:05 +0000 (14:41 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- Added checking for configured NFS mountpoints in start)
- Added checking for configured and active NFS mountpoints in stop)
- Simplified status)
- I think reload) is stupid and someone should throw it out because it doesn't work ;)

Changed files:
    nfsfs.init -> 1.6

nfsfs.init

index 6a10999a47285fb0b3f4549207f4b794393331bb..b63056213582221d667e0738979f23b0157dc188 100644 (file)
@@ -28,15 +28,24 @@ if is_no "${NETWORKING}"; then
        exit 1
 fi
 
+CONFIGUREDNFSMOUNTPOINTS="`grep -v '^#' /etc/fstab | \
+    awk '{ if ($3 ~ /^nfs$/ && $4 !~ /noauto/) print $2}'`"
+ACTIVENFSMOUNTPOINTS="`grep -v '^#' /proc/mounts | \
+    awk '{ if ($3 ~ /^nfs$/ && $4 !~ /noauto/) print $2}'`"
+
 # See how we were called.
 case "$1" in
   start)
+       if [ -z "$CONFIGUREDNFSMOUNTPOINTS" ] ; then
+               echo "There are no configured NFS mountpoints!"
+       else
        show "Mounting NFS filesystems"
        busy
        mount -a -t nfs
        deltext
        ok
        touch /var/lock/subsys/nfsfs
+       fi
        ;;
   stop)
        if [ -f /proc/mounts ] ; then
@@ -44,6 +53,12 @@ case "$1" in
        else
                fsfile="/etc/mtab"
        fi
+                       
+       if [ -z "$CONFIGUREDNFSMOUNTPOINTS" ] ; then
+               echo "There are no configured NFS mountpoints!"
+       elif [ -z "$ACTIVENFSMOUNTPOINTS" ] ; then
+               echo "There are no active NFS mountpoints!"
+       else
 
        show "Unmounting NFS filesystems"
        busy
@@ -54,15 +69,14 @@ case "$1" in
        deltext
        ok
        rm -f /var/lock/subsys/nfsfs
+       fi
        ;;
   status)
        if [ -f /proc/mounts ] ; then
                echo "Configured NFS mountpoints:"
-               grep -v '^#' /etc/fstab | \
-                 awk '{ if ($3 ~ /^nfs$/ && $4 !~ /noauto/) print $2}'
+               echo "$CONFIGUREDNFSMOUNTPOINTS"
                echo "Active NFS mountpoints:"
-               grep -v '^#' /proc/mounts | \
-                 awk '{ if ($3 ~ /^nfs$/ && $4 !~ /noauto/) print $2}'
+               echo "$ACTIVENFSMOUNTPOINTS"
        else
                echo "/proc filesystem unavailable"
        fi
This page took 0.122425 seconds and 4 git commands to generate.