ipmon revision 124618
1#!/bin/sh
2#
3# $NetBSD: ipmon,v 2002/04/18 05:02:01 lukem Exp $
4# $FreeBSD: head/etc/rc.d/ipmon 124618 2004-01-17 10:40:45Z mtm $
5#
6
7# PROVIDE: ipmon
8# REQUIRE: mountcritlocal hostname sysctl cleanvar
9# BEFORE:  SERVERS
10# KEYWORD: FreeBSD
11
12. /etc/rc.subr
13
14name="ipmon"
15rcvar=`set_rcvar`
16command="/sbin/ipmon"
17start_precmd="ipmon_precmd"
18
19ipmon_precmd()
20{
21	# Continue only if ipfilter or ipnat is enabled and the
22	# ipfilter module is loaded.
23	#
24	if ! checkyesno ipfilter_enable -o ! checkyesno ipnat_enable ; then
25		err 1  "${name} requires either ipfilter or ipnat enabled"
26	fi
27	if ! sysctl net.inet.ipf.fr_pass >/dev/null 2>&1; then
28		err 1 "ipfilter module is not loaded"
29	fi
30	return 0
31}
32
33load_rc_config $name
34run_rc_command "$1"
35