Created
January 30, 2016 15:21
-
-
Save yrousse/95a72b4dbbebf12fbf63 to your computer and use it in GitHub Desktop.
spamhaus and dshield drop lists to shorewall blrules simple script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo "#From dshield.org" > /tmp/blacklist | |
wget -q -O - http://feeds.dshield.org/block.txt | awk '/^[0-9]/ { print "DROP", "net:"$1"/24", "all"}' >> /tmp/blacklist | |
echo "#From spamhaus.org" >> /tmp/blacklist | |
wget -q -O - http://www.spamhaus.org/drop/drop.lasso | awk '/^[0-9]/ { print "DROP", "net:"$1, "all"}' >> /tmp/blacklist | |
mv /tmp/blacklist /etc/shorewall/blrules | |
shorewall refresh &>/dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Make it executable with chmod +x update_blrules.sh
And have it in a cron job for scheduled updates. For a SoHo firewall, once a day seems enough.