]>
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 JR |
26 | if is_no "${NETWORKING}"; then |
27 | msg_Network_Down nfsfs | |
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) | |
42 | show "Unmounting NFS filesystems" | |
43 | busy | |
44 | umount -a -t nfs | |
45 | deltext | |
46 | ok | |
47 | rm -f /var/lock/subsys/nfsfs | |
48 | ;; | |
49 | status) | |
50 | if [ -f /proc/mounts ] ; then | |
51 | echo "Configured NFS mountpoints:" | |
52 | grep -v '^#' /etc/fstab | \ | |
53 | awk '{ if ($3 ~ /^nfs$/ && $4 !~ /noauto/) print $2}' | |
54 | echo "Active NFS mountpoints:" | |
55 | grep -v '^#' /proc/mounts | \ | |
56 | awk '{ if ($3 ~ /^nfs$/ && $4 !~ /noauto/) print $2}' | |
57 | else | |
58 | echo "/proc filesystem unavailable" | |
59 | fi | |
60 | ;; | |
61 | restart) | |
62 | $0 stop | |
63 | $0 start | |
64 | ;; | |
65 | reload) | |
66 | mount -a -t nfs | |
67 | ;; | |
68 | *) | |
bf36188d | 69 | msg_Usage "$0 {start|stop|restart|reload|status}" |
9fddaaa8 JR |
70 | exit 1 |
71 | esac | |
72 | ||
73 | exit 0 | |
74 |