mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
upnp cron
This commit is contained in:
parent
0b024bdbf4
commit
80ff31022f
3 changed files with 26 additions and 4 deletions
|
@ -491,6 +491,14 @@ firewall:
|
|||
action: store_true
|
||||
|
||||
|
||||
### firewall_upnpinstall()
|
||||
upnpinstall:
|
||||
action_help: Add upnp cron
|
||||
|
||||
|
||||
### firewall_upnpremove()
|
||||
upnpremove:
|
||||
action_help: Remove upnp cron
|
||||
#############################
|
||||
# Tools #
|
||||
#############################
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
ipv4:
|
||||
TCP: [22, 25, 53, 80, 443, 5222, 5269, 5280]
|
||||
UDP: []
|
||||
TCP: [22, 25, 53, 80, 443, 5222, 5269, 5280]
|
||||
UDP: []
|
||||
ipv6:
|
||||
TCP: [22]
|
||||
UDP: []
|
||||
TCP: [22]
|
||||
UDP: []
|
||||
|
|
|
@ -217,3 +217,17 @@ def add_portmapping(protocol=None, upnp=False, ipv6=None):
|
|||
upnp.addportmapping(port, protocol, upnp.lanaddr, port, 'yunohost firewall : port %u' % port, '')
|
||||
|
||||
os.system ("iptables -P INPUT DROP")
|
||||
|
||||
def firewall_installupnp():
|
||||
"""
|
||||
Add upnp cron
|
||||
Keyword arguments:
|
||||
None
|
||||
Return
|
||||
None
|
||||
"""
|
||||
os.system("touch /etc/cron.d/yunohost-firewall")
|
||||
os.system("echo '*/50 * * * * root yunohost firewall reload -u>>/dev/null'>/etc/cron.d/yunohost-firewall")
|
||||
|
||||
def firewall_removeupnp():
|
||||
os.system("rm /etc/cron.d/yunohost-firewall")
|
||||
|
|
Loading…
Add table
Reference in a new issue