Created
May 21, 2019 14:02
-
-
Save rdmarsh/085f882c9415d94acbfd64e06d38d883 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!//bin/bash | |
URL_LIST='/home/pi/kids-internet.dat' | |
case ${1} in | |
block) | |
FLAG='' | |
;; | |
unblock) | |
FLAG='--delmode' | |
;; | |
*) | |
echo "Usage: $0 [block|unblock]" | |
;; | |
esac | |
if [[ "${1}" == 'block' || "${1}" == 'unblock' ]] ; then | |
while read URL ; do | |
/usr/local/bin/pihole -wild --noreload ${FLAG} ${URL} | |
done < ${URL_LIST} | |
/usr/local/bin/pihole restartdns | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment