diff --git a/class/core/common.py b/class/core/common.py index 9cd1a5a45..4f3ee753e 100755 --- a/class/core/common.py +++ b/class/core/common.py @@ -66,9 +66,9 @@ def initDB(): def initDBSshPort(): # SSH端口必须放开 import firewall_api - ssh_port = mw.execShell( + cmd_data = mw.execShell( "cat /etc/ssh/sshd_config | grep 'Port \d*' | tail -1") - ssh_port = ssh_port.replace("Port ", '') + ssh_port = cmd_data[0].replace("Port ", '') if ssh_port == '': firewall_api.firewall_api().addAcceptPortArgs(22, 'SSH远程管理服务', 'port')