]> git.pld-linux.org Git - packages/courier-imap.git/blame - courier-imap-pop3.init
- rel 0.1; new scripts need testing; pldized init scripts
[packages/courier-imap.git] / courier-imap-pop3.init
CommitLineData
1986fe76 1#!/bin/sh
0e7557ae 2# POP3 Daemon
1986fe76 3#
4# chkconfig: 345 80 20
0e7557ae 5# description: POP3 Daemon
1986fe76 6
7efa8e76
AA
7sysconfdir=@sysconfdir@
8libexecdir=@libexecdir@
9sbindir=@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 18if 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
23else
24 exit 0
1986fe76 25fi
26
d5f9e77f 27RETVAL=0
1986fe76 28# See how we were called.
29case "$1" in
30 start)
31 # Check if the service is already running?
0e7557ae 32 if [ ! -f /var/lock/subsys/courier-pop3 ]; then
05b6dd04
AM
33 . $sysconfdir/pop3d
34 msg_starting pop3d
35 daemon $libexecdir/pop3d.rc start
36 RETVAL=$?
37 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/courier-pop3
1986fe76 38 else
05b6dd04 39 msg_already_running pop3d
1986fe76 40 fi
05b6dd04 41 ;;
1986fe76 42 stop)
0e7557ae 43 if [ -f /var/lock/subsys/courier-pop3 ]; then
05b6dd04
AM
44 . $sysconfdir/pop3d
45 msg_stopping pop3d
46 daemon $libexecdir/pop3d.rc stop
47 RETVAL=$?
48 rm -f /var/lock/subsys/courier-pop3 >/dev/null 2>&1
1986fe76 49 else
05b6dd04 50 msg_not_running pop3d
1986fe76 51 fi
52 ;;
d5f9e77f 53 restart|force-reload)
1986fe76 54 $0 stop
55 $0 start
d5f9e77f 56 exit $?
1986fe76 57 ;;
58 status)
59 status couriertcpd
d5f9e77f 60 exit $?
1986fe76 61 ;;
62 *)
d5f9e77f 63 msg_usage "$0 {start|stop|restart|force-reload|status}"
64 exit 3
1986fe76 65esac
66
67exit $RETVAL
This page took 0.081949 seconds and 4 git commands to generate.