Update tools.py

pull/267/head
midoks 3 years ago
parent 9fd85009ae
commit 11c40cf490
  1. 9
      tools.py

@ -55,6 +55,7 @@ def mwcli(mw_input=0):
print("(11) 修改面板密码") print("(11) 修改面板密码")
print("(12) 修改面板用户名") print("(12) 修改面板用户名")
print("(13) 显示面板错误日志") print("(13) 显示面板错误日志")
print("(20) 关闭BasicAuth认证")
print("(0) 取消") print("(0) 取消")
print(raw_tip) print(raw_tip)
try: try:
@ -64,7 +65,7 @@ def mwcli(mw_input=0):
except: except:
mw_input = 0 mw_input = 0
nums = [1, 2, 3, 4, 5, 10, 11, 12, 13] nums = [1, 2, 3, 4, 5, 10, 11, 12, 1320]
if not mw_input in nums: if not mw_input in nums:
print(raw_tip) print(raw_tip)
print("已取消!") print("已取消!")
@ -102,6 +103,12 @@ def mwcli(mw_input=0):
set_panel_username(input_user.strip()) set_panel_username(input_user.strip())
elif mw_input == 13: elif mw_input == 13:
os.system('tail -100 ' + mw.getRunDir() + '/logs/error.log') 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): def set_panel_pwd(password, ncli=False):

Loading…
Cancel
Save