courier-imap/imapd-ssl-initscript

68 lines
1.6 KiB
Bash

#! /bin/sh
# $Id: imapd-ssl.rc.in,v 1.14 2002/12/24 02:31:40 mrsam Exp $
#
# Copyright 1998 - 2002 Double Precision, Inc.
# See COPYING for distribution information.
#
# Modified by Silvan Calarco for QiLinux - silvan.calarco@qilinux.it
# 29-09-2003: added chkconfig support
#
# chkconfig: 2345 60 10
# description: Courier SSL IMAP Server
#
prefix=/usr
exec_prefix=/usr
bindir=${exec_prefix}/bin
libexecdir=/usr/libexec/courier-imap
TLS_CACHEFILE=""
. /etc/imap/imapd
. /etc/imap/imapd-ssl
case $1 in
start)
LIBAUTHMODULES=""
for f in `echo $AUTHMODULES`
do
LIBAUTHMODULES="$LIBAUTHMODULES /usr/libexec/courier-imap/authlib/$f"
done
if test -x ${libexecdir}/authlib/authdaemond
then
/bin/env - ${libexecdir}/authlib/authdaemond start
fi
if test "$TLS_CACHEFILE" != ""
then
rm -f $TLS_CACHEFILE
fi
ulimit -v $IMAP_ULIMITD
/bin/env - /bin/sh -c " set -a ;
prefix=/usr ;
exec_prefix=/usr ;
bindir=${exec_prefix}/bin ;
libexecdir=/usr/libexec/courier-imap ;
. /etc/imap/imapd ; \
. /etc/imap/imapd-ssl ; \
IMAP_TLS=1; export IMAP_TLS; \
/usr/libexec/courier-imap/couriertcpd -address=$SSLADDRESS \
-stderrlogger=/usr/sbin/courierlogger \
-stderrloggername=imapd-ssl \
-maxprocs=$MAXDAEMONS -maxperip=$MAXPERIP \
-pid=$SSLPIDFILE $TCPDOPTS \
$SSLPORT $COURIERTLS -server -tcpd \
${exec_prefix}/sbin/imaplogin $LIBAUTHMODULES \
${exec_prefix}/bin/imapd Maildir"
;;
stop)
/usr/libexec/courier-imap/couriertcpd -pid=$SSLPIDFILE -stop
if test -x ${libexecdir}/authlib/authdaemond
then
${libexecdir}/authlib/authdaemond stop
fi
;;
esac
exit 0