Fix GeoIP.sh

This commit is contained in:
Patrick Uiterwijk 2014-12-07 03:54:36 +00:00
parent 8bca4a52c4
commit 5046b0c5ed

View file

@ -21,11 +21,9 @@ do
echo "acl \"$c\" {"
grep "^$c," cbe.csv | awk -F , 'function s(b,e,l,m,n) {l = int(log(e-b+1)/log(2)); m = 2^32-2^l; n = and(m,e); if (n == and(m,b)) printf "\t%u.%u.%u.%u/%u;\n",b/2^24%256,b/2^16%256,b/2^8%256,b%256,32-l; else {s(b,n-1); s(n,e)}} s($2,$3)'
echo -e "};\n"
done) > etc/GeoIP.acl
done) > /var/named/GeoIP.acl
rm -f cbe.csv
/etc/init.d/named reload > /dev/null
exit 0