Update tools.py
This commit is contained in:
parent
9fd85009ae
commit
11c40cf490
9
tools.py
9
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):
|
||||
|
|
|
|||
Loading…
Reference in New Issue