Update yunohost_firewall.py

Reload ok
This commit is contained in:
titoko 2012-12-12 11:50:07 +01:00
parent bb2d57c889
commit 5100abbdcc

View file

@ -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):