summaryrefslogtreecommitdiff
blob: 9dbf7e80917540df71f789f92613e10b85748086 (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
#!/sbin/runscript
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
# $Header: /var/cvsroot/gentoo-x86/net-mail/courier-imap/files/authdaemond.rc6,v 1.4 2003/02/14 23:02:25 vapier Exp $

depend() {
	need net
}

checkconfig() {
	if [ ! -e /etc/courier-imap/authdaemonrc ] ; then
		eerror "You need an /etc/courier-imap/authdaemonrc file to run authdaemon"
		return 1
	fi
}

setauth() {

	source /etc/courier-imap/authdaemonrc
	AUTHLIB="/usr/lib/courier-imap/authlib"
	source /etc/courier-imap/authdaemond.conf

}

start() {
	checkconfig || return 1
	setauth
	
	ebegin "Starting ${AUTHDAEMOND}"
	start-stop-daemon --quiet --start --exec \
		/usr/bin/env - "${AUTHLIB}/${AUTHDAEMOND}" start \
		--pidfile /var/lib/courier-imap/authdaemon/pid
	eend $?
}

stop() {
	setauth
	
	ebegin "Stopping ${AUTHDAEMOND}"
	start-stop-daemon --quiet --stop \
		--pidfile /var/lib/courier-imap/authdaemon/pid
	eend $?
}