From d1e562de77d3875151e9516f4f025a21b58572c8 Mon Sep 17 00:00:00 2001 From: titoko Date: Thu, 13 Dec 2012 10:58:49 +0100 Subject: [PATCH] Update yunohost_firewall.py Bug fix(call reload from web) --- yunohost_firewall.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/yunohost_firewall.py b/yunohost_firewall.py index 3dca6fe4..7369413e 100644 --- a/yunohost_firewall.py +++ b/yunohost_firewall.py @@ -118,22 +118,23 @@ def firewall_reload(): for i,port in enumerate (firewall['ipv4']['TCP']): os.system ("iptables -A INPUT -p tcp -i eth0 --dport "+ str(port) +" -j ACCEPT") - print("Port "+str(port)+" on protocol TCP with ipv4 Open") + for i,port in enumerate (firewall['ipv4']['UDP']): os.system ("iptables -A INPUT -p udp -i eth0 --dport "+ str(port) +" -j ACCEPT") - print("Port "+str(port)+" on protocol UDP with ipv4 Open") + for i,port in enumerate (firewall['ipv6']['TCP']): os.system ("ip6tables -A INPUT -p tcp -i eth0 --dport "+ str(port) +" -j ACCEPT") - print("Port "+str(port)+" on protocol TCP with ipv6 Open") + for i,port in enumerate (firewall['ipv6']['UDP']): os.system ("ip6tables -A INPUT -p udp -i eth0 --dport "+ str(port) +" -j ACCEPT") - print("Port "+str(port)+" on protocol UDP with ipv6 Open") + os.system ("iptables -P INPUT DROP") os.system ("ip6tables -P INPUT DROP") + firewall_list()