summaryrefslogtreecommitdiff
path: root/mail/dspam/files/dspam.in
blob: 9c17ae47eb19d1728202f7386ab53656fcde7a3a (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
50
51
52
53
54
55
#!/bin/sh
# $FreeBSD$
#

# PROVIDE: dspam
# REQUIRE: DAEMON %%MYSQL%% %%PGSQL%% %%CLAMD%%
# BEFORE: mail
# KEYWORD: shutdown

#
# Add the following lines to /etc/rc.conf[.local] to enable dspam:
# dspam_enable="YES"
#
# dspam_debug="YES" will start dspam with debug logging (you need ar least WITH_DEBUG)
# you can also set the pid file via dspam_pidfile
#

. /etc/rc.subr

name="dspam"
rcvar=dspam_enable

load_rc_config $name

#defaults
: ${dspam_enable="NO"}
: ${dspam_debug="NO"}
: ${dspam_pidfile:-/var/run/dspam/dspam.pid}
: ${dspam_user="%%DSPAM_OWNER%%"}
: ${dspam_group="%%DSPAM_GROUP%%"}

command=%%PREFIX%%/bin/${name}

start_precmd=dspam_checkdebug
extra_commands=reload

required_dirs=%%DSPAM_HOME%%
required_files=%%PREFIX%%/etc/${name}.conf

dspam_checkdebug()
{
	if checkyesno dspam_debug
	then
		command_args="--daemon --debug > /dev/null 2>&1 &"
	else
		command_args="--daemon > /dev/null 2>&1 &"
	fi
}

reload()
{
 kill -HUP `cat $pidfile`
}

run_rc_command "$1"