Skip to content

Instantly share code, notes, and snippets.

@LeSpocky
Last active December 17, 2015 08:49
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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