mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Update yunohost_firewall.py
Reload ok
This commit is contained in:
parent
bb2d57c889
commit
5100abbdcc
1 changed files with 4 additions and 4 deletions
|
@ -61,10 +61,10 @@ def firewall_reload():
|
|||
firewall = yaml.load(f)
|
||||
listPortTCP=firewall['ipv4']["TCP"]
|
||||
listPortUDP=firewall['ipv4']["UDP"]
|
||||
for port in enumerate (listPortTCP):
|
||||
os.system ("iptables -A INPUT -p tcp -i eth0 --dport "+ port +" -j ACCEPT")
|
||||
for port in enumerate (listPortUDP):
|
||||
os.system ("iptables -A INPUT -p udp -i eth0 --dport "+ port +" -j ACCEPT")
|
||||
for i,port in enumerate (listPortTCP):
|
||||
os.system ("iptables -A INPUT -p tcp -i eth0 --dport "+ str(port) +" -j ACCEPT")
|
||||
for i,port in enumerate (listPortUDP):
|
||||
os.system ("iptables -A INPUT -p udp -i eth0 --dport "+ str(port) +" -j ACCEPT")
|
||||
os.system ("iptables -P INPUT DROP")
|
||||
|
||||
def append_port(port=None,protocol=None):
|
||||
|
|
Loading…
Reference in a new issue