1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/adguardhome_ynh.git synced 2024-09-03 18:06:23 +02:00
This commit is contained in:
OniriCorpe 2024-01-03 23:37:19 +01:00
parent 6863829604
commit 7facbe2820

View file

@ -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..."