summaryrefslogtreecommitdiff
path: root/mail/antivirus-milter/files/antivirus.in
blob: 485894520c5980b2b657faf5d2578977a69dfb99 (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$
#
# Start or stop antivirus
#
# PROVIDE: antivirus
# REQUIRE: DAEMON
# BEFORE: mail
# KEYWORD: shutdown
#
#
# Define these antivirus_* variables in one of these files:
#	/etc/rc.conf
#	/etc/rc.conf.local
#	/etc/rc.conf.d/antivirus
#
# DO NOT CHANGE THESE DEFAULT VALUES HERE
#

. /etc/rc.subr

name="antivirus"
desc="Antivirus Milter Daemon"
rcvar="antivirus_enable"

load_rc_config $name

: ${antivirus_enable:="NO"}
: ${antivirus_pidfile:="%%ANTIVIRUS%%/run/antivirus.pid"}
: ${antivirus_socket:="%%ANTIVIRUS%%/antivirus.sock"}
command="%%PREFIX%%/libexec/antivirus"
command_args="-p local:${antivirus_socket} ${antivirus_flags}"
pidfile="${antivirus_pidfile}"
required_files="%%PREFIX%%/etc/antivirus.conf"
start_precmd="antivirus_prestart"
stop_postcmd="antivirus_poststop"

antivirus_prestart()
{
	/bin/rm -f "${pidfile}" "${antivirus_socket}"
}

antivirus_poststop()
{
	/bin/rm -f "${pidfile}" "${antivirus_socket}"
}

run_rc_command "$1"