From 728203eb58ec790320f47f41746ce935c8612dcc Mon Sep 17 00:00:00 2001 From: sthen Date: Thu, 21 Apr 2022 09:31:28 +0000 Subject: [PATCH] Fix previous rc.d/spamlogd commit, the check in rc_pre is not needed because rc.subr has special-casing for spamd/spamlogd. Teach the script to detect the pflog interface from spamlogd flags and create the correct interface if needed. ok jturner@ --- etc/rc.d/spamlogd | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/etc/rc.d/spamlogd b/etc/rc.d/spamlogd index 45e62ce9ad2..5076e8722f5 100644 --- a/etc/rc.d/spamlogd +++ b/etc/rc.d/spamlogd @@ -1,6 +1,6 @@ #!/bin/ksh # -# $OpenBSD: spamlogd,v 1.5 2022/04/11 09:32:20 sthen Exp $ +# $OpenBSD: spamlogd,v 1.6 2022/04/21 09:31:28 sthen Exp $ daemon="/usr/libexec/spamlogd" @@ -9,11 +9,13 @@ daemon="/usr/libexec/spamlogd" rc_reload=NO rc_pre() { - [[ ${spamd_flags} != NO && ${spamd_black} == NO ]] && return 1 + pflog=$(echo $daemon_flags | sed -En 's/.*-l *(pflog[0-9]+).*/\1/p') + pflog=${pflog:-pflog0} + if pfctl -si | grep -q Enabled; then - ifconfig pflog0 create - if ifconfig pflog0; then - ifconfig pflog0 up + ifconfig $pflog create + if ifconfig $pflog; then + ifconfig $pflog up else return 1 fi -- 2.20.1