#!/bin/sh
# init script for the DBMail IMAP server
# you may need to make some changes to the following paths
# directory where the IMAP server executable resides
PROGDIR=/usr/local/sbin
# directory containing database shared libraries
# - multiple directories separated by a colon (':') are acceptable
# - if the IMAP server is statically linked, you may comment this out
DBLIBDIR=/usr/local/mysql/lib/mysql
# fully qualified filename of the DBMail configuration file
CONFIGFILE=/etc/dbmail.conf
# directory where the process ID of the IMAP server should be stored
# (this feature is not yet supported by DBMail)
PIDDIR=/var/run
##############################################################################
########### you should not have to change anything below this line ###########
##############################################################################
PROGRAM=dbmail-imapd
PIDFILE=$PIDDIR/$PROGRAM.pid
PATH=$PROGDIR:$PATH
export LD_LIBRARY_PATH=$DBLIBDIR:$LD_LIBRARY_PATH
export LIBPATH=$DBLIBDIR:$LIBPATH
OPTS="-f $CONFIGFILE -p $PIDFILE"
test -x $PROGDIR/$PROGRAM || exit 0
case "$1" in
start)
echo -n "Starting DBMail IMAP daemon ($PROGRAM) ... "
$PROGRAM $OPTS
echo "done."
;;
stop)
echo -n "Stopping DBMail IMAP daemon ... "
kill `cat $PIDFILE`
echo "done."
;;
reload)
$0 stop
sleep 2
$0 start
;;
restart|force-reload)
$0 reload
;;
*)
echo "Usage: $0 {start|stop|reload|restart|force-reload}" >&2
exit 1
;;
esac
exit 0
syntax highlighted by Code2HTML, v. 0.9.1