summaryrefslogtreecommitdiff
path: root/security/passivedns/files/passivedns.in
blob: 89714a1945c4ff5aef0c2b81cfcd3d9a85133bf1 (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
40
41
42
43
44
45
46
47
48
49
#!/bin/sh

# $FreeBSD$
#
# PROVIDE: passivedns
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: shutdown

# Add the following lines to /etc/rc.conf to enable passivedns:
# passivedns_enable (bool):	Set to YES to enable passivedns
# 				Default: NO
# passivedns_interface (str):	
#				Default: none - MUST BE SET
# passivedns_logdir (str):   	Logging Directory
#               Default: "/var/log/passivedns"
# passivedns_fields (str):   	Passive DNS Fields to log
#               Default: "SMcsCQTAtn"
# passivedns_flags (str):		Extra flags passed to passivedns (-D is always passed)
#				Default: none

. /etc/rc.subr

name="passivedns"
rcvar=passivedns_enable

command="%%PREFIX%%/bin/passivedns"

start_precmd=start_precmd

start_precmd()
{
	if [ -z "${passivedns_interface}" ]; then
		err 1 "passivedns_interface must set."
	fi
}

# set some defaults
load_rc_config $name

: ${passivedns_enable="NO"}
: ${passivedns_logdir="/var/log/passivedns"}
: ${passivedns_fields="SMcsCQTAtn"}
: ${passivedns_flags=""}

command_args="-i ${passivedns_interface} -l ${passivedns_logdir}/passivedns.log -f ${passivedns_fields} ${passivedns_flags} -D"

run_rc_command "$1"