]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - libexec/rc/rc.d/ipmon
zfs: merge openzfs/zfs@a94860a6d
[FreeBSD/FreeBSD.git] / libexec / rc / rc.d / ipmon
1 #!/bin/sh
2 #
3 #
4
5 # PROVIDE: ipmon
6 # REQUIRE: FILESYSTEMS hostname sysctl
7 # BEFORE:  SERVERS
8 # KEYWORD: nojailvnet
9
10 . /etc/rc.subr
11
12 name="ipmon"
13 desc="Monitors /dev/ipl for logged packets"
14 rcvar="ipmon_enable"
15 command="/sbin/${name}"
16 start_precmd="ipmon_precmd"
17
18 ipmon_precmd()
19 {
20         # Continue only if ipfilter or ipnat is enabled and the
21         # ipfilter module is loaded.
22         #
23         if ! checkyesno ipfilter_enable && ! checkyesno ipnat_enable && ! checkyesno rc_force ; then
24                 err 1  "${name} requires either ipfilter or ipnat enabled"
25         fi
26         if ! ${ipfilter_program:-/sbin/ipf} -V | grep -q 'Running: yes' >/dev/null 2>&1; then
27                 err 1 "ipfilter module is not loaded"
28         fi
29         return 0
30 }
31
32 load_rc_config $name
33 run_rc_command "$1"