Explorar el Código

fix for netmask

Serghey Rodin hace 10 años
padre
commit
98e6fec795
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      bin/v-delete-firewall-ban

+ 2 - 1
bin/v-delete-firewall-ban

@@ -45,7 +45,8 @@ if [ -z "$check_ip" ]; then
 fi
 fi
 
 
 # Deleting ip from banlist
 # Deleting ip from banlist
-sed -i "/IP='$ip' CHAIN='$chain'/d" $conf
+sip=$(echo "$ip"| sed "s|/|\\\/|g")
+sed -i "/IP='$sip' CHAIN='$chain'/d" $conf
 b=$($iptables -L fail2ban-$chain --line-number -n|grep $ip|awk '{print $1}')
 b=$($iptables -L fail2ban-$chain --line-number -n|grep $ip|awk '{print $1}')
 $iptables -D fail2ban-$chain $b 2>/dev/null
 $iptables -D fail2ban-$chain $b 2>/dev/null