]> git.pld-linux.org Git - packages/courier-imap.git/blame - courier-imap.init
- adapter(ized) and cosmetics.
[packages/courier-imap.git] / courier-imap.init
CommitLineData
e93af56d 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.
17if [ "${NETWORKING}" = "no" ]; then
18 nls "WARNING: Networking is down. IMAP service can't be runed."
19 exit 1
20fi
21
22
23# See how we were called.
24case "$1" in
25 start)
26 # Check if the service is already running?
27 if [ ! -f /var/lock/subsys/courier-imap ]; then
28 show Starting IMAP Daemon
29 busy
30
31 LIBAUTHMODULES=""
32 for f in `echo $AUTHMODULES`; do
33 LIBAUTHMODULES="$LIBAUTHMODULES /usr/lib/courier-imap/$f"
34 done
35
36 /usr/lib/courier-imap/couriertcpd -address=$ADDRESS \
37 -maxprocs=$MAXDAEMONS -maxperip=$MAXPERIP \
38 -pid=/var/run/imapd.pid -stderrlogger=/usr/lib/courier-imap/logger \
39 -forcebind -nodnslookup -noidentlookup $PORT \
40 /usr/bin/imaplogin $LIBAUTHMODULES /usr/bin/imapd $MAILDIR &
41
42 if ps ax | grep -v grep | grep -q couriertcpd; then
43 deltext;ok
44 else
45 deltext;fail
46 fi
47 else
48 nls "IMAP already is running\n"
49 fi
50 touch /var/lock/subsys/courier-imap
51 ;;
52 stop)
53 show Stopping IMAP Daemon
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 nls "Usage: $0 {start|stop|restart|reload|status}"
67 exit 1
68esac
69
70exit 0
71
This page took 0.081739 seconds and 4 git commands to generate.