3 # umountnfs.sh Unmount all network filesystems.
5 PATH=/sbin:/bin:/usr/sbin:/usr/bin
7 # Write a reboot record to /var/log/wtmp before unmounting
10 # Ensure /proc is mounted
11 test -r /proc/mounts || mount -t proc proc /proc
13 echo "Unmounting remote filesystems..."
16 # Read the list of mounted file systems and -f umount the
17 # known network file systems. -f says umount it even if
18 # the server is unreachable. Do not attempt to umount
19 # the root file system. Unmount in reverse order from
20 # that given by /proc/mounts (otherwise it may not work).
23 local dev mp type opts
24 if read dev mp type opts
26 # recurse - unmount later items
28 # skip /, /proc and /dev
32 # then unmount this, if nfs
34 nfs|smbfs|ncpfs|cifs) umount -f -r "$mp";;