mirror of
https://github.com/bin456789/reinstall.git
synced 2025-01-19 04:49:13 +08:00
core: 使用 cloudflare 判断是否国内
This commit is contained in:
parent
2bd176fd26
commit
5fae23798e
@ -34,9 +34,9 @@ curl() {
|
|||||||
|
|
||||||
is_in_china() {
|
is_in_china() {
|
||||||
if [ -z $_is_in_china ]; then
|
if [ -z $_is_in_china ]; then
|
||||||
# https://geoip.fedoraproject.org/city
|
# https://geoip.fedoraproject.org/city # 不支持 ipv6
|
||||||
# https://geoip.ubuntu.com/lookup
|
# https://geoip.ubuntu.com/lookup # 不支持 ipv6
|
||||||
curl -L https://geoip.ubuntu.com/lookup | grep -qw CHN
|
curl -L http://www.cloudflare.com/cdn-cgi/trace | grep -qx 'loc=CN'
|
||||||
_is_in_china=$?
|
_is_in_china=$?
|
||||||
fi
|
fi
|
||||||
return $_is_in_china
|
return $_is_in_china
|
||||||
|
Loading…
x
Reference in New Issue
Block a user