Changeset View
Changeset View
Standalone View
Standalone View
libexec/rc/rc.d/ipmon
| Show All 9 Lines | |||||
| . /etc/rc.subr | . /etc/rc.subr | ||||
| name="ipmon" | name="ipmon" | ||||
| desc="Monitors /dev/ipl for logged packets" | desc="Monitors /dev/ipl for logged packets" | ||||
| rcvar="ipmon_enable" | rcvar="ipmon_enable" | ||||
| command="/sbin/${name}" | command="/sbin/${name}" | ||||
| start_precmd="ipmon_precmd" | start_precmd="ipmon_precmd" | ||||
| # no svcj options needed | |||||
| : ${ipmon_svcj_options:=""} | |||||
| ipmon_precmd() | ipmon_precmd() | ||||
| { | { | ||||
| # Continue only if ipfilter or ipnat is enabled and the | # Continue only if ipfilter or ipnat is enabled and the | ||||
| # ipfilter module is loaded. | # ipfilter module is loaded. | ||||
| # | # | ||||
| if ! checkyesno ipfilter_enable && ! checkyesno ipnat_enable && ! checkyesno rc_force ; then | if ! checkyesno ipfilter_enable && ! checkyesno ipnat_enable && ! checkyesno rc_force ; then | ||||
| err 1 "${name} requires either ipfilter or ipnat enabled" | err 1 "${name} requires either ipfilter or ipnat enabled" | ||||
| fi | fi | ||||
| if ! ${ipfilter_program:-/sbin/ipf} -V | grep -q 'Running: yes' >/dev/null 2>&1; then | if ! ${ipfilter_program:-/sbin/ipf} -V | grep -q 'Running: yes' >/dev/null 2>&1; then | ||||
| err 1 "ipfilter module is not loaded" | err 1 "ipfilter module is not loaded" | ||||
| fi | fi | ||||
| return 0 | return 0 | ||||
| } | } | ||||
| load_rc_config $name | load_rc_config $name | ||||
| run_rc_command "$1" | run_rc_command "$1" | ||||