From d99bc8893d32d55877efd780863f97da29c95442 Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Tue, 26 Dec 2023 22:25:48 +0100 Subject: [PATCH] close DoH/DoQ ports if needed --- scripts/install | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/install b/scripts/install index f50e59f..915cf06 100644 --- a/scripts/install +++ b/scripts/install @@ -17,8 +17,15 @@ ynh_script_progression --message="Storing installation settings..." --weight=2 if [ "$dns_over_https" == "1" ]; then dns_over_https="true" + # no need to open the ports, as they were opened at the 'Provisioning ports' step else dns_over_https="false" + # 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 --no-upnp TCP "$port_dns_over_http" + ynh_exec_warn_less yunohost firewall disallow --no-upnp UDP "$port_dns_over_http" + ynh_exec_warn_less yunohost firewall disallow --no-upnp 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