Update firewall.py
This commit is contained in:
parent
0a1251ad0b
commit
0b47b56fb5
|
|
@ -261,12 +261,12 @@ class Firewall(object):
|
|||
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):
|
||||
|
|
|
|||
Loading…
Reference in New Issue