From ea76075326606a1ae2865639a7b6dda9804189a6 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Sat, 7 Nov 2020 19:49:00 +0100 Subject: [PATCH] [fix] close the port during upgrades --- scripts/upgrade | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 1a87d55..2b9e7d6 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -62,6 +62,19 @@ ynh_clean_setup () { # Exit if an error occurs during the execution of the script ynh_abort_if_errors + +#================================================= +# CLOSING PORT +#================================================= + +# In older versions of the package, the port serving the webui was opened to anyone, +# allowing direct access to Node-RED... let's close it. +if yunohost firewall list | grep -q "\- $port$" +then + ynh_script_progression --message="Closing port $port..." + ynh_exec_warn_less yunohost firewall disallow TCP $port +fi + #================================================= # STANDARD UPGRADE STEPS #=================================================