diff --git a/scripts/install.sh b/scripts/install.sh index 85431526d..4b0607f84 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -64,10 +64,10 @@ fi # 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" ] && [ "$?" != "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/" fi diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index 87c981771..1072c3523 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -71,7 +71,7 @@ fi cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"") HTTP_PREFIX="https://" LOCAL_ADDR=common -if [ ! -z "$cn" ] && [ "$?" != "0" ];then +if [ ! -z "$cn" ] || [ "$?" != "0" ] ;then LOCAL_ADDR=cn HTTP_PREFIX="https://ghproxy.com/" fi diff --git a/scripts/lib.sh b/scripts/lib.sh index 3a017460e..bc5a5be77 100755 --- a/scripts/lib.sh +++ b/scripts/lib.sh @@ -68,7 +68,7 @@ fi cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"") HTTP_PREFIX="https://" LOCAL_ADDR=common -if [ ! -z "$cn" ] && [ "$?" != "0" ]; then +if [ ! -z "$cn" ] || [ "$?" != "0" ] ;then LOCAL_ADDR=cn HTTP_PREFIX="https://ghproxy.com/" fi