From 6088386e51950c9298baf66e9a826b0af8dd58c5 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sun, 1 Dec 2024 20:47:39 +0800 Subject: [PATCH] update --- panel_tools.py | 10 ++++++++-- scripts/init.d/mw.tpl | 5 ++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/panel_tools.py b/panel_tools.py index f8bd22402..b766c60f7 100755 --- a/panel_tools.py +++ b/panel_tools.py @@ -274,7 +274,8 @@ def getServerIp(): # "curl --insecure -{} -sS --connect-timeout 5 -m 60 https://v6r.ipip.net/?format=text".format(version)) ip = mw.execShell( "curl --insecure -{} -sS --connect-timeout 5 -m 60 https://ip.cachecha.com/?format=text".format(version)) - print(ip[0]) + # print(ip[0]) + return ip[0] def getPanelSslType(): @@ -284,6 +285,9 @@ def getPanelSslType(): scheme = 'https' return scheme +def getPanelBindDomain(): + return thisdb.getOption('panel_domain', default='') + def main(): if len(sys.argv) == 1: @@ -304,9 +308,11 @@ def main(): elif method == 'admin_path': show_panel_adminpath() elif method == 'getServerIp': - getServerIp() + print(getServerIp()) elif method == 'panel_ssl_type': print(getPanelSslType()) + elif method == 'panel_bind_domain': + print(getPanelBindDomain()) elif method == "cli": clinum = 0 try: diff --git a/scripts/init.d/mw.tpl b/scripts/init.d/mw.tpl index c6868db1c..05decb89b 100755 --- a/scripts/init.d/mw.tpl +++ b/scripts/init.d/mw.tpl @@ -534,9 +534,8 @@ mw_default(){ password=$(cat ${PANEL_DIR}/data/default.pl) - if [ -f ${PANEL_DIR}/data/domain.conf ];then - address=$(cat ${PANEL_DIR}/data/domain.conf) - fi + panel_bind_domain=$(python3 ${PANEL_DIR}/panel_tools.py panel_bind_domain) + print(panel_bind_domain) admin_path=$(cd ${PANEL_DIR} && python3 ${PANEL_DIR}/panel_tools.py admin_path) if [ "$address" == "" ];then