From 06f1b34f5219584e69ab7e408bfbbe48a93a30b6 Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 12 Aug 2022 16:35:49 +0800 Subject: [PATCH] Update system_api.py --- class/core/system_api.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/class/core/system_api.py b/class/core/system_api.py index a53465804..a64ec0a98 100755 --- a/class/core/system_api.py +++ b/class/core/system_api.py @@ -683,11 +683,19 @@ class system_api: if not os.path.exists(toPath): mw.execShell('mkdir -p ' + toPath) - mw.execShell('wget -O ' + toPath + '/mw.zip ' + newUrl) + newUrl = "https://github.com/midoks/mdserver-web/archive/refs/tags/" + version + ".zip" - mw.execShell('unzip -o ' + toPath + '/mw.zip' + ' -d ./') - mw.execShell('unzip -o mw.zip -d ./') - mw.execShell('rm -f mw.zip') + r = mw.execShell('wget -O ' + toPath + '/mw.zip ' + newUrl) + + mw.execShell('unzip -o ' + toPath + + '/mw.zip' + ' -d ' + toPath) + + cmd_cp = "cp -rf " + toPath + '/mdserver-web-' + \ + version + "/* " + mw.getRootDir() + "/mdserver-web" + + mw.execShell(cmd_cp) + mw.execShell('rm -rf ' + toPath + '/mdserver-web-' + version) + mw.execShell('rm -rf ' + toPath + '/mw.zip') self.restartMw() return mw.returnJson(True, '安装更新成功,需自己重启!')