pkgsrc/mail/courier-imap/files/courierimap.sh
jlam fd154a9588 Modify the Courier services rc.d scripts so that:
(1) they are more likely to do the right thing if the user sets
       rc_fast_and_loose; and

   (2) they pre-create any necessary directories prior to start the
       respective services.

Also, fix the path to the courierwebadmin binary in SPECIAL_PERMS for the
courier-mta package.

Bump the PKGREVISION.
2006-06-17 19:26:48 +00:00

52 lines
935 B
Bash
Executable file

#!@RCD_SCRIPTS_SHELL@
#
# $NetBSD: courierimap.sh,v 1.13 2006/06/17 19:26:48 jlam Exp $
#
# Courier IMAP services daemon
#
# PROVIDE: courierimap
# REQUIRE: authdaemond
# KEYWORD: shutdown
. /etc/rc.subr
name="courierimap"
rcvar=${name}
command="@PREFIX@/sbin/couriertcpd"
ctl_command="@PREFIX@/sbin/imapd"
pidfile="@VARBASE@/run/imapd.pid"
required_files="@PKG_SYSCONFDIR@/imapd @PKG_SYSCONFDIR@/imapd-ssl"
start_cmd="courierimap_doit start"
stop_cmd="courierimap_doit stop"
courierimap_doit()
{
action=$1
case $action in
start)
for f in $required_files; do
if [ ! -r "$f" ]; then
@ECHO@ 1>&2 "$0: WARNING: $f is not readable"
return 1
fi
done
. @PKG_SYSCONFDIR@/imapd
case x$IMAPDSTART in
x[yY]*)
@ECHO@ "Starting ${name}."
${ctl_command} $action
;;
esac
;;
stop)
@ECHO@ "Stopping ${name}."
${ctl_command} $action
;;
esac
}
load_rc_config $name
run_rc_command "$1"