Fix setting query logging and privacy level (#5724)

This commit is contained in:
yubiuser 2024-08-20 07:18:15 +02:00 committed by GitHub
commit 7206569b1d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -86,9 +86,9 @@ adlistFile="/etc/pihole/adlists.list"
IPV4_ADDRESS=${IPV4_ADDRESS} IPV4_ADDRESS=${IPV4_ADDRESS}
IPV6_ADDRESS=${IPV6_ADDRESS} IPV6_ADDRESS=${IPV6_ADDRESS}
# Give settings their default values. These may be changed by prompts later in the script. # Give settings their default values. These may be changed by prompts later in the script.
QUERY_LOGGING=true QUERY_LOGGING=
WEBPORT=8080 WEBPORT=8080
PRIVACY_LEVEL=0 PRIVACY_LEVEL=
# Where old configs go to if a v6 migration is performed # Where old configs go to if a v6 migration is performed
V6_CONF_MIGRATION_DIR="/etc/pihole/migration_backup_v6" V6_CONF_MIGRATION_DIR="/etc/pihole/migration_backup_v6"
@ -2300,6 +2300,15 @@ main() {
pihole -a -p "${pw}" pihole -a -p "${pw}"
fi fi
# write privacy level and logging to pihole.toml
# set on fresh installations by setPrivacyLevel() and setLogging(
if [ -n "${QUERY_LOGGING}" ]; then
pihole-FTL --config dns.queryLogging "${QUERY_LOGGING}"
fi
if [ -n "${PRIVACY_LEVEL}" ]; then
pihole-FTL --config misc.privacylevel "${PRIVACY_LEVEL}"
fi
# Migrate existing install to v6.0 # Migrate existing install to v6.0
migrate_dnsmasq_configs migrate_dnsmasq_configs