As we no longer add source lists to the whitelist by default, gravity falls over on new installs.

Signed-off-by: Adam Warner <adamw@rner.email>
This commit is contained in:
Adam Warner 2018-03-02 20:47:01 +00:00
parent 6011dd7372
commit ad1f210528
No known key found for this signature in database
GPG key ID: F5410858022DA5EB

View file

@ -506,7 +506,12 @@ gravity_ParseBlacklistDomains() {
# Empty $accretionDisc if it already exists, otherwise, create it
: > "${piholeDir}/${accretionDisc}"
gravity_ParseDomainsIntoHosts "${piholeDir}/${whitelistMatter}" "${piholeDir}/${accretionDisc}"
if [[ -f "${piholeDir}/${whitelistMatter}" ]]; then
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
output=$( { mv "${piholeDir}/${accretionDisc}" "${adList}"; } 2>&1 )