diff --git a/scripts/install b/scripts/install index f10f800..7314611 100644 --- a/scripts/install +++ b/scripts/install @@ -61,7 +61,7 @@ ynh_print_info "Configuring firewall..." # Find a free port port=$(ynh_find_port 4242) # Open this port -ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port +#ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port ynh_app_setting_set $app port $port #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 8df02ad..355b760 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -38,6 +38,16 @@ if [ -z "$port" ]; then ynh_app_setting_set $app port $port fi +#================================================= +# CLOSE A PORT +#================================================= + +if yunohost firewall list | grep -q "\- $port$" +then + ynh_print_info "Closing port $port" + ynh_exec_warn_less yunohost firewall disallow TCP $port +fi + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #=================================================