2001-06-16 03:16:14 -04:00
|
|
|
#!/bin/sh
|
|
|
|
|
#
|
2002-06-13 18:14:37 -04:00
|
|
|
# $FreeBSD$
|
2001-06-16 03:16:14 -04:00
|
|
|
#
|
|
|
|
|
|
|
|
|
|
# PROVIDE: ipmon
|
2020-08-11 19:36:38 -04:00
|
|
|
# REQUIRE: FILESYSTEMS hostname sysctl
|
2002-06-13 18:14:37 -04:00
|
|
|
# BEFORE: SERVERS
|
2020-07-23 13:39:45 -04:00
|
|
|
# KEYWORD: nojailvnet
|
2001-06-16 03:16:14 -04:00
|
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
|
|
|
|
|
name="ipmon"
|
2016-04-23 12:10:54 -04:00
|
|
|
desc="Monitors /dev/ipl for logged packets"
|
2012-01-13 21:18:41 -05:00
|
|
|
rcvar="ipmon_enable"
|
2005-10-28 12:55:38 -04:00
|
|
|
command="/sbin/${name}"
|
2004-01-17 05:40:45 -05:00
|
|
|
start_precmd="ipmon_precmd"
|
2002-06-13 18:14:37 -04:00
|
|
|
|
|
|
|
|
ipmon_precmd()
|
|
|
|
|
{
|
2003-04-24 04:20:47 -04:00
|
|
|
# Continue only if ipfilter or ipnat is enabled and the
|
|
|
|
|
# ipfilter module is loaded.
|
|
|
|
|
#
|
2018-11-21 23:48:27 -05:00
|
|
|
if ! checkyesno ipfilter_enable && ! checkyesno ipnat_enable && ! checkyesno rc_force ; then
|
2003-04-24 04:20:47 -04:00
|
|
|
err 1 "${name} requires either ipfilter or ipnat enabled"
|
|
|
|
|
fi
|
2013-09-10 09:48:33 -04:00
|
|
|
if ! ${ipfilter_program:-/sbin/ipf} -V | grep -q 'Running: yes' >/dev/null 2>&1; then
|
2003-04-24 04:20:47 -04:00
|
|
|
err 1 "ipfilter module is not loaded"
|
2002-10-12 06:31:31 -04:00
|
|
|
fi
|
2002-06-13 18:14:37 -04:00
|
|
|
return 0
|
|
|
|
|
}
|
2001-06-16 03:16:14 -04:00
|
|
|
|
|
|
|
|
load_rc_config $name
|
|
|
|
|
run_rc_command "$1"
|