Below is my a quick firewall blacklist update script I put together to use on some of my servers UFW on all my servers.
I have used github gists for easy managements of my blacklists.
The script is fairly easy to adapt to your own needs and you can use any blacklists that you like, just replace the links with your own.
If you use this script be sure to add a rule for ssh for the port set in your ssh configuration, usually this is port 22. You can add this in the custom rules section so that you dont get locked out.
*Update May 2020, I have since started using iptables to have greater control over my firewalls. I still use the same gist files with my new script and I will be making that one available in the coming weeks.