#!/bin/sh DATA=/usr/src/xtables-addons-2.5/geoip/GeoIPCountryWhois.csv IPT=/sbin/iptables cd /usr/src/xtables-addons-2.5/geoip/ /usr/src/xtables-addons-2.5/geoip/xt_geoip_dl for IPRANGE in `egrep "China" $DATA | cut -d, -f1,2 | sed -e 's/"//g' | sed -e 's/,/-/g'` do $IPT -A INPUT -p all -m iprange --src-range $IPRANGE -j DROP done