1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/synapse_ynh.git synced 2024-09-03 20:26:38 +02:00

Open coturn port rangle only if it's not already open

This commit is contained in:
Josué Tille 2018-05-10 20:28:26 +02:00 committed by Josue-T
parent e547bdaf8e
commit 3fd9ceeb06
2 changed files with 12 additions and 2 deletions

View file

@ -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

View file

@ -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