From 9b1552269b40b9855b84c01a553d0fc6b3f03cfe Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Fri, 1 Nov 2024 18:30:50 +0800 Subject: [PATCH] update --- panel_tools.py | 6 ++++++ scripts/init.d/mw.tpl | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/panel_tools.py b/panel_tools.py index eedf44b38..a0e46a1f7 100755 --- a/panel_tools.py +++ b/panel_tools.py @@ -245,6 +245,10 @@ def show_panel_pwd(): return print("password has been changed!") +def show_panel_adminpath(): + admin_path = model.getOption('admin_path') + print(admin_path) + def set_panel_username(username=None): # 随机面板用户名 @@ -290,6 +294,8 @@ def main(): set_panel_username() elif method == 'password': show_panel_pwd() + elif method == 'admin_path': + show_panel_adminpath() elif method == 'getServerIp': getServerIp() elif method == "cli": diff --git a/scripts/init.d/mw.tpl b/scripts/init.d/mw.tpl index b2830cb77..cfea01021 100755 --- a/scripts/init.d/mw.tpl +++ b/scripts/init.d/mw.tpl @@ -522,12 +522,12 @@ mw_default(){ fi password=$(cat ${PANEL_DIR}/data/default.pl) + if [ -f ${PANEL_DIR}/data/domain.conf ];then address=$(cat ${PANEL_DIR}/data/domain.conf) fi - if [ -f ${PANEL_DIR}/data/admin_path.pl ];then - auth_path=$(cat ${PANEL_DIR}/data/admin_path.pl) - fi + + admin_path=$(python3 ${PANEL_DIR}/panel_tools.py admin_path) if [ "$address" == "" ];then v4=$(python3 ${PANEL_DIR}/panel_tools.py getServerIp 4)