1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-12-22 23:08:07 +00:00

Improve displayed messages and overall logic

This commit is contained in:
DL6ER 2017-06-17 14:24:30 +02:00
parent 92e691408f
commit 8bad56e897
No known key found for this signature in database
GPG Key ID: 00135ACBD90B28DD

View File

@ -236,9 +236,7 @@ gravity_Blacklist() {
if [[ -f "${blacklistFile}" ]]; then
numBlacklisted=$(wc -l < "${blacklistFile}")
plural=; [[ "$numBlacklisted" != "1" ]] && plural=s
echo -n "::: Blacklisting $numBlacklisted domain${plural}..."
cat "${blacklistFile}" > "${blackList}.tmp"
echo " done!"
echo "::: Exact blocked domain${plural}: $numBlacklisted"
else
echo "::: Nothing to blacklist!"
fi
@ -345,12 +343,16 @@ gravity_hostFormatGravity() {
}
gravity_hostFormatBlack() {
if [[ -f "${blacklistFile}" ]]; then
numBlacklisted=$(wc -l < "${blacklistFile}")
# Format domain list as "192.168.x.x domain.com"
echo -e "" > "${blackList}.tmp"
gravity_doHostFormat "${blackList}.tmp" "${blackList}"
gravity_doHostFormat "${blacklistFile}" "${blackList}.tmp"
# Copy the file over as /etc/pihole/black.list so dnsmasq can use it
cp "${blackList}.tmp" "${blackList}"
rm "${blackList}.tmp"
else
echo "::: Nothing to blacklist!"
fi
}
# blackbody - remove any remnant files from script processes