Skip to content

Instantly share code, notes, and snippets.

@takinbo
Created November 21, 2009 08:14
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 takinbo/240054 to your computer and use it in GitHub Desktop.
Save takinbo/240054 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Invocation: ./domain_available.sh domain.com email@yourcompany.com
# Could be configured with cron to alert you when a domain is available.
MAILTO=$2
DOMAIN=$1
STATUS=`whois $DOMAIN | grep 'Status:' | awk -F ' ' '{ print \$2; }'`
STATUS=${STATUS:="available"}
case $STATUS in "available")
echo "Is $DOMAIN available?" | mail -s "$DOMAIN available?" $MAILTO;
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment