Skip to content

Instantly share code, notes, and snippets.

@waynegraham
Last active January 30, 2024 18:11
Show Gist options
  • Save waynegraham/4dcb39501323a896decf58e45e824d32 to your computer and use it in GitHub Desktop.
Save waynegraham/4dcb39501323a896decf58e45e824d32 to your computer and use it in GitHub Desktop.
Update StopForumSpam Blocked IPs
#!/bin/bash
#
# Pull updated IPs from StopForumSpam from
# https://www.stopforumspam.com/downloads. Note that different files have
# different download limits. Generally you can download the last day hourly and
# everything else you are limited to twice daily.
#
# URL: https://github.com/waynegraham/UpdateBlockedIPs
# Author: Wayne Graham
# License: MIT
# Version: 1.0.0
set -euo pipefail
LOGGING=0
CUR_PATH=$(dirname $0)
FILE=listed_ip_30_ipv46.gz
TIMESTAMP=`date +%Y-%m-%d_%H-%M-%S`
time_stamp() {
echo $TIMESTAMP
}
printf "%s Downloading backlist from stopformspam.com..." "$(time_stamp)"
cd $CUR_PATH
wget -qN https://www.stopforumspam.com/downloads/$FILE
if ! [ -f listed_ip_30_ipv46.gz ]; then
printf "\n%s Can't download file!" "$(time_stamp)"
exit 1
else
gunzip -f $FILE
printf "\n%s Done" "$(time_stamp)"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment