diff --git a/scripts/init.d/mw.tpl b/scripts/init.d/mw.tpl index 346eea6cd..b7f955fcb 100755 --- a/scripts/init.d/mw.tpl +++ b/scripts/init.d/mw.tpl @@ -231,10 +231,11 @@ mw_update() mw_update_dev() { LOCAL_ADDR=common - ping -c 1 github.com > /dev/null 2>&1 - if [ "$?" != "0" ];then + cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"") + if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then LOCAL_ADDR=cn fi + if [ "$LOCAL_ADDR" == "common" ];then curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/update_dev.sh | bash else