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