ipmon revision 210734
151893Sache#!/bin/sh 251893Sache# 374331Sache# $FreeBSD: head/etc/rc.d/ipmon 210734 2010-08-01 15:41:00Z jilles $ 451893Sache# 551893Sache 651893Sache# PROVIDE: ipmon 777980Sache# REQUIRE: FILESYSTEMS hostname sysctl cleanvar ipfilter 851893Sache# BEFORE: SERVERS 951893Sache# KEYWORD: nojail 1051893Sache 1151893Sache. /etc/rc.subr 1251893Sache 1351893Sachename="ipmon" 1451893Sachercvar=`set_rcvar` 1551893Sachecommand="/sbin/${name}" 1651893Sachestart_precmd="ipmon_precmd" 1751893Sache 1851893Sacheipmon_precmd() 1951893Sache{ 2051893Sache # Continue only if ipfilter or ipnat is enabled and the 2151893Sache # ipfilter module is loaded. 2251893Sache # 2351893Sache if ! checkyesno ipfilter_enable && ! checkyesno ipnat_enable ; then 2451893Sache err 1 "${name} requires either ipfilter or ipnat enabled" 25173749Sache fi 2651893Sache if ! sysctl net.inet.ipf.fr_pass >/dev/null 2>&1; then 2751893Sache err 1 "ipfilter module is not loaded" 2851893Sache fi 2951893Sache return 0 3051893Sache} 3151893Sache 3251893Sacheload_rc_config $name 3351893Sacherun_rc_command "$1" 3451893Sache