summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh')
-rwxr-xr-xmeta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh83
1 files changed, 83 insertions, 0 deletions
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh b/meta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh
new file mode 100755
index 0000000000..46c58b16a8
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh
@@ -0,0 +1,83 @@
1### BEGIN INIT INFO
2# Provides: mountnfs
3# Required-Start: $local_fs $network $portmap
4# Required-Stop:
5# Default-Start: S
6# Default-Stop:
7### END INIT INFO
8
9. /etc/default/rcS
10
11#
12# Run in a subshell because of I/O redirection.
13#
14test -f /etc/fstab && (
15
16#
17# Read through fstab line by line. If it is NFS, set the flag
18# for mounting NFS filesystems. If any NFS partition is found and it
19# not mounted with the nolock option, we start the portmapper.
20#
21portmap=no
22mount_nfs=no
23mount_smb=no
24mount_ncp=no
25while read device mountpt fstype options
26do
27 case "$device" in
28 ""|\#*)
29 continue
30 ;;
31 esac
32
33 case "$options" in
34 *noauto*)
35 continue
36 ;;
37 esac
38
39 if test "$fstype" = nfs
40 then
41 mount_nfs=yes
42 case "$options" in
43 *nolock*)
44 ;;
45 *)
46 portmap=yes
47 ;;
48 esac
49 fi
50 if test "$fstype" = smbfs
51 then
52 mount_smb=yes
53 fi
54 if test "$fstype" = ncpfs
55 then
56 mount_ncp=yes
57 fi
58done
59
60exec 0>&1
61
62if test "$portmap" = yes
63then
64 if test -x /sbin/portmap
65 then
66 echo -n "Starting portmapper... "
67 start-stop-daemon --start --quiet --exec /sbin/portmap
68 sleep 2
69 fi
70fi
71
72if test "$mount_nfs" = yes || test "$mount_smb" = yes || test "$mount_ncp" = yes
73then
74 echo "Mounting remote filesystems..."
75 test "$mount_nfs" = yes && mount -a -t nfs
76 test "$mount_smb" = yes && mount -a -t smbfs
77 test "$mount_ncp" = yes && mount -a -t ncpfs
78fi
79
80) < /etc/fstab
81
82: exit 0
83