Little shell script to check if a domain is still connected. Run with cron job!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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