mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Update yunohost_firewall.py
Bug fix(call reload from web)
This commit is contained in:
parent
6c5c4dea37
commit
d1e562de77
1 changed files with 5 additions and 4 deletions
|
@ -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()
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue