From cf863662e07fd6174502a1d21844fcdba36b2f84 Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 23 Sep 2022 17:09:44 +0800 Subject: [PATCH] Update mw.py --- class/core/mw.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/class/core/mw.py b/class/core/mw.py index efde194ed..81d892da7 100755 --- a/class/core/mw.py +++ b/class/core/mw.py @@ -418,6 +418,18 @@ def backFile(self, file, act=None): execShell("/usr/bin/cp -p {0} {1}".format(file, file + file_type)) +def restoreFile(self, file, act=None): + """ + @name 还原配置文件 + @param file 需要还原的文件 + @param act 如果存在,则还原默认配置 + """ + file_type = "_bak" + if act: + file_type = "_def" + execShell("/usr/bin/cp -p {1} {0}".format(file, file + file_type)) + + def HttpGet(url, timeout=10): """ 发送GET请求