Fix GeoIP.sh
This commit is contained in:
parent
8bca4a52c4
commit
5046b0c5ed
1 changed files with 1 additions and 3 deletions
|
@ -21,11 +21,9 @@ do
|
||||||
echo "acl \"$c\" {"
|
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)'
|
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"
|
echo -e "};\n"
|
||||||
done) > etc/GeoIP.acl
|
done) > /var/named/GeoIP.acl
|
||||||
|
|
||||||
rm -f cbe.csv
|
rm -f cbe.csv
|
||||||
|
|
||||||
/etc/init.d/named reload > /dev/null
|
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue