From 75ed5b3ce4c13a9d15fe07330ad732c4bd429873 Mon Sep 17 00:00:00 2001 From: Jose Date: Mon, 8 Feb 2021 04:17:32 -0400 Subject: [PATCH] Add quick check for pfctl command --- usr/local/share/bastille/stop.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/usr/local/share/bastille/stop.sh b/usr/local/share/bastille/stop.sh index c310655..b5ce8ee 100644 --- a/usr/local/share/bastille/stop.sh +++ b/usr/local/share/bastille/stop.sh @@ -55,9 +55,12 @@ for _jail in ${JAILS}; do pfctl -q -t jails -T delete "$(jls -j ${_jail} ip4.addr)" fi fi - - if [ "$(bastille rdr ${_jail} list)" ]; then - bastille rdr ${_jail} clear + + # Check if pfctl is present + if test -f /sbin/pfctl; then + if [ "$(bastille rdr ${_jail} list)" ]; then + bastille rdr ${_jail} clear + fi fi ## remove rctl limits