Skip to content

Commit

Permalink
Update firewall.py
Browse files Browse the repository at this point in the history
  • Loading branch information
midoks committed Dec 24, 2024
1 parent 0a1251a commit 0b47b56
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions web/utils/firewall.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,12 +261,12 @@ def setSshPort(self, port):
rep = r"#*Port\s+([0-9]+)\s*\n"
conf = re.sub(rep, "Port " + port + "\n", conf)
mw.writeFile(file, conf)

self.addAcceptPort(port, 'SSH端口修改', 'port')
self.reload()

if not self.reloadSshd():
return mw.returnData(False, '重启sshd失败,尝试手动重启:service ssh restart!')

self.addAcceptPort(port, 'SSH端口修改', 'port')
self.reload()
return mw.returnData(True, '修改成功!')

def setFw(self, status):
Expand Down

0 comments on commit 0b47b56

Please sign in to comment.