mirror of
https://github.com/moparisthebest/pi-hole
synced 2024-11-25 02:32:15 -05:00
missed a few more /etc/host changes
This commit is contained in:
parent
024395b73b
commit
52ef76d717
@ -11,7 +11,7 @@ do
|
|||||||
uptime | cut -d' ' -f11-
|
uptime | cut -d' ' -f11-
|
||||||
echo "-------------------------------"
|
echo "-------------------------------"
|
||||||
# Uncomment to continually read the log file and display the current domain being blocked
|
# Uncomment to continually read the log file and display the current domain being blocked
|
||||||
#tail -f /var/log/pihole.log | awk '/\/etc\/hosts/ {if ($7 != "address" && $7 != "name" && $7 != "/etc/pihole/gravity.list") print $7; else;}'
|
#tail -f /var/log/pihole.log | awk '/\/etc\/pihole\/gravity.list/ {if ($7 != "address" && $7 != "name" && $7 != "/etc/pihole/gravity.list") print $7; else;}'
|
||||||
|
|
||||||
today=$(date "+%b %e")
|
today=$(date "+%b %e")
|
||||||
todaysQueryCount=$(cat /var/log/pihole.log | grep "$today" | awk '/query/ {print $7}' | wc -l)
|
todaysQueryCount=$(cat /var/log/pihole.log | grep "$today" | awk '/query/ {print $7}' | wc -l)
|
||||||
|
@ -3,11 +3,11 @@
|
|||||||
for var in "$@"
|
for var in "$@"
|
||||||
do
|
do
|
||||||
echo "Whitelisting $var..."
|
echo "Whitelisting $var..."
|
||||||
# Use sed to search for the domain in /etc/hosts and remove it using an in-place edit
|
# Use sed to search for the domain in /etc/pihole/gravity.list and remove it using an in-place edit
|
||||||
sed -i "/$var/d" /etc/hosts
|
sed -i "/$var/d" /etc/pihole/gravity.list
|
||||||
# Also add the domain to the whitelist.txt in /etc/pihole
|
# Also add the domain to the whitelist.txt in /etc/pihole
|
||||||
echo "$var" >> /etc/pihole/whitelist.txt
|
echo "$var" >> /etc/pihole/whitelist.txt
|
||||||
done
|
done
|
||||||
echo "** $# domain(s) whitelisted."
|
echo "** $# domain(s) whitelisted."
|
||||||
# Force dnsmasq to reload /etc/hosts
|
# Force dnsmasq to reload /etc/pihole/gravity.list
|
||||||
kill -HUP $(pidof dnsmasq)
|
kill -HUP $(pidof dnsmasq)
|
Loading…
Reference in New Issue
Block a user