From 11c40cf490a972ebab88ecbd472090fa6391ae2c Mon Sep 17 00:00:00 2001 From: midoks Date: Sun, 20 Nov 2022 15:04:45 +0800 Subject: [PATCH] Update tools.py --- tools.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools.py b/tools.py index 9ce82d2f3..efdc31ae3 100755 --- a/tools.py +++ b/tools.py @@ -55,6 +55,7 @@ def mwcli(mw_input=0): print("(11) 修改面板密码") print("(12) 修改面板用户名") print("(13) 显示面板错误日志") + print("(20) 关闭BasicAuth认证") print("(0) 取消") print(raw_tip) try: @@ -64,7 +65,7 @@ def mwcli(mw_input=0): except: mw_input = 0 - nums = [1, 2, 3, 4, 5, 10, 11, 12, 13] + nums = [1, 2, 3, 4, 5, 10, 11, 12, 13,20] if not mw_input in nums: print(raw_tip) print("已取消!") @@ -102,6 +103,12 @@ def mwcli(mw_input=0): set_panel_username(input_user.strip()) elif mw_input == 13: os.system('tail -100 ' + mw.getRunDir() + '/logs/error.log') + elif mw_input == 20: + basic_auth = 'data/basic_auth.json' + if os.path.exists(basic_auth): + os.remove(basic_auth) + os.system(INIT_CMD + " restart") + os.system(INIT_CMD + " default") def set_panel_pwd(password, ncli=False):