]>
Commit | Line | Data |
---|---|---|
05b6dd04 AM |
1 | #!/bin/sh |
2 | # POP3 SSL Daemon | |
3 | # | |
4 | # chkconfig: 345 80 20 | |
5 | # description: POP3 SSL Daemon | |
6 | ||
7 | sysconfdir=@sysconfdir@ | |
8 | libexecdir=@libexecdir@ | |
9 | sbindir=@sbindir@ | |
10 | ||
11 | # Source function library | |
12 | . /etc/rc.d/init.d/functions | |
13 | ||
14 | # Get network config | |
15 | . /etc/sysconfig/network | |
16 | ||
17 | # Check that networking is up. | |
18 | if is_yes "${NETWORKING}"; then | |
862484de ER |
19 | if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then |
20 | msg_network_down pop3d-ssl | |
21 | exit 1 | |
22 | fi | |
05b6dd04 | 23 | else |
862484de | 24 | exit 0 |
05b6dd04 AM |
25 | fi |
26 | ||
27 | RETVAL=0 | |
28 | # See how we were called. | |
29 | case "$1" in | |
862484de ER |
30 | start) |
31 | # Check if the service is already running? | |
32 | if [ ! -f /var/lock/subsys/courier-pop3-ssl ]; then | |
33 | if [ -x "$COURIERTLS" -a ! -f "$TLS_CERTFILE" ]; then | |
34 | msg_starting "pop3d-ssl cert generation" | |
35 | daemon $sbindir/mkpop3dcert | |
36 | fi | |
862484de ER |
37 | msg_starting pop3d-ssl |
38 | daemon $libexecdir/pop3d-ssl.rc start | |
39 | RETVAL=$? | |
40 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/courier-pop3-ssl | |
41 | else | |
42 | msg_already_running pop3d-ssl | |
43 | fi | |
44 | ;; | |
45 | stop) | |
46 | if [ -f /var/lock/subsys/courier-pop3-ssl ]; then | |
862484de ER |
47 | msg_stopping pop3d-ssl |
48 | daemon $libexecdir/pop3d-ssl.rc stop | |
49 | RETVAL=$? | |
50 | rm -f /var/lock/subsys/courier-pop3-ssl >/dev/null 2>&1 | |
51 | else | |
52 | msg_not_running pop3d-ssl | |
05b6dd04 | 53 | fi |
862484de ER |
54 | ;; |
55 | restart|force-reload) | |
56 | $0 stop | |
57 | $0 start | |
58 | exit $? | |
59 | ;; | |
60 | status) | |
61 | status couriertcpd | |
62 | exit $? | |
63 | ;; | |
64 | *) | |
65 | msg_usage "$0 {start|stop|restart|force-reload|status}" | |
66 | exit 3 | |
05b6dd04 AM |
67 | esac |
68 | ||
69 | exit $RETVAL |