mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 10:43:55 +00:00
Merge pull request #2151 from pi-hole/FTLDNS-gravity-simplelists
Update FTLDNS branch
This commit is contained in:
commit
2e6a937240
1 changed files with 6 additions and 9 deletions
11
gravity.sh
11
gravity.sh
|
@ -514,12 +514,10 @@ 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
|
|
||||||
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
|
|
||||||
fi
|
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
|
||||||
|
@ -538,10 +536,9 @@ gravity_ParseUserDomains() {
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
gravity_ParseDomainsIntoHosts "${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 || \
|
cp "${blacklistFile}" "${blackList}" 2> /dev/null || \
|
||||||
echo -e "\\n ${CROSS} Unable to move ${blackList##*/}.tmp to ${piholeDir}"
|
echo -e "\\n ${CROSS} Unable to move ${blacklistFile##*/} to ${piholeDir}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Trap Ctrl-C
|
# Trap Ctrl-C
|
||||||
|
|
Loading…
Reference in a new issue