Home | History | Annotate | Line # | Download | only in rc.d
modules revision 1.1
      1  1.1  jmcneill #!/bin/sh
      2  1.1  jmcneill #
      3  1.1  jmcneill # $NetBSD: modules,v 1.1 2015/03/21 19:10:43 jmcneill Exp $
      4  1.1  jmcneill #
      5  1.1  jmcneill 
      6  1.1  jmcneill # PROVIDE: modules
      7  1.1  jmcneill # BEFORE:  securelevel
      8  1.1  jmcneill 
      9  1.1  jmcneill $_rc_subr_loaded . /etc/rc.subr
     10  1.1  jmcneill 
     11  1.1  jmcneill name="modules"
     12  1.1  jmcneill rcvar=$name
     13  1.1  jmcneill start_cmd="modules_start"
     14  1.1  jmcneill stop_cmd=":"
     15  1.1  jmcneill 
     16  1.1  jmcneill modules_start()
     17  1.1  jmcneill {
     18  1.1  jmcneill 	if [ -f /etc/modules.conf ]; then
     19  1.1  jmcneill 		echo "Loading modules."
     20  1.1  jmcneill 		cat /etc/modules.conf |
     21  1.1  jmcneill 		while read -r args; do
     22  1.1  jmcneill 			args=${args%%#*}		# strip comments
     23  1.1  jmcneill 			test -z "$args" && continue
     24  1.1  jmcneill 			/sbin/modload $args
     25  1.1  jmcneill 		done
     26  1.1  jmcneill 	fi
     27  1.1  jmcneill }
     28  1.1  jmcneill 
     29  1.1  jmcneill load_rc_config $name
     30  1.1  jmcneill run_rc_command "$1"
     31