summaryrefslogtreecommitdiffstats
path: root/mail/courier-imap/files/courier-imap-imapd.in
blob: bb132e3d3c011125c76804ab99f8278cd7bc7577 (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
#!/bin/sh
#
# An rc.subr-style startup script for Courier-IMAP's IMAP service.

# PROVIDE: courier_imap_imapd
# REQUIRE: LOGIN courier_authdaemond
# KEYWORD: shutdown

# Define these courier_imap_imapd_* variables in one of these files:
# 	/etc/rc.conf
# 	/etc/rc.conf.local
# 	/etc/rc.conf.d/courier_imap_imapd
#
# DO NOT CHANGE THESE DEFAULT VALUES HERE

courier_imap_imapd_enable=${courier_imap_imapd_enable-"NO"}

. %%RC_SUBR%%

name="courier_imap_imapd"
rcvar=`set_rcvar`
command="%%PREFIX%%/libexec/courier-imap/imapd.rc"
pidfile="/var/run/imapd.pid"
procname="%%PREFIX%%/sbin/courierlogger"

start_cmd="imapd_cmd start"
stop_cmd="imapd_cmd stop"
restart_cmd="imapd_cmd stop && imapd_cmd start"

load_rc_config $name

imapd_cmd () {
	case $1 in
	start)
		echo "Starting ${name}."
		${command} start
		;;
	stop)
		echo "Stopping ${name}."
		${command} stop
		;;
	esac
}

run_rc_command "$1"

OpenPOWER on IntegriCloud