Quellcode durchsuchen

Merge branch 'devel'

Edvinas Valatka vor 9 Jahren
Ursprung
Commit
d6fe341340
1 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  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