From db8c91b4e0ab073162732a5860ae6a1f9b19d154 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Thu, 10 May 2018 20:28:26 +0200 Subject: [PATCH] Open coturn port rangle only if it's not already open --- scripts/install | 7 ++++++- scripts/restore | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 7b1bf28..59e9958 100644 --- a/scripts/install +++ b/scripts/install @@ -76,7 +76,12 @@ cli_port=$(ynh_find_port 5766) yunohost firewall allow TCP $synapse_tls_port > /dev/null 2>&1 yunohost firewall allow Both $turnserver_tls_port > /dev/null 2>&1 yunohost firewall allow Both $turnserver_alt_tls_port > /dev/null 2>&1 -yunohost firewall allow Both '49152:49192' > /dev/null 2>&1 + +# Open the range 49152-49192 only if it as not been open by an other instance +if ! yunohost firewall list | grep -q "\- 49152:49192$" +then + yunohost firewall allow Both 49152:49192 > /dev/null 2>&1 +fi # Store opened ports ynh_app_setting_set $app synapse_port $port diff --git a/scripts/restore b/scripts/restore index bbf147e..b232369 100644 --- a/scripts/restore +++ b/scripts/restore @@ -127,7 +127,12 @@ ynh_store_file_checksum "$coturn_config_path" yunohost firewall allow TCP $synapse_tls_port > /dev/null 2>&1 yunohost firewall allow Both $turnserver_tls_port > /dev/null 2>&1 yunohost firewall allow Both $turnserver_alt_tls_port > /dev/null 2>&1 -yunohost firewall allow Both '49152:49192' > /dev/null 2>&1 + +# Open the range 49152-49192 only if it as not been open by an other instance +if ! yunohost firewall list | grep -q "\- 49152:49192$" +then + yunohost firewall allow Both 49152:49192 > /dev/null 2>&1 +fi #================================================= # SETUP SSOWAT