windows: 使用 cloudflare 判断是否国内

This commit is contained in:
bin456789 2023-07-22 21:48:59 +08:00
parent 990a8d4855
commit 771adae569
No known key found for this signature in database
GPG Key ID: EE301B386DE6C11B

View File

@ -22,8 +22,8 @@ set tags=%tmp%\cygwin-installed-!pkgs!
if not exist !tags! (
:: 检查是否国内
:: 在括号里面,:: 下一行不能是空行!!!!!
call :download http://geoip.fedoraproject.org/city %tmp%\geoip "Check Location"
findstr CHN %tmp%\geoip >nul
call :download http://www.cloudflare.com/cdn-cgi/trace %tmp%\geoip "Check Location"
findstr "loc=CN" %tmp%\geoip >nul
if !errorlevel! == 0 (
set host=http://mirror.nju.edu.cn
) else (