pull/632/head
Mr Chen 5 months ago
parent 404a38d990
commit 6088386e51
  1. 10
      panel_tools.py
  2. 5
      scripts/init.d/mw.tpl

@ -274,7 +274,8 @@ def getServerIp():
# "curl --insecure -{} -sS --connect-timeout 5 -m 60 https://v6r.ipip.net/?format=text".format(version)) # "curl --insecure -{} -sS --connect-timeout 5 -m 60 https://v6r.ipip.net/?format=text".format(version))
ip = mw.execShell( ip = mw.execShell(
"curl --insecure -{} -sS --connect-timeout 5 -m 60 https://ip.cachecha.com/?format=text".format(version)) "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(): def getPanelSslType():
@ -284,6 +285,9 @@ def getPanelSslType():
scheme = 'https' scheme = 'https'
return scheme return scheme
def getPanelBindDomain():
return thisdb.getOption('panel_domain', default='')
def main(): def main():
if len(sys.argv) == 1: if len(sys.argv) == 1:
@ -304,9 +308,11 @@ def main():
elif method == 'admin_path': elif method == 'admin_path':
show_panel_adminpath() show_panel_adminpath()
elif method == 'getServerIp': elif method == 'getServerIp':
getServerIp() print(getServerIp())
elif method == 'panel_ssl_type': elif method == 'panel_ssl_type':
print(getPanelSslType()) print(getPanelSslType())
elif method == 'panel_bind_domain':
print(getPanelBindDomain())
elif method == "cli": elif method == "cli":
clinum = 0 clinum = 0
try: try:

@ -534,9 +534,8 @@ mw_default(){
password=$(cat ${PANEL_DIR}/data/default.pl) password=$(cat ${PANEL_DIR}/data/default.pl)
if [ -f ${PANEL_DIR}/data/domain.conf ];then panel_bind_domain=$(python3 ${PANEL_DIR}/panel_tools.py panel_bind_domain)
address=$(cat ${PANEL_DIR}/data/domain.conf) print(panel_bind_domain)
fi
admin_path=$(cd ${PANEL_DIR} && python3 ${PANEL_DIR}/panel_tools.py admin_path) admin_path=$(cd ${PANEL_DIR} && python3 ${PANEL_DIR}/panel_tools.py admin_path)
if [ "$address" == "" ];then if [ "$address" == "" ];then

Loading…
Cancel
Save