summaryrefslogtreecommitdiff
path: root/mail/sid-milter/files/miltersid.in
blob: 9debc09d8a567961bbf67692c1d03fa1742b5af4 (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
#!/bin/sh

# PROVIDE: miltersid
# REQUIRE: DAEMON
# BEFORE: mail localpkg
# KEYWORD: shutdown
#
# Define these miltersid_* variables in one of these files:
#	/etc/rc.conf
#	/etc/rc.conf.local
#	/etc/rc.conf.d/miltersid
#
# DO NOT CHANGE THESE DEFAULT VALUES HERE
#

. /etc/rc.subr

name="miltersid"
desc="SID Milter Daemon"
rcvar="miltersid_enable"
load_rc_config $name

: ${miltersid_enable:="NO"}
: ${miltersid_socket:="local:/var/run/sid-filter"}
: ${miltersid_pid:="/var/run/sid-filter.pid"}
: ${miltersid_flags:="-r 0 -t"}
pidfile=${miltersid_pid}
command="%%PREFIX%%/libexec/sid-filter"
command_args="-l -p ${miltersid_socket} -P ${miltersid_pid}"
start_precmd="sid_precmd"

sid_precmd()
{
	if [ -S ${miltersid_socket##local:} ] ; then
		rm -f ${miltersid_socket##local:}
	elif [ -S ${miltersid_socket##unix:} ] ; then
		rm -f ${miltersid_socket##unix:}
	fi
}

run_rc_command "$1"