Add stop firewall action

This commit is contained in:
Titoko 2013-03-15 14:18:30 +01:00
parent a48c0006f5
commit ae8c327583
2 changed files with 16 additions and 0 deletions

View file

@ -499,6 +499,11 @@ firewall:
### firewall_removeupnp() ### firewall_removeupnp()
removeupnp: removeupnp:
action_help: Remove upnp cron action_help: Remove upnp cron
### firewall_stop()
stop:
action_help: Stop iptables and ip6tables
############################# #############################
# Tools # # Tools #
############################# #############################

View file

@ -239,3 +239,14 @@ def firewall_removeupnp():
raise YunoHostError(167,_("UPNP cron was not installed!")) raise YunoHostError(167,_("UPNP cron was not installed!"))
win_msg(_("UPNP cron removed")) win_msg(_("UPNP cron removed"))
def firewall_stop():
os.system ("iptables -P INPUT ACCEPT")
os.system ("iptables -F")
os.system ("iptables -X")
os.system ("ip6tables -P INPUT ACCEPT")
os.system ("ip6tables -F")
os.system ("ip6tables -X")