mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Update yunohost_firewall.py
This commit is contained in:
parent
3249428894
commit
5cb92bfb5f
1 changed files with 4 additions and 2 deletions
|
@ -45,7 +45,8 @@ def firewall_allow(protocol=None,port=None,ipv6=None):
|
||||||
rule = iptables+" -A INPUT -p "+ protocol +" -i eth0 --dport "+ port +" -j ACCEPT"
|
rule = iptables+" -A INPUT -p "+ protocol +" -i eth0 --dport "+ port +" -j ACCEPT"
|
||||||
update_yml(port,protocol,'a',ip)
|
update_yml(port,protocol,'a',ip)
|
||||||
os.system(rule)
|
os.system(rule)
|
||||||
|
|
||||||
|
win_msg(_("Port successfully openned"))
|
||||||
return firewall_list()
|
return firewall_list()
|
||||||
|
|
||||||
|
|
||||||
|
@ -85,7 +86,7 @@ def firewall_disallow(protocol=None,port=None,ipv6=None):
|
||||||
rule = iptables+" -A INPUT -p "+ protocol +" -i eth0 --dport "+ port +" -j REJECT"
|
rule = iptables+" -A INPUT -p "+ protocol +" -i eth0 --dport "+ port +" -j REJECT"
|
||||||
update_yml(port,protocol,'r',ip)
|
update_yml(port,protocol,'r',ip)
|
||||||
os.system(rule)
|
os.system(rule)
|
||||||
|
win_msg(_("Port successfully closed"))
|
||||||
return firewall_list
|
return firewall_list
|
||||||
|
|
||||||
|
|
||||||
|
@ -152,6 +153,7 @@ def firewall_reload():
|
||||||
os.system ("iptables -P INPUT DROP")
|
os.system ("iptables -P INPUT DROP")
|
||||||
os.system ("ip6tables -P INPUT DROP")
|
os.system ("ip6tables -P INPUT DROP")
|
||||||
|
|
||||||
|
win_msg(_("Firewall successfully reloaded"))
|
||||||
return firewall_list()
|
return firewall_list()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue