From 57fb93edaa33c5d1d1ff326fb9623c32081cc6b1 Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Sun, 31 Dec 2023 23:43:02 +0100 Subject: [PATCH] delete unneccessary yunohost firewall reload --- scripts/config | 8 ++------ scripts/install | 4 +--- scripts/restore | 4 +--- scripts/upgrade | 4 +--- 4 files changed, 5 insertions(+), 15 deletions(-) diff --git a/scripts/config b/scripts/config index 69388e6..d3258a8 100644 --- a/scripts/config +++ b/scripts/config @@ -21,12 +21,10 @@ set__open_port_53() { ynh_print_info --message="Opening port 53..." # if the user would expose port 53 to the Internet, open it ynh_exec_warn_less yunohost firewall allow Both 53 - ynh_exec_warn_less yunohost firewall reload elif [ "$open_port_53" == "false" ]; then # else if false, close it ynh_print_info --message="Closing port 53..." ynh_exec_warn_less yunohost firewall disallow Both 53 - ynh_exec_warn_less yunohost firewall reload else # else, throw error ynh_print_warn --message="The variable 'open_port_53' should be 'true' or 'false' but isn't, please report this." @@ -63,15 +61,13 @@ set__dns_over_https() { if [ "$dns_over_https" == "true" ]; then ynh_print_info --message="Opening DoH and DoQ ports..." # if DNS over HTTPS/QUIC is activated, open the associated ports - ynh_exec_warn_less yunohost firewall allow Both "$port_dns_over_http" + ynh_exec_warn_less yunohost firewall allow Both "$port_dns_over_http" --no-reload ynh_exec_warn_less yunohost firewall allow UDP "$port_dns_over_quic" - ynh_exec_warn_less yunohost firewall reload elif [ "$dns_over_https" == "false" ]; then # else if false, close them ynh_print_info --message="Closing DoH and DoQ ports..." - ynh_exec_warn_less yunohost firewall disallow Both "$port_dns_over_http" + ynh_exec_warn_less yunohost firewall disallow Both "$port_dns_over_http" --no-reload ynh_exec_warn_less yunohost firewall disallow UDP "$port_dns_over_quic" - ynh_exec_warn_less yunohost firewall reload else # else, throw error ynh_print_warn --message="The variable 'dns_over_https' should be 'true' or 'false' but isn't, please report this." diff --git a/scripts/install b/scripts/install index 16112f6..1b8e117 100644 --- a/scripts/install +++ b/scripts/install @@ -23,9 +23,8 @@ else # if dns_over_https is false, we need to close ports, # as they were opened at the 'Provisioning ports' step ynh_print_info --message="Closing DoH and DoQ ports..." - ynh_exec_warn_less yunohost firewall disallow Both "$port_dns_over_http" + ynh_exec_warn_less yunohost firewall disallow Both "$port_dns_over_http" --no-reload ynh_exec_warn_less yunohost firewall disallow UDP "$port_dns_over_quic" - ynh_exec_warn_less yunohost firewall reload fi ynh_app_setting_set --app="$app" --key=dns_over_https --value="$dns_over_https" @@ -35,7 +34,6 @@ if [[ $open_port_53 == 0 ]]; then # if open_port_53 is true, we need to open port 53 ynh_print_info --message="Opening port 53..." ynh_exec_warn_less yunohost firewall allow Both 53 - ynh_exec_warn_less yunohost firewall reload else open_port_53="false" ynh_print_info --message="Port 53 is closed." diff --git a/scripts/restore b/scripts/restore index ab4d976..b29b641 100644 --- a/scripts/restore +++ b/scripts/restore @@ -18,15 +18,13 @@ source /usr/share/yunohost/helpers if [ "$dns_over_https" == "false" ]; then # if dns_over_https is false, we need to close ports, # as they were opened at the 'Provisioning ports' step - ynh_exec_warn_less yunohost firewall disallow Both "$port_dns_over_http" + ynh_exec_warn_less yunohost firewall disallow Both "$port_dns_over_http" --no-reload ynh_exec_warn_less yunohost firewall disallow UDP "$port_dns_over_quic" - ynh_exec_warn_less yunohost firewall reload fi if [ "$open_port_53" == "true" ]; then # if open_port_53 is true, we need to open port 53 ynh_exec_warn_less yunohost firewall allow Both 53 - ynh_exec_warn_less yunohost firewall reload fi #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index c922ee3..8dbfc8c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -35,7 +35,6 @@ if [ -z "${open_port_53:-}" ] && [ "${open_port_53:-}" = true ]; then # if open_port_53 is true, we need to open port 53 ynh_print_info --message="Opening port 53..." ynh_exec_warn_less yunohost firewall allow Both 53 - ynh_exec_warn_less yunohost firewall reload elif [ -n "${open_port_53:-}" ] || [ "${open_port_53:-}" = false ]; then open_port_53="false" ynh_app_setting_set --app="$app" --key=open_port_53 --value="$open_port_53" @@ -53,9 +52,8 @@ elif [ -n "${dns_over_https:-}" ] || [ "${dns_over_https:-}" = false ]; then # if dns_over_https is false, we need to close ports, # as they were opened at the 'Provisioning ports' step ynh_print_info --message="Closing DoH and DoQ ports..." - ynh_exec_warn_less yunohost firewall disallow Both "$port_dns_over_http" + ynh_exec_warn_less yunohost firewall disallow Both "$port_dns_over_http" --no-reload ynh_exec_warn_less yunohost firewall disallow UDP "$port_dns_over_quic" - ynh_exec_warn_less yunohost firewall reload fi # about all those 'ynh_write_var_in_file':