From d5b68fded1e9d2e85c07d717d27afc65c3946ea8 Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Wed, 27 Dec 2023 01:28:11 +0100 Subject: [PATCH] properly fix unbound vars --- scripts/upgrade | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index fbc964e..5fb9820 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -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,