Browse Source

Added rules file variable

Allen 1 week ago
parent
commit
155a12bea9
1 changed files with 3 additions and 2 deletions
  1. 3 2
      resetfirewall.sh

+ 3 - 2
resetfirewall.sh

@@ -1,9 +1,10 @@
 #!/bin/bash
 #
 
-BADGUYS_FILE=""  # The location (full path) where you want to download the list
+BADGUYS_FILE=""  # The location you want to download the list (/path/to/badguys.txt)
 CHAIN_NAME="CINSARMY_IPS"  # The firewall chain to hold the cinsarmy rules
 FIREWALL="/sbin/iptables"  # The path to iptables
+RULESFILE=""  # The path to your iptables rules file (/path/to/iptables.rules)
 ETH=""  # The name of the ethernet port you'd like to apply these rules to. Example: eth1
 
 echo "Clearing firewall."
@@ -15,7 +16,7 @@ $FIREWALL -t mangle -F
 $FIREWALL -F
 $FIREWALL -X
 echo "Restoring firewall from iptables.rules."
-/sbin/iptables-restore < /etc/iptables.rules
+$FIREWALL-restore < $RULESFILE
 echo "Restoring fail2ban rules."
 sudo systemctl restart fail2ban
 echo "Downloading cinsarmy IP list..."