summaryrefslogtreecommitdiff
blob: 5a05d7de02cc6d401bbee6f2c97c116b91038bc5 (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
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/mail-mta/postfix/files/postfix.rc6.2.2.9,v 1.2 2007/07/12 08:45:12 zzam Exp $

CONF_DIR="/etc/postfix"
CONF_OPT="${SVCNAME##*.}"
if [[ -n ${CONF_OPT} && ${SVCNAME} != "postfix" ]]; then
	CONF_DIR="${CONF_DIR}.${CONF_OPT}"
fi

opts="${opts} reload"

depend() {
	use logger dns ypbind amavisd mysql postgresql antivirus postfix_greylist net saslauthd
	if [ "${SVCNAME}" == "postfix" ]; then
		provide mta
	fi
}

start() {
	ebegin "Starting postfix (${CONF_DIR})"
	if [ ! -d ${CONF_DIR} ]; then
		eend 1 "${CONF_DIR} does not exist"
		return 1
	fi
	/usr/sbin/postfix -c ${CONF_DIR} start &>/dev/null
	eend $?
}

stop() {
	ebegin "Stopping postfix (${CONF_DIR})"
	/usr/sbin/postfix -c ${CONF_DIR} stop >/dev/null 2>&1
	eend $?
}

reload() {
	ebegin "Reloading postfix (${CONF_DIR})"
	/usr/sbin/postfix -c ${CONF_DIR} reload >/dev/null 2>&1
	eend $?
}