diff --git a/scripts/install b/scripts/install index 1c9d80b..6a22c62 100644 --- a/scripts/install +++ b/scripts/install @@ -83,8 +83,6 @@ ynh_app_setting_set --app=$app --key=port_videobridge --value=$port_videobridge # Find an available port port_component=$(ynh_find_port --port=5347) -# Open this port -ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port_component ynh_app_setting_set --app=$app --key=port_component --value=$port_component #================================================= diff --git a/scripts/restore b/scripts/restore index 8a1a456..a97c086 100644 --- a/scripts/restore +++ b/scripts/restore @@ -101,7 +101,6 @@ ynh_print_info --message="Configuring firewall..." # Open this port ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port ynh_exec_warn_less yunohost firewall allow --no-upnp UDP $port_videobridge -ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port_component #================================================= # CONFIGURE METRONOME diff --git a/scripts/upgrade b/scripts/upgrade index d39c65a..0219936 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -67,6 +67,13 @@ if ynh_version_gt "1.0.3387~ynh2" "${current_version}" ; then yunohost tools regen-conf metronome fi +# Closing port_component +if yunohost firewall list | grep -q "\- $port_component$" +then + ynh_print_info --message="Closing port $port_component..." + ynh_exec_warn_less yunohost firewall disallow TCP $port_component +fi + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #=================================================