daily 150.clean-hoststat: suppress error when using dma

dma(8) does not have hoststat or purgestat, so this script produces
an error from the daily script.  We could disable this script, but
that would mean yet another change to switch back to sendmail.  Check
for purgestat in mailer.conf before attempting either hoststat or
purgestat.

Reviewed by:	pstef, bapt
Differential Revision:	https://reviews.freebsd.org/D37712
This commit is contained in:
Mike Karels 2022-12-16 09:13:07 -06:00
parent b939fe5ff1
commit c934f2a574

View File

@ -2,7 +2,7 @@
#
# $FreeBSD$
#
# Remove stale persistent host status files
# Remove stale persistent host status files if the mailer supports it.
#
# If there is a global system configuration file, suck it in.
@ -14,7 +14,9 @@ fi
case "$daily_clean_hoststat_enable" in
[Yy][Ee][Ss])
if [ -z "$(hoststat 2>&1)" ]; then
if ! grep -q '^purgestat' /etc/mail/mailer.conf; then
rc=3
elif [ -z "$(hoststat 2>&1)" ]; then
rc=2
else
echo ""