统一修改国家和地区的判断方式

This commit is contained in:
CN-JS-HuiBai
2026-02-08 23:13:25 +08:00
parent c62f84b4a6
commit 9db967e5a7
5 changed files with 9 additions and 21 deletions

View File

@@ -27,13 +27,11 @@ TARGET="/tmp/prometheus-3.9.1.linux-amd64.tar.gz"
is_cn=false
echo "Detecting geographic location..."
COUNTRY=$(curl -s --max-time 5 https://ipinfo.littlediary.cn/info | grep -o '"countryName":"[^"]*"' | cut -d'"' -f4)
COUNTRY=$(curl -s --max-time 3 https://ipinfo.io/country || true)
if [ "$COUNTRY" = "CN" ]; then
if [ "$COUNTRY" = "China" ]; then
is_cn=true
fi
if [ "$is_cn" = true ]; then
echo "Geolocation: China mainland detected"
DOWNLOAD_URL="$CN_URL"