|
|
@ -55,8 +55,17 @@ else |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"") |
|
|
|
# cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"") |
|
|
|
if [ ! -z "$cn" ];then |
|
|
|
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 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ "$LOCAL_ADDR" != "common" ];then |
|
|
|
curl -sSLo /tmp/master.zip https://gitee.com/midoks/mdserver-web/repository/archive/master.zip |
|
|
|
curl -sSLo /tmp/master.zip https://gitee.com/midoks/mdserver-web/repository/archive/master.zip |
|
|
|
else |
|
|
|
else |
|
|
|
curl -sSLo /tmp/master.zip https://codeload.github.com/midoks/mdserver-web/zip/master |
|
|
|
curl -sSLo /tmp/master.zip https://codeload.github.com/midoks/mdserver-web/zip/master |
|
|
|