diff options
Diffstat (limited to 'mail/exim/files/exim.sh')
-rw-r--r-- | mail/exim/files/exim.sh | 82 |
1 files changed, 58 insertions, 24 deletions
diff --git a/mail/exim/files/exim.sh b/mail/exim/files/exim.sh index 3b58c00fa14f..cac669b06d41 100644 --- a/mail/exim/files/exim.sh +++ b/mail/exim/files/exim.sh @@ -2,29 +2,63 @@ # # $FreeBSD$ # -# Note that 'pidfile' may need to be changed if 'args' is altered; see -# the description of the 'pid_file_path' Exim configuration option in -# the Exim Specification. + +# PROVIDE: mail +# REQUIRE: LOGIN +# KEYWORD: FreeBSD 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 exim: +# +#exim_enable="YES" # -args='-bd -q30m' -pidfile='/var/run/exim.pid' - -case "$1" in -start) - [ -x /usr/local/sbin/exim ] && /usr/local/sbin/exim ${args} && \ - echo -n ' exim' - ;; -stop) - kill `cat ${pidfile}` && echo -n ' exim' - ;; -reload) - kill -HUP `cat ${pidfile}` && echo -n ' exim' - ;; -*) - echo "Usage: `basename $0` {start|stop|reload}" >&2 - exit 64 - ;; -esac - -exit 0 +# See exim(8) for flags +# + +. %%RC_SUBR%% + +name=exim +rcvar=`set_rcvar` + +command=%%PREFIX%%/sbin/exim +pidfile=/var/run/exim.pid +required_dirs=/var/log/exim +required_files=%%PREFIX%%/etc/exim/configure + +start_precmd=start_precmd +stop_postcmd=stop_postcmd + +extra_commands="reload" + +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 +} + +# set defaults + +exim_enable=${exim_enable:-"NO"} +exim_flags=${exim_flags:-"-bd -q30m"} +load_rc_config $name +run_rc_command "$1" |