diff --git a/scripts/install b/scripts/install index 34f805a..0d6e6f7 100644 --- a/scripts/install +++ b/scripts/install @@ -63,7 +63,6 @@ ynh_app_setting_set "$app" admin "$admin" # Find a free port port=$(ynh_find_port 5000) # Open this port -yunohost firewall allow --no-upnp TCP "$port" 2>&1 ynh_app_setting_set "$app" port "$port" #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index b95cc56..586aff7 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -69,6 +69,16 @@ path_url=$(ynh_normalize_url_path "$path_url") #================================================= # STANDARD UPGRADE STEPS +#================================================= +# CLOSE A PORT +#================================================= + +if yunohost firewall list | grep -q "\- $port$" +then + echo "Close port $port" + yunohost firewall disallow TCP $port 2>&1 +fi + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #=================================================