]> git.pld-linux.org Git - packages/courier-imap.git/blob - courier-imap-pop3-ssl.init
- service name caps unified
[packages/courier-imap.git] / courier-imap-pop3-ssl.init
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 # Get service config
18 [ -f /etc/sysconfig/courier-pop3-ssl ] && . /etc/sysconfig/courier-pop3-ssl
19
20 # Check that networking is up.
21 if is_yes "${NETWORKING}"; then
22         if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
23                 msg_network_down "Courier POP3D SSL"
24                 exit 1
25         fi
26 else
27         exit 0
28 fi
29
30 RETVAL=0
31 # See how we were called.
32 case "$1" in
33 start)
34         # Check if the service is already running?
35         if [ ! -f /var/lock/subsys/courier-pop3-ssl ]; then
36                 if [ -x "$COURIERTLS" -a ! -f "$TLS_CERTFILE" ]; then
37                         msg_starting "Courier POP3D SSL Cert generation"
38                         daemon $sbindir/mkpop3dcert
39                 fi
40                 msg_starting "Courier POP3D SSL"
41                 daemon $libexecdir/pop3d-ssl.rc start
42                 RETVAL=$?
43                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/courier-pop3-ssl
44         else
45                 msg_already_running "Courier POP3D SSL"
46         fi
47         ;;
48 stop)
49         if [ -f /var/lock/subsys/courier-pop3-ssl ]; then
50                 msg_stopping "Courier POP3D SSL"
51                 daemon $libexecdir/pop3d-ssl.rc stop
52                 RETVAL=$?
53                 rm -f /var/lock/subsys/courier-pop3-ssl >/dev/null 2>&1
54         else
55                 msg_not_running "Courier POP3D SSL"
56         fi
57         ;;
58 restart|force-reload)
59         $0 stop
60         $0 start
61         exit $?
62         ;;
63 status)
64         status couriertcpd
65         exit $?
66         ;;
67 *)
68         msg_usage "$0 {start|stop|restart|force-reload|status}"
69         exit 3
70 esac
71
72 exit $RETVAL
This page took 0.200753 seconds and 3 git commands to generate.