#!/bin/sh # # $FreeBSD$ # # PROVIDE: mtad # REQUIRE: NETWORKING # # Add the following line to /etc/rc.conf[.local] to enable mtad # # mtad_enable (bool): Set to "NO" by default. # Set it to "YES" to enable mtad. . /etc/rc.subr name="mtad" rcvar=${name}_enable load_rc_config $name : ${mtad_enable="NO"} : ${mtad_chdir="%%MTADIR%%"} : ${mtad_config="%%PREFIX%%/etc/%%MTADIRE%%/mtaserver.conf"} : ${mtad_logfile="/var/log/mtaserver.log"} command="%%MTADIR%%/mtaserver" command_args="-b -c ${mtad_config} -l ${mtad_logfile} 2>&1 > /dev/null &" required_files=${mtad_config} start_precmd="mtad_prestart" stop_precmd="mtad_prestop" mtad_prestart() { if ! kldstat -v | grep -E 'linux(aout|elf)' > /dev/null; then err 1 "Linux support required" fi } mtad_prestop() { rc_pid=`echo $rc_pid | awk '{print $1}'` } run_rc_command "$1"