aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d/init.d/network
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2000-03-27 18:02:59 +0000
committerBill Nottingham <notting@redhat.com>2000-03-27 18:02:59 +0000
commit167c4a01e39bea20e25b48a8620870313cd02ba8 (patch)
treec1443d98a0159c02818da5e72eb234d0178617ff /rc.d/init.d/network
parentc319567f426c9fb656c231e5a8a1b2a4dda248e2 (diff)
downloadinitscripts-167c4a01e39bea20e25b48a8620870313cd02ba8.tar
initscripts-167c4a01e39bea20e25b48a8620870313cd02ba8.tar.gz
initscripts-167c4a01e39bea20e25b48a8620870313cd02ba8.tar.bz2
initscripts-167c4a01e39bea20e25b48a8620870313cd02ba8.tar.xz
initscripts-167c4a01e39bea20e25b48a8620870313cd02ba8.zip
automatically unmount network fs when stopping network
Diffstat (limited to 'rc.d/init.d/network')
-rwxr-xr-xrc.d/init.d/network12
1 files changed, 12 insertions, 0 deletions
diff --git a/rc.d/init.d/network b/rc.d/init.d/network
index 6521f2c3..84c7ed04 100755
--- a/rc.d/init.d/network
+++ b/rc.d/init.d/network
@@ -77,6 +77,18 @@ case "$1" in
touch /var/lock/subsys/network
;;
stop)
+ # If this is a final shutdown/halt, check for network FS,
+ # and unmount them even if the user didn't turn on netfs
+
+ if [ "$RUNLEVEL" = "6" -o "$RUNLEVEL" = "0" -o "$RUNLEVEL" = "1" ]; then
+ NFSMTAB=`grep -v '^#' /proc/mounts | awk '{ if ($3 ~ /^nfs$/ ) print $2}'`
+ SMBMTAB=`grep -v '^#' /proc/mounts | awk '{ if ($3 ~ /^smbfs$/ ) print $2}'`
+ NCPMTAB=`grep -v '^#' /proc/mounts | awk '{ if ($3 ~ /^ncpfs$/ ) print $2}'`
+ if [ -n "$NFSMTAB" -o -n "$SMBMTAB" -o -n "$NCPMTAB" ] ; then
+ /etc/rc.d/init.d/netfs stop
+ fi
+ fi
+
for i in $interfaces ; do
action "Shutting down interface $i" ./ifdown $i boot
done