bunkerweb/scripts/abusers.sh

15 lines
453 B
Bash
Raw Normal View History

2020-10-04 19:07:39 +00:00
#!/bin/sh
echo "" > /etc/nginx/block-abusers.conf
curl -s "https://iplists.firehol.org/files/firehol_abusers_30d.netset" | grep -v "^\#.*" |
while read entry ; do
check=$(echo $entry | grep -E "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/?[0-9]*$")
if [ "$check" != "" ] ; then
echo "deny ${entry};" >> /etc/nginx/block-abusers.conf
fi
2020-10-04 19:07:39 +00:00
done
2020-11-15 14:43:41 +00:00
cp /etc/nginx/block-abusers.conf /cache
if [ -f /tmp/nginx.pid ] ; then
2020-10-04 19:07:39 +00:00
/usr/sbin/nginx -s reload
fi