Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- [ -z "$1" ] && echo "Usage: $0 <country_code> [<target (default: ACCEPT)>]" && exit
- target=ACCEPT
- [ -z "$2" ] || target=$2
- ( echo "*filter"
- GET "http://ipdeny.com/ipblocks/data/aggregated/$1-aggregated.zone" | while read i ; do
- echo "-I INPUT 1 -s $i -j $target"
- done
- echo "COMMIT" ) | iptables-restore
- # Monitor with: iptables -vnL | egrep -A 1 "INPUT|ACCEPT.*\*" | grep -v "^ 0 0"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement