1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pihole_ynh.git synced 2024-09-03 20:05:58 +02:00

use the template version of 01-pihole.conf

This commit is contained in:
Kay0u 2021-09-14 14:20:55 +02:00
parent 82ae8d433a
commit 57c86aaa15
No known key found for this signature in database
GPG key ID: AAFEEB16CFA2AE2D
2 changed files with 14 additions and 4 deletions

View file

@ -14,7 +14,20 @@ do_pre_regen() {
mkdir -p "$dnsmasq_dir"
cp -a "/etc/dnsmasq.conf" "${pending_conf}/etc/dnsmasq.conf"
# Créer une sauvegarde des config dnsmasq de pi-hole. Que la regen-conf va sauvagement supprimer
cp -a "/etc/dnsmasq.d/01-pihole.conf" "$dnsmasq_dir/"
cp -a "/etc/.pihole/advanced/01-pihole.conf" "$dnsmasq_dir/"
ynh_replace_string --match_string="@DNS1@" --replace_string="" --target_file="$dnsmasq_dir/01-pihole.conf"
ynh_replace_string --match_string="@DNS2@" --replace_string="" --target_file="$dnsmasq_dir/01-pihole.conf"
ynh_replace_string --match_string="^no-resolv" --replace_string="#no-resolv" --target_file="$dnsmasq_dir/01-pihole.conf"
ynh_replace_string --match_string="@INT@" --replace_string="$main_iface" --target_file="$dnsmasq_dir/01-pihole.conf"
if [ "$query_logging" = "true" ]; then
ynh_replace_string --match_string="^#log-queries" --replace_string="log-queries" --target_file="$dnsmasq_dir/01-pihole.conf"
else
ynh_replace_string --match_string="^log-queries" --replace_string="#log-queries" --target_file="$dnsmasq_dir/01-pihole.conf"
fi
# Fix a too recent option for our dnsmasq version.
ynh_replace_string --match_string="log-queries=extra" --replace_string="log-queries" --target_file="$dnsmasq_dir/01-pihole.conf"
ynh_replace_string --match_string="^cache-size=" --replace_string="#pihole# cache-size=" --target_file="${pending_conf}/etc/dnsmasq.conf"

View file

@ -314,9 +314,6 @@ fi
# Fix a too recent option for our dnsmasq version.
ynh_replace_string --match_string="log-queries=extra" --replace_string="log-queries" --target_file=$pihole_dnsmasq_config
# Calculate and store the config file checksum into the app settings
ynh_store_file_checksum --file="$pihole_dnsmasq_config"
# To prevent any conflict with the original dnsmasq config, comment cache-size in the original config.
ynh_replace_string --match_string="^cache-size=" --replace_string="#pihole# cache-size=" --target_file=/etc/dnsmasq.conf