#!/bin/sh
#
# $NetBSD: modules,v 1.1.2.3 2015/05/16 04:37:04 snj Exp $
#

# PROVIDE: modules
# REQUIRE: fsck_root
# BEFORE: root

$_rc_subr_loaded . /etc/rc.subr

name="modules"
rcvar=$name
start_cmd="modules_start"
stop_cmd=":"

modules_start()
{
	if [ -f /etc/modules.conf ]; then
		echo "Loading modules."
		while read name args; do
			case $name in
			''|"#"*)
				;;
			*)
				(
					set -o noglob
					eval set -- $args
					modload "$@" "$name"
				)
				;;
			esac
		done < /etc/modules.conf
	fi
}

load_rc_config $name
run_rc_command "$1"
