Merge pull request #2017 from pi-hole/fix/NoWhitelistGravity

Gravity falls over when there is no whitelist file
This commit is contained in:
Adam Warner 2018-03-06 20:39:32 +00:00 committed by GitHub
commit aed20cf7c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -506,7 +506,12 @@ gravity_ParseBlacklistDomains() {
# Empty $accretionDisc if it already exists, otherwise, create it # Empty $accretionDisc if it already exists, otherwise, create it
: > "${piholeDir}/${accretionDisc}" : > "${piholeDir}/${accretionDisc}"
if [[ -f "${piholeDir}/${whitelistMatter}" ]]; then
gravity_ParseDomainsIntoHosts "${piholeDir}/${whitelistMatter}" "${piholeDir}/${accretionDisc}" gravity_ParseDomainsIntoHosts "${piholeDir}/${whitelistMatter}" "${piholeDir}/${accretionDisc}"
else
# There was no whitelist file, so use preEventHorizon instead of whitelistMatter.
gravity_ParseDomainsIntoHosts "${piholeDir}/${preEventHorizon}" "${piholeDir}/${accretionDisc}"
fi
# Move the file over as /etc/pihole/gravity.list so dnsmasq can use it # Move the file over as /etc/pihole/gravity.list so dnsmasq can use it
output=$( { mv "${piholeDir}/${accretionDisc}" "${adList}"; } 2>&1 ) output=$( { mv "${piholeDir}/${accretionDisc}" "${adList}"; } 2>&1 )