|
|
|
@ -365,16 +365,15 @@ class firewall_api: |
|
|
|
|
def addAcceptPort(self, port): |
|
|
|
|
if self.__isUfw: |
|
|
|
|
mw.execShell('ufw allow ' + port + '/tcp') |
|
|
|
|
elif self.__isFirewalld: |
|
|
|
|
port = port.replace(':', '-') |
|
|
|
|
cmd = 'firewall-cmd --permanent --zone=public --add-port=' + port + '/tcp' |
|
|
|
|
mw.execShell(cmd) |
|
|
|
|
elif self.__isMac: |
|
|
|
|
pass |
|
|
|
|
else: |
|
|
|
|
if self.__isFirewalld: |
|
|
|
|
port = port.replace(':', '-') |
|
|
|
|
cmd = 'firewall-cmd --permanent --zone=public --add-port=' + port + '/tcp' |
|
|
|
|
mw.execShell(cmd) |
|
|
|
|
elif self.__isMac: |
|
|
|
|
pass |
|
|
|
|
else: |
|
|
|
|
cmd = 'iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport ' + port + ' -j ACCEPT' |
|
|
|
|
mw.execShell(cmd) |
|
|
|
|
cmd = 'iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport ' + port + ' -j ACCEPT' |
|
|
|
|
mw.execShell(cmd) |
|
|
|
|
|
|
|
|
|
def firewallReload(self): |
|
|
|
|
if self.__isUfw: |
|
|
|
|