diff --git a/plugins/php/lib/icu.sh b/plugins/php/lib/icu.sh index 42802fdf2..f988c4c88 100644 --- a/plugins/php/lib/icu.sh +++ b/plugins/php/lib/icu.sh @@ -13,9 +13,9 @@ rootPath=$(dirname "$rootPath") SERVER_ROOT=$rootPath/lib SOURCE_ROOT=$rootPath/source/lib -cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"") HTTP_PREFIX="https://" -if [ ! -z "$cn" ];then +cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"") +if [ ! -z "$cn" ] || [ "$?" != "0" ] ;then HTTP_PREFIX="https://ghproxy.com/" fi diff --git a/plugins/php/lib/libiconv.sh b/plugins/php/lib/libiconv.sh index b5316b310..ce08d77f7 100644 --- a/plugins/php/lib/libiconv.sh +++ b/plugins/php/lib/libiconv.sh @@ -13,9 +13,9 @@ rootPath=$(dirname "$rootPath") SERVER_ROOT=$rootPath/lib SOURCE_ROOT=$rootPath/source/lib -cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"") HTTP_PREFIX="https://" -if [ ! -z "$cn" ];then +cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"") +if [ ! -z "$cn" ] || [ "$?" != "0" ] ;then HTTP_PREFIX="https://ghproxy.com/" fi diff --git a/plugins/php/lib/libzip.sh b/plugins/php/lib/libzip.sh index 688d4f99b..fca760d12 100644 --- a/plugins/php/lib/libzip.sh +++ b/plugins/php/lib/libzip.sh @@ -14,9 +14,9 @@ SERVER_ROOT=$rootPath/lib SOURCE_ROOT=$rootPath/source/lib -cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"") HTTP_PREFIX="https://" -if [ ! -z "$cn" ];then +cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"") +if [ ! -z "$cn" ] || [ "$?" != "0" ] ;then HTTP_PREFIX="https://ghproxy.com/" fi diff --git a/plugins/php/lib/oniguruma.sh b/plugins/php/lib/oniguruma.sh index 3c04b4c08..100d2d109 100644 --- a/plugins/php/lib/oniguruma.sh +++ b/plugins/php/lib/oniguruma.sh @@ -13,9 +13,9 @@ rootPath=$(dirname "$rootPath") SERVER_ROOT=$rootPath/lib SOURCE_ROOT=$rootPath/source/lib -cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"") HTTP_PREFIX="https://" -if [ ! -z "$cn" ];then +cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"") +if [ ! -z "$cn" ] || [ "$?" != "0" ] ;then HTTP_PREFIX="https://ghproxy.com/" fi diff --git a/plugins/php/lib/openssl_10.sh b/plugins/php/lib/openssl_10.sh index d39a6b46e..49918c0f6 100644 --- a/plugins/php/lib/openssl_10.sh +++ b/plugins/php/lib/openssl_10.sh @@ -13,9 +13,9 @@ rootPath=$(dirname "$rootPath") SERVER_ROOT=$rootPath/lib SOURCE_ROOT=$rootPath/source/lib -cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"") HTTP_PREFIX="https://" -if [ ! -z "$cn" ];then +cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"") +if [ ! -z "$cn" ] || [ "$?" != "0" ] ;then HTTP_PREFIX="https://ghproxy.com/" fi diff --git a/plugins/php/lib/zlib.sh b/plugins/php/lib/zlib.sh index f248192b5..e3b45c1cd 100644 --- a/plugins/php/lib/zlib.sh +++ b/plugins/php/lib/zlib.sh @@ -13,9 +13,9 @@ rootPath=$(dirname "$rootPath") SERVER_ROOT=$rootPath/lib SOURCE_ROOT=$rootPath/source/lib -cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"") HTTP_PREFIX="https://" -if [ ! -z "$cn" ];then +cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"") +if [ ! -z "$cn" ] || [ "$?" != "0" ] ;then HTTP_PREFIX="https://ghproxy.com/" fi