#!/bin/bash
curl -s "http://www.projecthoneypot.org/list_of_ips.php?t=d&rss=1"  | grep -Eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | sed -e 's/^/add bl-honeypot /' > /tmp/bl-honeypot

ipset flush bl-honeypot
ipset restore -file /tmp/bl-honeypot

echo '<?xml version="1.0" encoding="utf-8"?>' > /etc/firewalld/ipsets/bl-honeypot.xml
echo '<ipset type="hash:ip">' >> /etc/firewalld/ipsets/bl-honeypot.xml
awk '$0="<entry>"$3"</entry>"' /tmp/bl-honeypot >> /etc/firewalld/ipsets/bl-honeypot.xml
echo '</ipset>' >> /etc/firewalld/ipsets/bl-honeypot.xml
