blob: b2329b701e354f015662c7fdd54da3b01a05dee2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
#!/bin/sh
# $FreeBSD$
#
# PROVIDE: amavis_p0fanalyzer
# REQUIRE: DAEMON
# KEYWORD: shutdown
. /etc/rc.subr
name=amavis_p0fanalyzer
rcvar=amavis_p0fanalyzer_enable
load_rc_config $name
: ${amavis_p0fanalyzer_enable:=no}
: ${amavis_p0fanalyzer_p0f_filter:=tcp dst port 25}
: ${amavis_p0fanalyzer_pidfile1=/var/run/p0fanalyzer1.pid}
: ${amavis_p0fanalyzer_pidfile2=/var/run/p0fanalyzer2.pid}
: ${amavis_p0fanalyzer_flags=2345}
start_cmd=p0fanalyzer_start
stop_cmd=p0fanalyzer_stop
p0fanalyzer_start()
{
echo "Starting p0f-analyzer." && \
%%DAEMON%% ${amavis_p0fanalyzer_pidfile1} \
%%PREFIX%%/bin/p0f "${amavis_p0fanalyzer_p0f_filter}" 2>&1 | \
%%DAEMON%% ${amavis_p0fanalyzer_pidfile2} \
%%PREFIX%%/sbin/p0f-analyzer.pl ${amavis_p0fanalyzer_flags}
}
p0fanalyzer_stop()
{
test -s ${amavis_p0fanalyzer_pidfile1} && /bin/kill `cat ${amavis_p0fanalyzer_pidfile2}`
test -s ${amavis_p0fanalyzer_pidfile1} && /bin/kill `cat ${amavis_p0fanalyzer_pidfile1}`
}
run_rc_command $1
|