]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/initscripts/initscripts-1.0/mountnfs.sh
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / initscripts / initscripts-1.0 / mountnfs.sh
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