mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
[fix] port loop fix
This commit is contained in:
parent
dc97ee6d33
commit
e0f2061852
1 changed files with 5 additions and 4 deletions
|
@ -148,10 +148,11 @@ def firewall_reload():
|
|||
if upnpc.discover() == 1:
|
||||
upnpc.selectigd()
|
||||
for protocol in ['TCP', 'UDP']:
|
||||
if upnpc.getspecificportmapping(port, protocol):
|
||||
try: upnpc.deleteportmapping(port, protocol)
|
||||
except: pass
|
||||
upnpc.addportmapping(port, protocol, upnpc.lanaddr, port, 'yunohost firewall : port %d' % port, '')
|
||||
for port in firewall['uPnP'][protocol]:
|
||||
if upnpc.getspecificportmapping(port, protocol):
|
||||
try: upnpc.deleteportmapping(port, protocol)
|
||||
except: pass
|
||||
upnpc.addportmapping(port, protocol, upnpc.lanaddr, port, 'yunohost firewall : port %d' % port, '')
|
||||
else:
|
||||
raise MoulinetteError(1, _("No uPnP device found"))
|
||||
except:
|
||||
|
|
Loading…
Reference in a new issue