ports/mail/masqmail/files/masqmail.in
Doug Barton 83eb2c3700 In the rc.d scripts, change assignments to rcvar to use the
literal name_enable wherever possible, and ${name}_enable
when it's not, to prepare for the demise of set_rcvar().

In cases where I had to hand-edit unusual instances also
modify formatting slightly to be more uniform (and in
some cases, correct). This includes adding some $FreeBSD$
tags, and most importantly moving rcvar= to right after
name= so it's clear that one is derived from the other.
2012-01-14 08:57:23 +00:00

62 lines
1.1 KiB
Bash

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: mail
# REQUIRE: LOGIN
# KEYWORD: shutdown
# we make mail start late, so that things like .forward's are not
# processed until the system is fully operational
#
# Add the following lines to /etc/rc.conf to enable masqmail:
#
#masqmail_enable="YES"
#
# See masqmail(8) for flags
#
. /etc/rc.subr
name=masqmail
rcvar=masqmail_enable
command=%%PREFIX%%/sbin/masqmail
required_dirs=/var/log/masqmail
required_files=%%PREFIX%%/etc/masqmail/masqmail.conf
start_precmd=start_precmd
stop_postcmd=stop_postcmd
extra_commands="reload"
load_rc_config $name
# set defaults
masqmail_enable=${masqmail_enable:-"NO"}
masqmail_flags=${masqmail_flags:-"-bd -q30m"}
start_precmd()
{
case $sendmail_enable in
[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
warn "sendmail_enable should be set to NONE"
;;
[Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0)
case $sendmail_submit_enable in
[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
warn "sendmail_submit_enable should be set to NO"
;;
esac
;;
[Nn][Oo][Nn][Ee])
;;
esac
}
stop_postcmd()
{
rm -f $pidfile
}
run_rc_command "$1"