diff --git a/scripts/upgrade b/scripts/upgrade index a59d8c0..24a8fc4 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -45,11 +45,6 @@ elif [ -n "${dns_over_https:-}" ] || [ "${dns_over_https:-}" = false ]; then ynh_app_setting_set --app="$app" --key=dns_over_https --value=$dns_over_https fi -# if the DNS port is not 53, make sure it is -if ! [ "$(ynh_read_var_in_file --file="$install_dir/AdGuardHome.yaml" --key="port" --after="dns")" == "53" ]; then - ynh_write_var_in_file --file="$install_dir/AdGuardHome.yaml" --key="port" --after="dns" --value="53" -fi - # about all those 'ynh_write_var_in_file': # AGH modifies by itself the config file when an user modifies it using the front-end # so if we're using 'ynh_add_config' to process the config file, each @@ -85,6 +80,11 @@ fi # PROCESS OPENING/CLOSING PORTS #================================================= +# if the DNS port in the AGH config is not 53, make sure it is... +if ! [ "$(ynh_read_var_in_file --file="$install_dir/AdGuardHome.yaml" --key="port" --after="dns")" == "53" ]; then + ynh_write_var_in_file --file="$install_dir/AdGuardHome.yaml" --key="port" --after="dns" --value="53" +fi + # if the port 53 is not open, open it, it's mandatory to use AGH if ! yunohost firewall list | grep -q " 53$"; then ynh_print_info --message="Opening port 53..."