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

@ -277,6 +277,14 @@ def getServerIp():
print(ip[0]) print(ip[0])
def getPanelSslType():
scheme = 'http'
panel_ssl = thisdb.getOptionByJson('panel_ssl', default={'open':False})
if panel_ssl['open']:
scheme = 'https'
return scheme
def main(): def main():
if len(sys.argv) == 1: if len(sys.argv) == 1:
print('ERROR: Parameter error!') print('ERROR: Parameter error!')
@ -297,6 +305,8 @@ def main():
show_panel_adminpath() show_panel_adminpath()
elif method == 'getServerIp': elif method == 'getServerIp':
getServerIp() getServerIp()
elif method == 'panel_ssl_type':
print(getPanelSslType())
elif method == "cli": elif method == "cli":
clinum = 0 clinum = 0
try: try:

@ -521,11 +521,7 @@ mw_clean_lib(){
mw_default(){ mw_default(){
cd ${PANEL_DIR} cd ${PANEL_DIR}
port=7200 port=7200
scheme=http scheme=$(python3 ${PANEL_DIR}/panel_tools.py panel_ssl_type)
if [ -f ${PANEL_DIR}/ssl/choose.pl ];then
scheme=https
fi
if [ -f ${PANEL_DIR}/data/port.pl ];then if [ -f ${PANEL_DIR}/data/port.pl ];then
port=$(cat ${PANEL_DIR}/data/port.pl) port=$(cat ${PANEL_DIR}/data/port.pl)

Loading…
Cancel
Save