aboutsummaryrefslogtreecommitdiff
path: root/mail/dovecot/files/dovecot.sh.in
blob: 17263cb5c4d5c476c33169898a959135f9e7961d (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
#!/bin/sh
#
# $FreeBSD$
#

# PROVIDE: dovecot
# REQUIRE: %%REQUIRE%%
# KEYWORD: shutdown

# Define these dovecot_* variables in one of these files:
#	/etc/rc.conf
#	/etc/rc.conf.local
#	/etc/rc.conf.d/dovecot
#
# DO NOT CHANGE THESE DEFAULT VALUES HERE
#
: ${dovecot_enable:="NO"}

. %%RC_SUBR%%

name=dovecot
rcvar=`set_rcvar`

command=%%PREFIX%%/sbin/${name}
required_files=%%PREFIX%%/etc/${name}.conf
start_precmd="${name}_prestart"
extra_commands="restart"

dovecot_prestart()
{	# Ensure runtime directories exist with correct permissions
	base=/var/run/dovecot
	/usr/bin/install -o root -g wheel -m 0755 -d ${base}
	/usr/bin/install -o root -g dovecot -m 0750 -d ${base}/login
}

load_rc_config ${name}
run_rc_command "$1"