freebsd-ports/mail/milter-regex/files/milterregex.in
Dirk Meyer b4208d4fed - allow group access for postfix
PR:		192229
Submitted by:	Mel Muth
2014-08-03 05:34:43 +00:00

48 lines
948 B
Bash

#!/bin/sh
# $FreeBSD$
# Start or stop milterregex
# PROVIDE: milterregex
# REQUIRE: DAEMON
# BEFORE: mail
# KEYWORD: shutdown
spooldir=%%SPOOLDIR%%
# Define these milterregex_* variables in one of these files:
# /etc/rc.conf
# /etc/rc.conf.local
# /etc/rc.conf.d/milterregex
#
# DO NOT CHANGE THESE DEFAULT VALUES HERE
#
# milterregex_flags Flags to milter-regex program
[ -z "$milterregex_enable" ] && milterregex_enable="NO" # Enable milter-regex
. /etc/rc.subr
name="milterregex"
rcvar="milterregex_enable"
command="%%PREFIX%%/libexec/milter-regex"
pidfile="${spooldir}/milter-regex.pid"
required_files="%%PREFIX%%/etc/milter-regex.conf"
start_precmd="milterregex_prestart"
stop_postcmd="milterregex_poststop"
milterregex_prestart() {
if test ! -d "${spooldir}"
then
mkdir -m 750 -p "${spooldir}"
chown mailnull:mail "${spooldir}"
fi
}
milterregex_poststop() {
/bin/rm -f ${pidfile}
}
load_rc_config $name
run_rc_command "$1"