Skip to content

Instantly share code, notes, and snippets.

@rdmarsh
Created May 21, 2019 14:02
Show Gist options
  • Save rdmarsh/085f882c9415d94acbfd64e06d38d883 to your computer and use it in GitHub Desktop.
Save rdmarsh/085f882c9415d94acbfd64e06d38d883 to your computer and use it in GitHub Desktop.
#!//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