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

properly fix unbound vars

This commit is contained in:
OniriCorpe 2023-12-27 01:28:11 +01:00
parent fced44bdb1
commit d5b68fded1

View file

@ -29,12 +29,11 @@ ynh_systemd_action --service_name="$app" --action="stop"
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
ynh_app_setting_get --app="$app" --key=dns_over_https
if [ -n "$dns_over_https" ] && [ "$dns_over_https" == "1" ]; then
if [ -n "${dns_over_https:-}" ] && [ "${dns_over_https:-}" == "1" ]; 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
elif [ -z "$dns_over_https" ] || [ "$dns_over_https" == "0" ]; then
elif [ -z "${dns_over_https:-}" ] || [ "${dns_over_https:-}" == "0" ]; 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,
@ -44,12 +43,11 @@ elif [ -z "$dns_over_https" ] || [ "$dns_over_https" == "0" ]; then
ynh_exec_warn_less yunohost firewall reload
fi
ynh_app_setting_get --app="$app" --key=open_port_53
if [ -n "$open_port_53" ] && [ "$open_port_53" == "1" ]; then
if [ -n "${open_port_53:-}" ] && [ "${open_port_53:-}" == "1" ]; then
open_port_53="true"
ynh_app_setting_set --app="$app" --key=open_port_53 --value="$open_port_53"
# no need to open th port, as it were opened at the 'Provisioning ports' step
elif [ -z "$open_port_53" ] || [ "$open_port_53" == "0" ]; then
elif [ -z "${open_port_53:-}" ] || [ "${open_port_53:-}" == "0" ]; then
open_port_53="false"
ynh_app_setting_set --app="$app" --key=open_port_53 --value="$open_port_53"
# if open_port_53 is false, we need to close port,