From 167c4a01e39bea20e25b48a8620870313cd02ba8 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Mon, 27 Mar 2000 18:02:59 +0000 Subject: automatically unmount network fs when stopping network --- rc.d/init.d/network | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'rc.d/init.d') 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 -- cgit v1.2.1