From 0f4597a2c6f985ad82da8ff3e6482bfc8aab928e Mon Sep 17 00:00:00 2001 From: Bike Dude Date: Mon, 30 Mar 2020 22:33:32 +0200 Subject: [PATCH] add_rdr_destroy --- usr/local/share/bastille/destroy.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/usr/local/share/bastille/destroy.sh b/usr/local/share/bastille/destroy.sh index c0c1fdd7..dc35fedf 100644 --- a/usr/local/share/bastille/destroy.sh +++ b/usr/local/share/bastille/destroy.sh @@ -80,6 +80,12 @@ destroy_jail() { echo -e "${COLOR_GREEN}Note: jail console logs archived.${COLOR_RESET}" echo -e "${COLOR_GREEN}${bastille_jail_log}-$(date +%F)${COLOR_RESET}" fi + + ## clear any active rdr rules + if [ ! -z "$(pfctl -a "rdr/${TARGET}" -Psn 2>/dev/null)" ]; then + echo -e "${COLOR_GREEN}Clearing RDR rules:${COLOR_RESET}" + pfctl -a "rdr/${TARGET}" -Fn + fi echo fi }