mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
add upnp check
This commit is contained in:
parent
d7bc60bcbc
commit
263df70ddd
1 changed files with 8 additions and 1 deletions
|
@ -207,7 +207,7 @@ def firewall_upnp(action=None):
|
|||
Add uPnP cron and enable uPnP in firewall.yml, or the opposite.
|
||||
|
||||
Keyword argument:
|
||||
action -- enable/disable
|
||||
action -- enable/disable/check
|
||||
|
||||
"""
|
||||
firewall = firewall_list(raw=True)
|
||||
|
@ -244,6 +244,13 @@ def firewall_upnp(action=None):
|
|||
|
||||
msignals.display(m18n.n('upnp_disabled'), 'success')
|
||||
|
||||
if action == 'check':
|
||||
if firewall['uPnP']['enabled'] == True:
|
||||
msignals.display(m18n.n('upnp_active'), 'success')
|
||||
else:
|
||||
raise MoulinetteError(errno.EPERM,
|
||||
m18n.n('upnp_inactive'))
|
||||
|
||||
if action:
|
||||
os.system("cp /etc/yunohost/firewall.yml /etc/yunohost/firewall.yml.old")
|
||||
with open('/etc/yunohost/firewall.yml', 'w') as f:
|
||||
|
|
Loading…
Add table
Reference in a new issue