Update lib.sh

pull/420/head
midoks 2 years ago
parent 21e9d8f2d8
commit 78d8fa7ebf
  1. 15
      scripts/lib.sh

@ -57,16 +57,21 @@ else
fi
# 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 ipinfo.io > /dev/null 2>&1
if [ "$?" == "0" ];then
CN=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"")
if [ ! -z "$CN" ];then
if [ ! -z "$cn" ];then
LOCAL_ADDR=cn
HTTP_PREFIX="https://ghproxy.com/"
fi
fi
PIPSRC="https://pypi.python.org/simple"
if [ "$LOCAL_ADDR" != "common" ];then

Loading…
Cancel
Save