#!/bin/sh DATA=/usr/src/xtables-addons-2.6/geoip/GeoIPCountryWhois.csv IPT=/sbin/iptables cd /usr/src/xtables-addons-2.6/geoip/ /usr/src/xtables-addons-2.6/geoip/xt_geoip_dl for IPRANGE in `egrep "Korea" $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 ACCEPT done /sbin/iptables -P INPUT DROP