diff --git a/scripts/install b/scripts/install index bd92d28..f27be8f 100644 --- a/scripts/install +++ b/scripts/install @@ -66,8 +66,6 @@ ynh_app_setting_set $app is_public $is_public # Find a free port port=$(ynh_find_port 4010) -# Open this port -yunohost firewall allow --no-upnp TCP $port 2>&1 ynh_app_setting_set $app port $port #================================================= diff --git a/scripts/restore b/scripts/restore index 99a778a..9943548 100755 --- a/scripts/restore +++ b/scripts/restore @@ -52,9 +52,6 @@ ynh_restore_file "/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file "$final_path" -# Open this port -yunohost firewall allow Both "$port" 2>&1 - #================================================= # RESTORE THE MYSQL DATABASE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index b8ab2c1..153d8a3 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -90,6 +90,16 @@ sudo rm -R "$tmpdir1/ghost.zip" sudo cp -ar "$tmpdir/content" "${final_path}" sudo rm -R "$tmpdir" +#================================================= +# CLOSE A PORT +#================================================= + +if yunohost firewall list | grep -q "\- $port$" +then + echo "Close port $port" + yunohost firewall disallow TCP $port 2>&1 +fi + #================================================= # SPECIFIC SETUP #=================================================