2015-07-18 10:39:18 -04:00
|
|
|
#!/bin/bash
|
|
|
|
# For each argument passed to this script
|
|
|
|
for var in "$@"
|
|
|
|
do
|
|
|
|
echo "Whitelisting $var..."
|
2015-07-30 13:10:26 -04:00
|
|
|
# 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/pihole/gravity.list
|
2015-07-18 10:39:18 -04:00
|
|
|
# Also add the domain to the whitelist.txt in /etc/pihole
|
|
|
|
echo "$var" >> /etc/pihole/whitelist.txt
|
|
|
|
done
|
|
|
|
echo "** $# domain(s) whitelisted."
|
2015-07-30 13:10:26 -04:00
|
|
|
# Force dnsmasq to reload /etc/pihole/gravity.list
|
2015-07-18 10:39:18 -04:00
|
|
|
kill -HUP $(pidof dnsmasq)
|