|
|
@ -196,32 +196,44 @@ error_logs() |
|
|
|
|
|
|
|
|
|
|
|
mw_update() |
|
|
|
mw_update() |
|
|
|
{ |
|
|
|
{ |
|
|
|
cn=$(curl --insecure -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"") |
|
|
|
LOCAL_ADDR=common |
|
|
|
if [ ! -z "$cn" ];then |
|
|
|
ping -c 1 github.com > /dev/null 2>&1 |
|
|
|
curl --insecure -fsSL https://cdn.jsdelivr.net/gh/midoks/mdserver-web@latest/scripts/update.sh | bash |
|
|
|
if [ "$?" != "0" ];then |
|
|
|
else |
|
|
|
LOCAL_ADDR=cn |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
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 |
|
|
|
|
|
|
|
curl --insecure -fsSL https://gitee.com/midoks/mdserver-web/raw/master/scripts/install.sh | bash |
|
|
|
fi |
|
|
|
fi |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
mw_update_dev() |
|
|
|
mw_update_dev() |
|
|
|
{ |
|
|
|
{ |
|
|
|
cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"") |
|
|
|
LOCAL_ADDR=common |
|
|
|
if [ ! -z "$cn" ];then |
|
|
|
ping -c 1 github.com > /dev/null 2>&1 |
|
|
|
curl --insecure -fsSL https://gitee.com/midoks/mdserver-web/raw/dev/scripts/update_dev.sh | bash |
|
|
|
if [ "$?" != "0" ];then |
|
|
|
else |
|
|
|
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 |
|
|
|
curl --insecure -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/update_dev.sh | bash |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
curl --insecure -fsSL https://gitee.com/midoks/mdserver-web/raw/dev/scripts/update_dev.sh | bash |
|
|
|
fi |
|
|
|
fi |
|
|
|
cd /www/server/mdserver-web |
|
|
|
cd /www/server/mdserver-web |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
mw_mirror() |
|
|
|
mw_mirror() |
|
|
|
{ |
|
|
|
{ |
|
|
|
cn=$(curl --insecure -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"") |
|
|
|
LOCAL_ADDR=common |
|
|
|
if [ ! -z "$cn" ];then |
|
|
|
ping -c 1 github.com > /dev/null 2>&1 |
|
|
|
bash <(curl --insecure -sSL https://gitee.com/SuperManito/LinuxMirrors/raw/main/ChangeMirrors.sh) |
|
|
|
if [ "$?" != "0" ];then |
|
|
|
else |
|
|
|
LOCAL_ADDR=cn |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
if [ "$LOCAL_ADDR" == "common" ];then |
|
|
|
bash <(curl --insecure -sSL https://raw.githubusercontent.com/midoks/change-linux-mirrors/main/change-mirrors.sh) |
|
|
|
bash <(curl --insecure -sSL https://raw.githubusercontent.com/midoks/change-linux-mirrors/main/change-mirrors.sh) |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
bash <(curl --insecure -sSL https://gitee.com/SuperManito/LinuxMirrors/raw/main/ChangeMirrors.sh) |
|
|
|
fi |
|
|
|
fi |
|
|
|
cd /www/server/mdserver-web |
|
|
|
cd /www/server/mdserver-web |
|
|
|
} |
|
|
|
} |
|
|
|