|
@@ -7,12 +7,14 @@ source $CONFD/config
|
|
|
tmp=$(mktemp)
|
|
tmp=$(mktemp)
|
|
|
trap "/bin/rm -f ${tmp}" EXIT SIGHUP SIGINT SIGTERM
|
|
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
|
|
|
|
|
- [[ "$ip" =~ ^[0-9]{1,}.[0-9]{1,}.[0-9]{1,}.[0-9]{1,}$ ]] && ipset -! add ${banset} ${ip} timeout $banttl
|
|
|
|
|
-done < $tmp
|
|
|
|
|
|
|
+if curl -f -s -S -m 60 -o $tmp "https://www.badips.com/get/list/${banservice}/${banlevel}?age=${rangecheck}" ; then
|
|
|
|
|
+ while read -r ip ; do
|
|
|
|
|
+ [[ "$ip" =~ ^[0-9]{1,}.[0-9]{1,}.[0-9]{1,}.[0-9]{1,}$ ]] && ipset -! add ${banset} ${ip} timeout $banttl
|
|
|
|
|
+ done < $tmp
|
|
|
|
|
+fi
|
|
|
|
|
|
|
|
-curl -f -s -S -m 60 -o $tmp "http://api.blocklist.de/getlast.php?time=3600&service=all"
|
|
|
|
|
-while read -r ip ; do
|
|
|
|
|
- [[ "$ip" =~ ^[0-9]{1,}.[0-9]{1,}.[0-9]{1,}.[0-9]{1,}$ ]] && ipset -! add ${banset} ${ip} timeout $banttl
|
|
|
|
|
-done < $tmp
|
|
|
|
|
|
|
+if curl -f -s -S -m 60 -o $tmp "http://api.blocklist.de/getlast.php?time=3600&service=all" ; then
|
|
|
|
|
+ while read -r ip ; do
|
|
|
|
|
+ [[ "$ip" =~ ^[0-9]{1,}.[0-9]{1,}.[0-9]{1,}.[0-9]{1,}$ ]] && ipset -! add ${banset} ${ip} timeout $banttl
|
|
|
|
|
+ done < $tmp
|
|
|
|
|
+fi
|