From ae8c3275835c31b301f9aabdcee8bdf5d247922b Mon Sep 17 00:00:00 2001 From: Titoko Date: Fri, 15 Mar 2013 14:18:30 +0100 Subject: [PATCH] Add stop firewall action --- action_map.yml | 5 +++++ yunohost_firewall.py | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/action_map.yml b/action_map.yml index dcda6abf..3e24cdb7 100644 --- a/action_map.yml +++ b/action_map.yml @@ -499,6 +499,11 @@ firewall: ### firewall_removeupnp() removeupnp: action_help: Remove upnp cron + + + ### firewall_stop() + stop: + action_help: Stop iptables and ip6tables ############################# # Tools # ############################# diff --git a/yunohost_firewall.py b/yunohost_firewall.py index 9738afee..57bdd789 100644 --- a/yunohost_firewall.py +++ b/yunohost_firewall.py @@ -239,3 +239,14 @@ def firewall_removeupnp(): raise YunoHostError(167,_("UPNP cron was not installed!")) 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")