Skip to content

Instantly share code, notes, and snippets.

@andykais
Created August 26, 2015 02:00
Show Gist options
  • Save andykais/ef1e53c5ad716878abd3 to your computer and use it in GitHub Desktop.
Save andykais/ef1e53c5ad716878abd3 to your computer and use it in GitHub Desktop.
check every hour if my dns manager has allowed github pages redirect, send a text message if it has
#!/bin/bash
#one hour (in seconds)
wait=$((60 * 60))
while true
do
dns=$(dig andykais.com +nostats +nocomments +nocmd)
if [[ $dns == *"github"* ]]
then
#if dns response contains github then send a text message
echo "DNS control has changed!" | mail -s "andykais.com" [email protected]
fi
sleep $wait
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment