Merge pull request #13 from titoko/dev

Stop firewall
This commit is contained in:
Alexis Gavoty 2013-03-15 07:26:18 -07:00
commit 542b833ae1
2 changed files with 33 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

@ -233,9 +233,37 @@ def firewall_installupnp():
def firewall_removeupnp(): def firewall_removeupnp():
"""
Remove upnp cron
Keyword arguments:
None
Return
None
"""
try: try:
os.remove("/etc/cron.d/yunohost-firewall") os.remove("/etc/cron.d/yunohost-firewall")
except: except:
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():
"""
Stop firewall
Keyword arguments:
None
Return
None
"""
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")
firewall_removeupnp()