Switch IP checking service to ip-api.com (#391)

This commit is contained in:
Spetrum 2024-07-17 21:21:04 +08:00 committed by GitHub
parent f95191c8af
commit d8f4236404
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 6 deletions

View File

@ -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])

View File

@ -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

View File

@ -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