Ver código fonte

Merge branch 'devel'

Edvinas Valatka 9 anos atrás
pai
commit
d6fe341340
1 arquivos alterados com 2 adições e 2 exclusões
  1. 2 2
      e-badips

+ 2 - 2
e-badips

@@ -9,10 +9,10 @@ trap "/bin/rm -f ${tmp}" EXIT SIGHUP SIGINT SIGTERM
 
 curl -f -s -S -m 60 -o $tmp "https://www.badips.com/get/list/${banservice}/${banlevel}?age=${rangecheck}"
 while read -r ip ; do
-    ipset -! add ${banset} ${ip} timeout $banttl
+    [[ "$ip" =~ ^[0-9]{1,}.[0-9]{1,}.[0-9]{1,}.[0-9]{1,}$ ]] && ipset -! add ${banset} ${ip} timeout $banttl
 done < $tmp
 
 curl -f -s -S -m 60 -o $tmp  "http://api.blocklist.de/getlast.php?time=3600&service=all"
 while read -r ip ; do
-    ipset -! add ${banset} ${ip} timeout $banttl
+    [[ "$ip" =~ ^[0-9]{1,}.[0-9]{1,}.[0-9]{1,}.[0-9]{1,}$ ]] && ipset -! add ${banset} ${ip} timeout $banttl
 done < $tmp