#!/bin/sh
ipset -N blockedcountries hash:net

rm cn.zone
rm in.zone
rm ru.zone

wget -P . http://www.ipdeny.com/ipblocks/data/countries/cn.zone
wget -P . http://www.ipdeny.com/ipblocks/data/countries/ru.zone
wget -P . http://www.ipdeny.com/ipblocks/data/countries/in.zone

for i in $(cat cn.zone in.zone ru.zone ); do ipset -A blockedcountries $i; done

/usr/sbin/iptables-restore < /etc/iptables.firewall.rules
