mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-28 11:57:28 +00:00
5a44cde9d8
we would lose it's pid file. Also, cleanup the depencies in rc.d/cleanvar PR: bin/53516
43 lines
780 B
Bash
Executable File
43 lines
780 B
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# $NetBSD: ipmon,v 2002/04/18 05:02:01 lukem Exp $
|
|
# $FreeBSD$
|
|
#
|
|
|
|
# PROVIDE: ipmon
|
|
# REQUIRE: mountcritlocal hostname sysctl cleanvar
|
|
# BEFORE: SERVERS
|
|
# KEYWORD: FreeBSD NetBSD
|
|
|
|
. /etc/rc.subr
|
|
|
|
name="ipmon"
|
|
rcvar=`set_rcvar`
|
|
|
|
case ${OSTYPE} in
|
|
FreeBSD)
|
|
command="/sbin/ipmon"
|
|
start_precmd="ipmon_precmd"
|
|
;;
|
|
NetBSD)
|
|
command="/usr/sbin/${name}"
|
|
command_args="-D"
|
|
esac
|
|
|
|
ipmon_precmd()
|
|
{
|
|
# Continue only if ipfilter or ipnat is enabled and the
|
|
# ipfilter module is loaded.
|
|
#
|
|
if ! checkyesno ipfilter_enable -o ! checkyesno ipnat_enable ; then
|
|
err 1 "${name} requires either ipfilter or ipnat enabled"
|
|
fi
|
|
if ! sysctl net.inet.ipf.fr_pass >/dev/null 2>&1; then
|
|
err 1 "ipfilter module is not loaded"
|
|
fi
|
|
return 0
|
|
}
|
|
|
|
load_rc_config $name
|
|
run_rc_command "$1"
|