1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-11-01 05:09:57 +00:00

Generate gravity.list and black.list in simple domain lists format for FTLDNS. Leave local.list in HOSTS format

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER 2018-04-21 23:27:36 +02:00
parent 1cae76b443
commit bac9e005ae
No known key found for this signature in database
GPG Key ID: 00135ACBD90B28DD

View File

@ -514,11 +514,11 @@ gravity_ParseBlacklistDomains() {
: > "${piholeDir}/${accretionDisc}" : > "${piholeDir}/${accretionDisc}"
if [[ -f "${piholeDir}/${whitelistMatter}" ]]; then if [[ -f "${piholeDir}/${whitelistMatter}" ]]; then
gravity_ParseDomainsIntoHosts "${piholeDir}/${whitelistMatter}" "${piholeDir}/${accretionDisc}" mv "${piholeDir}/${whitelistMatter}" "${piholeDir}/${accretionDisc}"
grep -c "^" "${piholeDir}/${whitelistMatter}" > "${piholeDir}/numBlocked" 2> /dev/null grep -c "^" "${piholeDir}/${whitelistMatter}" > "${piholeDir}/numBlocked" 2> /dev/null
else else
# There was no whitelist file, so use preEventHorizon instead of whitelistMatter. # There was no whitelist file, so use preEventHorizon instead of whitelistMatter.
gravity_ParseDomainsIntoHosts "${piholeDir}/${preEventHorizon}" "${piholeDir}/${accretionDisc}" mv "${piholeDir}/${preEventHorizon}" "${piholeDir}/${accretionDisc}"
grep -c "^" "${piholeDir}/${preEventHorizon}" > "${piholeDir}/numBlocked" 2> /dev/null grep -c "^" "${piholeDir}/${preEventHorizon}" > "${piholeDir}/numBlocked" 2> /dev/null
fi fi
@ -538,7 +538,7 @@ gravity_ParseUserDomains() {
return 0 return 0
fi fi
gravity_ParseDomainsIntoHosts "${blacklistFile}" "${blackList}.tmp" mv "${blacklistFile}" "${blackList}.tmp"
# Copy the file over as /etc/pihole/black.list so dnsmasq can use it # Copy the file over as /etc/pihole/black.list so dnsmasq can use it
mv "${blackList}.tmp" "${blackList}" 2> /dev/null || \ mv "${blackList}.tmp" "${blackList}" 2> /dev/null || \
echo -e "\\n ${CROSS} Unable to move ${blackList##*/}.tmp to ${piholeDir}" echo -e "\\n ${CROSS} Unable to move ${blackList##*/}.tmp to ${piholeDir}"