1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/adguardhome_ynh.git synced 2024-09-03 18:06:23 +02:00

put opening/closing ports info messages in upgrade script too

This commit is contained in:
OniriCorpe 2023-12-31 00:34:41 +01:00
parent 00936aea85
commit 56b9a133ac
2 changed files with 7 additions and 3 deletions

View file

@ -38,7 +38,7 @@ if [[ $open_port_53 == 0 ]]; then
ynh_exec_warn_less yunohost firewall reload
else
open_port_53="false"
ynh_print_info --message="Port 53 is already closed."
ynh_print_info --message="Port 53 is closed."
fi
ynh_app_setting_set --app="$app" --key=open_port_53 --value="$open_port_53"

View file

@ -33,22 +33,26 @@ if [ -z "${open_port_53:-}" ] && [ "${open_port_53:-}" = true ]; then
open_port_53="true"
ynh_app_setting_set --app="$app" --key=open_port_53 --value="$open_port_53"
# 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"
ynh_print_info --message="Port 53 is closed."
fi
if [ -z "${dns_over_https:-}" ] && [ "${dns_over_https:-}" = true ]; then
dns_over_https="true"
ynh_app_setting_set --app="$app" --key=dns_over_https --value=$dns_over_https
# no need to open the ports, as they were opened at the 'Provisioning ports' step
# no need to open the ports, as they were opened at the 'Provisioning ports' step
ynh_print_info --message="DoH and DoQ ports are open."
elif [ -n "${dns_over_https:-}" ] || [ "${dns_over_https:-}" = false ]; then
dns_over_https="false"
ynh_app_setting_set --app="$app" --key=dns_over_https --value=$dns_over_https
# if dns_over_https is false, we need to close ports,
# 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 UDP "$port_dns_over_quic"
ynh_exec_warn_less yunohost firewall reload