瀏覽代碼

Merge branch 'devel'

Edvinas Valatka 9 年之前
父節點
當前提交
d6fe341340
共有 1 個文件被更改,包括 2 次插入2 次删除
  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