获取地区ip数据

1
2
3
4
#!/bin/bash
wget -c http://ftp.apnic.net/stats/apnic/delegated-apnic-latest
cat delegated-apnic-latest | awk -F '|' '/HK/&&/ipv4/ {print $4 "/" 32-log($5)/log(2)}' | cat > ipv4-hk.txt
cat delegated-apnic-latest | awk -F '|' '/SG/&&/ipv4/ {print $4 "/" 32-log($5)/log(2)}' | cat > ipv4-sg.txt