Skip to content

Instantly share code, notes, and snippets.

@takinbo
Created November 21, 2009 08:14
Show Gist options
  • 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 protected]
# 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