get_cn_ipv4.cmd
del apnic_all.txt /q
wget -c -O apnic_all.txt "http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest"
del cn_ipv4.txt /q
for /f "tokens=1,* delims=|" %%a in ('type apnic_all.txt^|findstr "CN|ipv4"') do (
for /f "tokens=3,4 delims=|" %%i in ("%%b") do (echo %%i %%j>>cn_ipv4.txt)
)
whosip_all.cmd
http://www.nirsoft.net/utils/whosip.html
setlocal enabledelayedexpansion
for /f "tokens=1,* delims= " %%i in (cn_ipv4.txt) do (
for /f "tokens=1,* delims=:" %%a in ('start /B /low /wait whosip -r %%i^|findstr "mnt-by:"') do set "maint=%%b"
echo %%i %%j !maint!>>whosip_cn_all.txt
)
endlocal
build.cmd
for %%i in (unicom,chinanet,cncgroup,crtc,cernet,cstnet,gwbn,chinabtn,colnet) do (del %%i.txt
/q)
::联通
for /f "tokens=1,2,* delims= " %%a in ('type whosip_cn_all.txt^|findstr "UNICOM"') do (
echo %%a %%b>>UNICOM.txt
)
::电信
for /f "tokens=1,2,* delims= " %%a in ('type whosip_cn_all.txt^|findstr "CHINANET"') do (
echo %%a %%b>>CHINANET.txt
)
::网通
for /f "tokens=1,2,* delims= " %%a in ('type whosip_cn_all.txt^|findstr "CNCGROUP"') do (
echo %%a %%b>>CNCGROUP.txt
)
::铁通
for /f "tokens=1,2,* delims= " %%a in ('type whosip_cn_all.txt^|findstr "CRTC"') do (
echo %%a %%b>>CRTC.txt
)
::教育网
for /f "tokens=1,2,* delims= " %%a in ('type whosip_cn_all.txt^|findstr "CERNET"') do (
echo %%a %%b>>CERNET.txt
)
::中国科学网
for /f "tokens=1,2,* delims= " %%a in ('type whosip_cn_all.txt^|findstr "CSTNET"') do (
echo %%a %%b>>CSTNET.txt
)
::长宽
for /f "tokens=1,2,* delims= " %%a in ('type whosip_cn_all.txt^|findstr "GWBN"') do (
echo %%a %%b>>GWBN.txt
)
::广电
for /f "tokens=1,2,* delims= " %%a in ('type whosip_cn_all.txt^|findstr "CHINABTN"') do (
echo %%a %%b>>CHINABTN.txt
)
::有线通
for /f "tokens=1,2,* delims= " %%a in ('type whosip_cn_all.txt^|findstr "COLNET"') do (
echo %%a %%b>>COLNET.txt
)