Skip to content

Instantly share code, notes, and snippets.

@digiltd
Last active April 5, 2016 10:09
Show Gist options
  • Save digiltd/4b6f6a546abc2fdb131d30a359dd732a to your computer and use it in GitHub Desktop.
Save digiltd/4b6f6a546abc2fdb131d30a359dd732a to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# Script to toggle ad-blocking on/off. Save in /usr/local/bin
# Source https://pi-hole.net/forums/topic/quickly-enabledisable-pi-hole-from-your-phone/
# Toggle with $ pihole-toggle.sh
list=/etc/pihole/gravity.list
if [[ -f $list ]];then
mv $list $list.off
systemctl restart dnsmasq
echo "Ad-blocking disabled"
else
mv $list.off $list
systemctl restart dnsmasq
echo "Ad-blocking enabled"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment