blob: af40fa75c3b8e7b70c21f5e5fd9c038520785711 (
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
  | 
#!@SHELL@
#
# This is a sample /etc/init.d file for Courier-IMAP
#
# chkconfig: 2345 80 30
# description: Courier-IMAP - IMAP server
#
#
#
prefix=@prefix@
exec_prefix=@exec_prefix@
bindir=@bindir@
sbindir=@sbindir@
datarootdir=@datarootdir@
case "$1" in
start)
        cd /
	. @sysconfdir@/imapd
	touch /var/lock/subsys/courier-imap
	echo -n "Starting Courier-IMAP server:"
	case x$IMAPDSTART in
	x[yY]*)
		# Start daemons.
		@libexecdir@/imapd.rc start
		echo -n " imap"
		;;
	esac
	. @sysconfdir@/imapd-ssl
	case x$IMAPDSSLSTART in
	x[yY]*)
		if test -x $COURIERTLS
		then
		# First time we start this, generate a dummy SSL certificate.
			if test ! -f $TLS_CERTFILE
			then
				echo -n " generating-SSL-certificate..."
				@datadir@/mkimapdcert >/dev/null 2>&1
			fi
			@libexecdir@/imapd-ssl.rc start
			echo -n " imap-ssl"
		fi
		;;
	esac
	POP3DSTART=""
	POP3DSSLSTART=""
	if test -f @sysconfdir@/pop3d
	then
		. @sysconfdir@/pop3d
	fi
	case x$POP3DSTART in
	x[yY]*)
		# Start daemons.
		@libexecdir@/pop3d.rc start
		echo -n " pop3"
		;;
	esac
	if test -f @sysconfdir@/pop3d-ssl
	then
		. @sysconfdir@/pop3d-ssl
	fi
	case x$POP3DSSLSTART in
	x[yY]*)
		if test -x $COURIERTLS
		then
		# First time we start this, generate a dummy SSL certificate.
			if test ! -f $TLS_CERTFILE
			then
				echo -n " generating-SSL-certificate..."
				@datadir@/mkpop3dcert >/dev/null 2>&1
			fi
			@libexecdir@/pop3d-ssl.rc start
			echo -n " pop3-ssl"
		fi
		;;
	esac
	echo ""
	;;
stop)
        echo -n "Stopping Courier-IMAP server:"
	. @sysconfdir@/imapd
	. @sysconfdir@/imapd-ssl
	@libexecdir@/imapd.rc stop
	echo -n " imap"
	if test -x $COURIERTLS
	then
		@libexecdir@/imapd-ssl.rc stop
		echo -n " imap-ssl"
	fi
	if test -f @sysconfdir@/pop3d
	then
		@libexecdir@/pop3d.rc stop
		echo -n " pop3"
		if test -x $COURIERTLS
		then
			@libexecdir@/pop3d-ssl.rc stop
			echo -n " pop3-ssl"
		fi
	fi
	echo ""
	rm -f /var/lock/subsys/courier-imap
	;;
restart)
	$0 stop
	$0 start
        ;;
esac
exit 0
  |