Merge remote-tracking branch 'origin/vendor/LIBEDIT'
[dragonfly.git] / etc / rc.d / mountcritlocal
1 #!/bin/sh
2 #
3 # $NetBSD: mountcritlocal,v 1.7 2002/04/29 12:29:53 lukem Exp $
4 # $FreeBSD: src/etc/rc.d/mountcritlocal,v 1.5 2003/06/01 01:43:37 gordon Exp $
5 #
6
7 # PROVIDE: mountcritlocal
8 # REQUIRE: root
9
10 . /etc/rc.subr
11
12 name="mountcritlocal"
13 start_cmd="mountcritlocal_start"
14 stop_cmd=":"
15
16 mountcritlocal_start()
17 {
18         # Set up the list of network filesystem types for which mounting
19         # should be delayed until after network initialization.
20         case ${extra_netfs_types} in
21         [Nn][Oo])
22                 ;;
23         *)
24                 netfs_types="${netfs_types} ${extra_netfs_types}"
25                 ;;
26         esac
27
28         # Mount everything except for network filesystems.
29         mount_excludes=""
30         for i in ${netfs_types}; do
31                 fstype=${i%:*}
32                 mount_excludes="${mount_excludes}${fstype},"
33         done
34         debug "mount -a -t no${mount_excludes%,}"
35         mount -a -t no${mount_excludes%,}
36         err=$?
37         if [ ${err} -ne 0 ]; then
38                 echo 'Mounting /etc/fstab filesystems failed,' \
39                      'startup aborted'
40                 exit ${err}
41         fi
42 }
43
44 load_rc_config $name
45 run_rc_command "$1"