File: courier-mta-ssl.init

package info (click to toggle)
courier 0.60.0-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 52,288 kB
  • ctags: 12,677
  • sloc: ansic: 165,348; cpp: 24,820; sh: 16,410; perl: 6,839; makefile: 3,621; yacc: 289; sed: 16
file content (61 lines) | stat: -rw-r--r-- 1,131 bytes parent folder | download | duplicates (3)
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
#! /bin/sh -e
### BEGIN INIT INFO
# Short-Description: Courier SMTP server
# Provides:          courier-mta-ssl
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
### END INIT INFO

sysconfdir="/etc/courier"
sbindir="/usr/sbin"
TCPD=${sbindir}/couriertcpd
DAEMONPROG=${sbindir}/esmtpd-ssl

test -f $DAEMONPROG || exit 0

# check for couriertcpd
if ! [ -x $TCPD ]; then
  exit 0
fi

# check for couriertls
if ! [ -x $COURIERTLS ]; then
  exit 0
fi

# check for esmtpd configuration file
if ! [ -f ${sysconfdir}/esmtpd ]; then
  exit 0
fi

# check for esmtpd-ssl configuration file
if ! [ -f ${sysconfdir}/esmtpd-ssl ]; then
  exit 0
fi

. ${sysconfdir}/esmtpd
. ${sysconfdir}/esmtpd-ssl

case "$1" in
start)
	echo -n "Starting Courier SMTP/SSL server:"
	${sbindir}/esmtpd-ssl start
	echo " done."
	;;
stop)
	echo -n "Stopping Courier SMTP/SSL server:"
   	${sbindir}/esmtpd-ssl stop
   	echo " done."
	;;
restart | force-reload)
    $0 stop
    $0 start
    ;;
*)
  echo "Usage: $0 {start|stop|restart|force-reload}" >&2
  exit 1
  ;;
esac
exit 0