diff --git a/scripts/install.sh b/scripts/install.sh index 00c72f000..d029084b8 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -56,16 +56,23 @@ else fi -# cn=$(curl --insecure -fsSL -m 10 https://ipinfo.io/json | grep "\"country\": \"CN\"") - +# HTTP_PREFIX="https://" +# LOCAL_ADDR=common +# ping -c 1 github.com > /dev/null 2>&1 +# if [ "$?" != "0" ];then +# 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 -ping -c 1 github.com > /dev/null 2>&1 -if [ "$?" != "0" ];then +if [ ! -z "$cn" ];then LOCAL_ADDR=cn - HTTP_PREFIX="https://ghproxy.com/" + HTTP_PREFIX="https://ghproxy.com/" fi + if [ $OSNAME != "macos" ];then if id www &> /dev/null ;then echo ""