summaryrefslogtreecommitdiff
path: root/mail/mixminion/files/mixminiond.in
blob: 6c32b36f41e4261f6051798b022d78accac95b21 (plain) (blame)
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
56
57
58
59
60
61
62
63
64
65
#!/bin/sh
#
# $FreeBSD$
#
# REQUIRE: NETWORKING SERVERS USR
# BEFORE: LOGIN
#
# Add the following lines to /etc/rc.conf to enable mixminiond
#
# mixminiond_enable (bool):	Set to "NO" by default
#				Set it to "YES" to enable mixminiond
# mixminiond_conf (str):	Points to your mixminiond conf file
#				Default: %%PREFIX%%/etc/mixminiond.conf
# mixminiond_user (str):	Mixminiond user. Default _mixminion
#

. /etc/rc.subr

name="mixminiond"
rcvar=${name}_enable

load_rc_config ${name}

: ${mixminiond_enable="NO"}
: ${mixminiond_conf="%%PREFIX%%/etc/mixminiond.conf"}
: ${mixminiond_user="_mixminion"}
: ${mixminiond_pidfile="/var/run/mixminion/mixminion.pid"}

required_files=${mixminiond_conf}
required_dirs=/var/spool/mixminion
command="%%PREFIX%%/bin/${name}"
extra_commands="reload republish DELKEYS stats upgrade"
start_cmd="${name}_start"
stop_cmd="${name}_stop"
reload_cmd="${name}_reload"
republish_cmd="${name}_republish"
DELKEYS_cmd="${name}_DELKEYS"
stats_cmd="${name}_stats"

mixminiond_start() {
	su ${mixminiond_user} -c "${command} start -f ${mixminiond_conf} --daemon"
}

mixminiond_stop() {
	${command} stop -f ${mixminiond_conf}
	run_rc_command poll
}

mixminiond_reload() {
	${command} server-reload -f ${mixminiond_conf}
}

mixminiond_republish() {
	${command} republish -f ${mixminiond_conf}
}

mixminiond_DELKEYS() {
	${command} DELKEYS -f ${mixminiond_conf}
}

mixminiond_stats() {
	${command} stats -f ${mixminiond_conf}
}

run_rc_command "$1"