Przeglądaj źródła

Delete chains on firewall stop

Serghey Rodin 10 lat temu
rodzic
commit
b6c152a258
1 zmienionych plików z 9 dodań i 0 usunięć
  1. 9 0
      bin/v-stop-firewall

+ 9 - 0
bin/v-stop-firewall

@@ -40,6 +40,15 @@ echo "$iptables -F INPUT" >> $tmp
 # Deleting vesta chain
 echo "$iptables -X vesta" >> $tmp
 
+# Deleting custom chains
+chains=$(cat $VESTA/data/firewall/chains.conf 2>/dev/null)
+IFS=$'\n'
+for chain in $chains; do
+    eval $chain
+    echo "$iptables -F fail2ban-$CHAIN" >> $tmp
+    echo "$iptables -X fail2ban-$CHAIN" >> $tmp
+done
+
 # Applying rules
 bash $tmp 2>/dev/null