Update mw.tpl

pull/504/head
Mr Chen 1 year ago
parent f9459089a4
commit b1fbdf8d60
  1. 5
      scripts/init.d/mw.tpl

@ -217,10 +217,11 @@ error_logs()
mw_update() mw_update()
{ {
LOCAL_ADDR=common LOCAL_ADDR=common
ping -c 1 github.com > /dev/null 2>&1 cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
if [ "$?" != "0" ];then if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then
LOCAL_ADDR=cn LOCAL_ADDR=cn
fi fi
if [ "$LOCAL_ADDR" == "common" ];then if [ "$LOCAL_ADDR" == "common" ];then
curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/update.sh | bash curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/update.sh | bash
else else

Loading…
Cancel
Save