Fix errors on fresh installations while setting privacy levels and query logging due to absence of pihole.toml (#5799)

This commit is contained in:
yubiuser 2024-10-28 18:04:46 +01:00 committed by GitHub
commit 112b961762
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2367,15 +2367,6 @@ 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
@ -2401,6 +2392,16 @@ main() {
restart_service pihole-FTL restart_service pihole-FTL
# write privacy level and logging to pihole.toml
# needs to be done after FTL service has been started, otherwise pihole.toml does not exist
# set on fresh installations by setPrivacyLevel() and setLogging(
if [ -n "${QUERY_LOGGING}" ]; then
setFTLConfigValue "dns.queryLogging" "${QUERY_LOGGING}"
fi
if [ -n "${PRIVACY_LEVEL}" ]; then
setFTLConfigValue "misc.privacylevel" "${PRIVACY_LEVEL}"
fi
# Download and compile the aggregated block list # Download and compile the aggregated block list
runGravity runGravity