From d6b5733d48d02eed3898d9e617df7591aec8df28 Mon Sep 17 00:00:00 2001 From: JRGTH Date: Thu, 7 Sep 2023 08:34:28 -0400 Subject: [PATCH] Add rdr pf conf check Prevent shutdown/rdr command stalls. --- usr/local/share/bastille/rdr.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/usr/local/share/bastille/rdr.sh b/usr/local/share/bastille/rdr.sh index 348d1407..634afb88 100644 --- a/usr/local/share/bastille/rdr.sh +++ b/usr/local/share/bastille/rdr.sh @@ -88,9 +88,11 @@ check_jail_validity() { fi # Check if ext_if is defined in pf.conf - EXT_IF=$(grep "^[[:space:]]*${bastille_network_pf_ext_if}[[:space:]]*=" ${bastille_pf_conf}) - if [ -z "${EXT_IF}" ]; then - error_exit "bastille_network_pf_ext_if (${bastille_network_pf_ext_if}) not defined in pf.conf" + if [ -n "${bastille_pf_conf}" ]; then + EXT_IF=$(grep "^[[:space:]]*${bastille_network_pf_ext_if}[[:space:]]*=" ${bastille_pf_conf}) + if [ -z "${EXT_IF}" ]; then + error_exit "bastille_network_pf_ext_if (${bastille_network_pf_ext_if}) not defined in pf.conf" + fi fi }