#!/bin/sh # # $Id$ # # PROVIDE: mdconfig # REQUIRE: mountcritlocal # BEFORE: jail # KEYWORD: nojail shutdown . /etc/rc.subr name="mdconfig" start_cmd="mdconfig_start" stop_cmd="mdconfig_stop" mdconfig_start() { if ! checkyesno mdconfig_enable; then return 0 fi sed -e 's/#.*$//' <${mdconfig_conf} |grep -v '^[[:space:]]*$' >/tmp/mdconfig.$$ echo -n 'Mounting vn filesystems:' while read _unit _file _type _opts _path; do echo -n " ${_file}" mdconfig -a -t vnode -f ${_file} -u ${_unit} if fsck -t ${_type} -p /dev/md${_unit}; then mount -t ${_type} -o "${_opts}" /dev/md${_unit} ${_path} fi done /tmp/mdconfig.$$ echo -n 'Unmounting vn filesystems:' while read _unit _file _type _opts _path; do echo -n " ${_file}" umount /dev/md${_unit} mdconfig -du ${_unit} done