From 389466f6c527422e78085763bf273276eae1bddd Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 25 Jan 2021 11:21:17 +0100 Subject: [PATCH] Closing ports --- scripts/remove | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/scripts/remove b/scripts/remove index 28f82b8..db413ff 100644 --- a/scripts/remove +++ b/scripts/remove @@ -85,21 +85,20 @@ ynh_secure_remove --file="/var/log/$app/" ynh_secure_remove --file="/var/lib/turn/" #================================================= -# CLOSE A PORT +# CLOSE PORTS #================================================= -closeport() { - local port=$1 - if yunohost firewall list | grep -q "\- $turnserver_tls_port$" - then - ynh_script_progression --message="Closing port $turnserver_tls_port port" - ynh_exec_warn_less yunohost firewall disallow Both $turnserver_tls_port - elif yunohost firewall list | grep -q "\- $turnserver_alt_tls_port$" - then - ynh_script_progression --message="Closing port $turnserver_alt_tls_port port" - ynh_exec_warn_less yunohost firewall disallow Both $turnserver_alt_tls_port - fi -} +if yunohost firewall list | grep -q "\- $turnserver_tls_port$" +then + ynh_script_progression --message="Closing port $turnserver_tls_port$..." --weight=1 + ynh_exec_warn_less yunohost firewall disallow Both $turnserver_tls_port +fi + +if yunohost firewall list | grep -q "\- $turnserver_alt_tls_port$" +then + ynh_script_progression --message="Closing port $turnserver_alt_tls_port$..." --weight=1 + ynh_exec_warn_less yunohost firewall disallow Both $turnserver_alt_tls_port +fi #================================================= # GENERIC FINALIZATION