From 5a8e0189699b0f741ea07ae25e1fbe2de4d0df5f Mon Sep 17 00:00:00 2001 From: Yalh Date: Sat, 26 Jan 2019 21:24:34 +0100 Subject: [PATCH] Closing port on upgrade --- scripts/upgrade | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index d768eb9..417d0fb 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -122,6 +122,18 @@ ynh_backup_if_checksum_is_different "$final_path/config.ini" # Recalculate and store the checksum of the file for the next upgrade. ynh_store_file_checksum "$final_path/config.ini" + +#================================================= +# CLOSE A PORT +#================================================= + +if yunohost firewall list | grep -q "\- $port$" +then + echo "Close port $port" >&2 + yunohost firewall disallow TCP $port 2>&1 +fi + + #================================================= # SETUP LOGROTATE #=================================================