Skip to content

Instantly share code, notes, and snippets.

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
You can’t perform that action at this time.