Skip to content

Commit b6c152a

Browse files
committed
Delete chains on firewall stop
1 parent 8eaa1b7 commit b6c152a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

bin/v-stop-firewall

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@ echo "$iptables -F INPUT" >> $tmp
4040
# Deleting vesta chain
4141
echo "$iptables -X vesta" >> $tmp
4242

43+
# Deleting custom chains
44+
chains=$(cat $VESTA/data/firewall/chains.conf 2>/dev/null)
45+
IFS=$'\n'
46+
for chain in $chains; do
47+
eval $chain
48+
echo "$iptables -F fail2ban-$CHAIN" >> $tmp
49+
echo "$iptables -X fail2ban-$CHAIN" >> $tmp
50+
done
51+
4352
# Applying rules
4453
bash $tmp 2>/dev/null
4554

0 commit comments

Comments
 (0)