我想从 csv 文件生成 geoiplist.acl 文件。acl 文件格式:
acl "A1" {
31.14.133.39/32;
37.221.172.0/23;
acl "A2" {
5.145.149.142/32;
57.72.6.0/24;
......
csv 文件:http: //download.db-ip.com/free/dbip-country-2016-09.csv.gz
以下是来自 CSV 文件的示例行,其中包含 IP_Start、IP_End 和 Country 列。
"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"
我从这里得到了一些参考:http: //geoip.site/但他们的 acl 没有完整的列表。
请任何人都可以帮助我在 bash 代码中执行此操作。提前致谢。