From d8f42364040cd0680226b0f7d72ab1955926f352 Mon Sep 17 00:00:00 2001 From: Spetrum Date: Wed, 17 Jul 2024 21:21:04 +0800 Subject: [PATCH] Switch IP checking service to ip-api.com (#391) --- script/install.command | 4 ++-- script/install.sh | 4 ++-- script/install_en.sh | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/script/install.command b/script/install.command index 803180c..1fca989 100644 --- a/script/install.command +++ b/script/install.command @@ -28,8 +28,8 @@ pre_check() { ## China_IP if [[ -z "${CN}" ]]; then - if [[ $(curl -m 10 -s https://ipapi.co/json | grep 'China') != "" ]]; then - echo "According to the information provided by ipapi.co, the current IP may be in China" + if [[ $(curl -m 10 -s http://ip-api.com/json |grep 'country' |grep -q 'China') != "" ]]; then + echo "According to the information provided by ip-api.com, the current IP may be in China" read -e -r -p "Is the installation done with a Chinese Mirror? [Y/n] (Custom Mirror Input 3):" input case $input in [yY][eE][sS] | [yY]) diff --git a/script/install.sh b/script/install.sh index be34485..ccb7afc 100755 --- a/script/install.sh +++ b/script/install.sh @@ -66,8 +66,8 @@ pre_check() { ## China_IP if [ -z "$CN" ]; then - if curl -m 10 -s https://ipapi.co/json | grep -q 'China'; then - echo "根据ipapi.co提供的信息,当前IP可能在中国" + if curl -m 10 -s http://ip-api.com/json |grep 'country' |grep -q 'China'; then + echo "根据ip-api.com提供的信息,当前IP可能在中国" printf "是否选用中国镜像完成安装? [Y/n] (自定义镜像输入 3):" read -r input case $input in diff --git a/script/install_en.sh b/script/install_en.sh index 04eb96c..d802635 100755 --- a/script/install_en.sh +++ b/script/install_en.sh @@ -66,8 +66,8 @@ pre_check() { ## China_IP if [ -z "$CN" ]; then - if curl -m 10 -s https://ipapi.co/json | grep -q 'China'; then - echo "According to the information provided by ipapi.co, the current IP may be in China" + if curl -m 10 -s http://ip-api.com/json |grep 'country' |grep -q 'China'; then + echo "According to the information provided by ip-api.com, the current IP may be in China" printf "Will the installation be done with a Chinese Mirror? [Y/n] (Custom Mirror Input 3): " read -r input case $input in