]> git.pld-linux.org Git - packages/courier-imap.git/blob - courier-imap.init
- updated to rc-scripts 0.2.0
[packages/courier-imap.git] / courier-imap.init
1 #!/bin/sh
2 # IMAP Daemon
3 #
4 # chkconfig:    345 80 20
5 # description:  IMAP Daemon
6
7 # Source function library
8 . /etc/rc.d/init.d/functions
9
10 # Get network config
11 . /etc/sysconfig/network
12
13 # Get service config
14 [ -f /etc/sysconfig/courier-imap ] && . /etc/sysconfig/courier-imap
15
16 # Check that networking is up.
17 if is_no "${NETWORKING}" ; then
18         msg_Network_Down IMAP
19         exit 1
20 fi
21
22 # See how we were called.
23 case "$1" in
24   start)
25         # Check if the service is already running?
26         if [ ! -f /var/lock/subsys/courier-imap ]; then
27                 msg_starting IMAP
28                 busy
29                 
30                 LIBAUTHMODULES=""
31                 for f in `echo $AUTHMODULES`; do
32                     LIBAUTHMODULES="$LIBAUTHMODULES /usr/lib/courier-imap/$f"
33                 done
34
35                 /usr/lib/courier-imap/couriertcpd -address=$ADDRESS \
36                     -maxprocs=$MAXDAEMONS -maxperip=$MAXPERIP \
37                     -pid=/var/run/imapd.pid -stderrlogger=/usr/lib/courier-imap/logger \
38                     -forcebind -nodnslookup -noidentlookup $PORT \
39                     /usr/bin/imaplogin $LIBAUTHMODULES /usr/bin/imapd $MAILDIR &
40
41                 if ps ax | grep -v grep | grep -q couriertcpd; then
42                     touch /var/lock/subsys/courier-imap
43                     deltext;ok
44                 else
45                     deltext;fail
46                 fi
47         else
48                 msg_Already_Running IMAP
49                 exit 1
50         fi
51         ;;
52   stop)
53         msg_stopping IMAP
54         killproc couriertcpd
55         rm -f /var/run/imapd.pid
56         rm -f /var/lock/subsys/courier-imap
57         ;;
58   restart|reload)
59         $0 stop
60         $0 start
61         ;;
62   status)
63         status couriertcpd
64         ;;
65   *)
66         msg_Usage "$0 {start|stop|restart|reload|status}"
67         exit 1
68 esac
69
70 exit 0
71
This page took 0.068238 seconds and 4 git commands to generate.