diff options
Diffstat (limited to 'meta/packages/initscripts/initscripts-1.0/mountnfs.sh')
-rwxr-xr-x | meta/packages/initscripts/initscripts-1.0/mountnfs.sh | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/meta/packages/initscripts/initscripts-1.0/mountnfs.sh b/meta/packages/initscripts/initscripts-1.0/mountnfs.sh new file mode 100755 index 0000000000..84cb3651fc --- /dev/null +++ b/meta/packages/initscripts/initscripts-1.0/mountnfs.sh | |||
@@ -0,0 +1,87 @@ | |||
1 | # | ||
2 | # mountnfs.sh Now that TCP/IP is configured, mount the NFS file | ||
3 | # systems in /etc/fstab if needed. If possible, | ||
4 | # start the portmapper before mounting (this is needed for | ||
5 | # Linux 2.1.x and up). | ||
6 | # | ||
7 | # Also mounts SBM filesystems now, so the name of | ||
8 | # this script is getting increasingly inaccurate. | ||
9 | # | ||
10 | # Version: @(#)mountnfs.sh 2.83 05-Oct-2001 miquels@cistron.nl | ||
11 | # | ||
12 | |||
13 | . /etc/default/rcS | ||
14 | |||
15 | # | ||
16 | # Run in a subshell because of I/O redirection. | ||
17 | # | ||
18 | test -f /etc/fstab && ( | ||
19 | |||
20 | # | ||
21 | # Read through fstab line by line. If it is NFS, set the flag | ||
22 | # for mounting NFS filesystems. If any NFS partition is found and it | ||
23 | # not mounted with the nolock option, we start the portmapper. | ||
24 | # | ||
25 | portmap=no | ||
26 | mount_nfs=no | ||
27 | mount_smb=no | ||
28 | mount_ncp=no | ||
29 | while read device mountpt fstype options | ||
30 | do | ||
31 | case "$device" in | ||
32 | ""|\#*) | ||
33 | continue | ||
34 | ;; | ||
35 | esac | ||
36 | |||
37 | case "$options" in | ||
38 | *noauto*) | ||
39 | continue | ||
40 | ;; | ||
41 | esac | ||
42 | |||
43 | if test "$fstype" = nfs | ||
44 | then | ||
45 | mount_nfs=yes | ||
46 | case "$options" in | ||
47 | *nolock*) | ||
48 | ;; | ||
49 | *) | ||
50 | portmap=yes | ||
51 | ;; | ||
52 | esac | ||
53 | fi | ||
54 | if test "$fstype" = smbfs | ||
55 | then | ||
56 | mount_smb=yes | ||
57 | fi | ||
58 | if test "$fstype" = ncpfs | ||
59 | then | ||
60 | mount_ncp=yes | ||
61 | fi | ||
62 | done | ||
63 | |||
64 | exec 0>&1 | ||
65 | |||
66 | if test "$portmap" = yes | ||
67 | then | ||
68 | if test -x /sbin/portmap | ||
69 | then | ||
70 | echo -n "Starting portmapper... " | ||
71 | start-stop-daemon --start --quiet --exec /sbin/portmap | ||
72 | sleep 2 | ||
73 | fi | ||
74 | fi | ||
75 | |||
76 | if test "$mount_nfs" = yes || test "$mount_smb" = yes || test "$mount_ncp" = yes | ||
77 | then | ||
78 | echo "Mounting remote filesystems..." | ||
79 | test "$mount_nfs" = yes && mount -a -t nfs | ||
80 | test "$mount_smb" = yes && mount -a -t smbfs | ||
81 | test "$mount_ncp" = yes && mount -a -t ncpfs | ||
82 | fi | ||
83 | |||
84 | ) < /etc/fstab | ||
85 | |||
86 | : exit 0 | ||
87 | |||