From 8b600e53d1d76ba1ca5cccda1f2a29c90222a055 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Sun, 11 Oct 2020 16:37:47 +0200 Subject: [PATCH] [fix] close ports upon removal --- scripts/remove | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/remove b/scripts/remove index 2758978..43ff782 100644 --- a/scripts/remove +++ b/scripts/remove @@ -18,6 +18,7 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) port=$(ynh_app_setting_get --app=$app --key=port) +port_wg=$(ynh_app_setting_get --app=$app --key=port_wg) final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= @@ -82,6 +83,16 @@ ynh_script_progression --message="Removing logrotate configuration..." --time -- # Remove the app-specific logrotate config ynh_remove_logrotate +#================================================= +# CLOSE WIREGUARD PORT +#================================================= + +if yunohost firewall list | grep -q "\- $port_wg$" +then + ynh_script_progression --message="Closing port $port_wg..." --time --weight=1 + ynh_exec_warn_less yunohost firewall disallow TCP $port_wg +fi + #================================================= # GENERIC FINALIZATION #=================================================