From 1d74935ebd649f3b9a8070606523c429f01fb571 Mon Sep 17 00:00:00 2001 From: CN-JS-HuiBai Date: Sun, 8 Feb 2026 23:07:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95LDNET-API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Prometheus/install_node_exporter_arm64.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Prometheus/install_node_exporter_arm64.sh b/Prometheus/install_node_exporter_arm64.sh index 43c44f4..d10d108 100644 --- a/Prometheus/install_node_exporter_arm64.sh +++ b/Prometheus/install_node_exporter_arm64.sh @@ -27,8 +27,10 @@ TARGET="/tmp/node_exporter.tar.gz" is_cn=false echo "Detecting geographic location..." +API_URL="https://ipinfo.littlediary.cn/info" +JSON=$(curl -s --max-time 5 "$API_URL") +COUNTRY=$(echo "$JSON" | grep -o '"country":"[^"]*"' | cut -d'"' -f4) -COUNTRY=$(curl -s --max-time 3 https://ipinfo.io/country || true) if [ "$COUNTRY" = "CN" ]; then is_cn=true fi