initscripts : remove bootup.
[vuplus_openvuplus] / meta-openvuplus / recipes-core / initscripts / initscripts-1.0 / umountnfs.sh
1 #!/bin/sh
2 #
3 # umountnfs.sh  Unmount all network filesystems.
4 #
5 PATH=/sbin:/bin:/usr/sbin:/usr/bin
6
7 # Write a reboot record to /var/log/wtmp before unmounting
8 halt -w
9
10 # Ensure /proc is mounted
11 test -r /proc/mounts || mount -t proc proc /proc
12
13 echo "Unmounting remote filesystems..."
14
15 #
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).
21 #
22 unmount() {
23         local dev mp type opts
24         if read dev mp type opts
25         then
26                 # recurse - unmount later items
27                 unmount
28                 # skip /, /proc and /dev
29                 case "$mp" in
30                 /) return 0;;
31                 esac
32                 # then unmount this, if nfs
33                 case "$type" in
34                 nfs|smbfs|ncpfs|cifs) umount -f -r "$mp";;
35                 esac
36         fi
37 }
38
39 unmount </proc/mounts