I would like to generate geoiplist.acl file from a csv file. acl file format:
acl "A1" {
31.14.133.39/32;
37.221.172.0/23;
acl "A2" {
5.145.149.142/32;
57.72.6.0/24;
......
the csv file: http://download.db-ip.com/free/dbip-country-2016-09.csv.gz
Here are sample lines from CSV file with IP_Start, IP_End and Country columns.
"0.0.0.0","0.255.255.255","US"
"1.0.0.0","1.0.0.255","AU"
"1.0.1.0","1.0.3.255","CN"
"1.0.4.0","1.0.7.255","AU"
"1.0.8.0","1.0.15.255","CN"
"1.0.16.0","1.0.31.255","JP"
"1.0.32.0","1.0.63.255","CN"
"1.0.64.0","1.0.127.255","JP"
"1.0.128.0","1.0.255.255","TH"
"1.1.0.0","1.1.0.255","CN"
I got some references from here: http://geoip.site/ but their acl don't have complete list.
Anyone can help me to do this in bash code please. Thanks in advance.