From ded33ed6b4a18e764bf0ab75bdee49df3d4eb2f1 Mon Sep 17 00:00:00 2001 From: midoks Date: Sat, 9 Sep 2023 11:55:40 +0800 Subject: [PATCH] update --- scripts/update.sh | 7 +++---- scripts/update_dev.sh | 5 ++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/scripts/update.sh b/scripts/update.sh index bd20683a7..d4aaf74c8 100755 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -55,13 +55,12 @@ else fi -# cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"") HTTP_PREFIX="https://" LOCAL_ADDR=common -ping -c 1 github.com > /dev/null 2>&1 -if [ "$?" != "0" ];then +cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"") +if [ ! -z "$cn" ] || [ "$?" != "0" ] ;then LOCAL_ADDR=cn - HTTP_PREFIX="https://ghproxy.com/" + HTTP_PREFIX="https://ghproxy.com/" fi diff --git a/scripts/update_dev.sh b/scripts/update_dev.sh index 2ba251abc..3f027c4c0 100755 --- a/scripts/update_dev.sh +++ b/scripts/update_dev.sh @@ -61,11 +61,10 @@ fi # LOCAL_ADDR=cn # HTTP_PREFIX="https://ghproxy.com/" # fi - -cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"") HTTP_PREFIX="https://" LOCAL_ADDR=common -if [ ! -z "$cn" ];then +cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"") +if [ ! -z "$cn" ] || [ "$?" != "0" ] ;then LOCAL_ADDR=cn HTTP_PREFIX="https://ghproxy.com/" fi