diff options
author | Koen Kooi <koen@openembedded.org> | 2005-06-30 08:19:37 +0000 |
---|---|---|
committer | OpenEmbedded Project <openembedded-devel@lists.openembedded.org> | 2005-06-30 08:19:37 +0000 |
commit | c8e5702127e507e82e6f68a4b8c546803accea9d (patch) | |
tree | 00583491f40ecc640f2b28452af995e3a63a09d7 /packages/initscripts/initscripts-1.0/openslug/umountnfs.sh | |
parent | 87ec8ca4d2e2eb4d1c1e1e1a6b46a395d56805b9 (diff) |
import clean BK tree at cset 1.3670
Diffstat (limited to 'packages/initscripts/initscripts-1.0/openslug/umountnfs.sh')
-rw-r--r-- | packages/initscripts/initscripts-1.0/openslug/umountnfs.sh | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/packages/initscripts/initscripts-1.0/openslug/umountnfs.sh b/packages/initscripts/initscripts-1.0/openslug/umountnfs.sh index e69de29bb2..994a919225 100644 --- a/packages/initscripts/initscripts-1.0/openslug/umountnfs.sh +++ b/packages/initscripts/initscripts-1.0/openslug/umountnfs.sh @@ -0,0 +1,40 @@ +#! /bin/sh +# +# umountnfs.sh Unmount all network filesystems. +# +PATH=/sbin:/bin:/usr/sbin:/usr/bin + +# Write a reboot record to /var/log/wtmp before unmounting +halt -w + +# Ensure /proc is mounted +test -r /proc/mounts || mount -t proc proc /proc + +echo "Unmounting remote filesystems..." + +# +# Read the list of mounted file systems and -f umount the +# known network file systems. -f says umount it even if +# the server is unreachable. Do not attempt to umount +# the root file system. Unmount in reverse order from +# that given by /proc/mounts (otherwise it may not work). +# +unmount() { + local dev mp type opts + if read dev mp type opts + then + # recurse - unmount later items + unmount + # skip /, /proc and /dev + case "$mp" in + /|/proc)return 0;; + /dev) return 0;; + esac + # then unmount this, if nfs + case "$type" in + nfs|smbfs|ncpfs) umount -f "$mp";; + esac + fi +} + +unmount </proc/mounts |