Skip to content

Instantly share code, notes, and snippets.

@LeSpocky
Last active December 17, 2015 08:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LeSpocky/5583118 to your computer and use it in GitHub Desktop.
Save LeSpocky/5583118 to your computer and use it in GitHub Desktop.
Little shell script to check if a domain is still connected. Run with cron job!
#!/bin/sh
if whois $1 | grep -i status | grep -q connect
then
echo "$1 still connected" >/dev/null
else
echo "*** The domain $1 is not connected! ***"
fi
changed=$(whois $1 | grep -i changed)
old_changed=$(cat ~/var/domain_changed_${1})
if [ "$changed" != "$old_changed" ]
then
echo "*** The domain $1 changed! ***"
echo "$changed" > ~/var/domain_changed_${1}
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment