]>
Commit | Line | Data |
---|---|---|
9fddaaa8 JR |
1 | #!/bin/sh |
2 | # | |
3 | # nfsfs Mount NFS filesystems. | |
4 | # | |
5 | # Version: @(#) /etc/init.d/skeleton 1.01 26-Oct-1993 | |
6 | # | |
7 | # Author: Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org> | |
8 | # | |
9034116f | 9 | # chkconfig: 345 15 88 |
9fddaaa8 JR |
10 | # description: Mounts and unmounts all Network File System (NFS) \ |
11 | # mount points. | |
12 | # | |
13 | # $Id$ | |
14 | ||
15 | # Source networking configuration. | |
16 | if [ ! -f /etc/sysconfig/network ]; then | |
17 | exit 0 | |
18 | fi | |
19 | ||
20 | # Source function library. | |
21 | . /etc/rc.d/init.d/functions | |
22 | ||
23 | . /etc/sysconfig/network | |
24 | ||
25 | # Check that networking is up. | |
bf36188d | 26 | if is_no "${NETWORKING}"; then |
0c170055 | 27 | msg_network_down nfsfs |
bf36188d | 28 | exit 1 |
9fddaaa8 JR |
29 | fi |
30 | ||
31 | # See how we were called. | |
32 | case "$1" in | |
33 | start) | |
34 | show "Mounting NFS filesystems" | |
35 | busy | |
36 | mount -a -t nfs | |
37 | deltext | |
38 | ok | |
39 | touch /var/lock/subsys/nfsfs | |
40 | ;; | |
41 | stop) | |
eafe4dfc | 42 | if [ -f /proc/mounts ] ; then |
43 | fsfile="/proc/mounts" | |
44 | else | |
45 | fsfile="/etc/mtab" | |
46 | fi | |
47 | ||
9fddaaa8 JR |
48 | show "Unmounting NFS filesystems" |
49 | busy | |
eafe4dfc | 50 | fuser -msk -TERM `awk '$3 == "nfs" {print $2}' < $fsfile` |
1215427c | 51 | sleep 2 |
eafe4dfc | 52 | fuser -msk -KILL `awk '$3 == "nfs" {print $2}' < $fsfile` |
9fddaaa8 JR |
53 | umount -a -t nfs |
54 | deltext | |
55 | ok | |
56 | rm -f /var/lock/subsys/nfsfs | |
57 | ;; | |
58 | status) | |
59 | if [ -f /proc/mounts ] ; then | |
60 | echo "Configured NFS mountpoints:" | |
0c170055 JB |
61 | grep -v '^#' /etc/fstab | \ |
62 | awk '{ if ($3 ~ /^nfs$/ && $4 !~ /noauto/) print $2}' | |
9fddaaa8 | 63 | echo "Active NFS mountpoints:" |
0c170055 JB |
64 | grep -v '^#' /proc/mounts | \ |
65 | awk '{ if ($3 ~ /^nfs$/ && $4 !~ /noauto/) print $2}' | |
9fddaaa8 JR |
66 | else |
67 | echo "/proc filesystem unavailable" | |
68 | fi | |
69 | ;; | |
70 | restart) | |
71 | $0 stop | |
72 | $0 start | |
73 | ;; | |
74 | reload) | |
75 | mount -a -t nfs | |
76 | ;; | |
77 | *) | |
0c170055 | 78 | msg_usage "$0 {start|stop|restart|reload|status}" |
9fddaaa8 JR |
79 | exit 1 |
80 | esac | |
81 | ||
82 | exit 0 | |
83 |