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