Skip to content

Instantly share code, notes, and snippets.

@granth
Created February 11, 2009 15:05
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 granth/62046 to your computer and use it in GitHub Desktop.
Save granth/62046 to your computer and use it in GitHub Desktop.
# available domain names
# http://gilesbowkett.blogspot.com/2009/02/simple-bash-domain-availability.html
domainavailable() {
if whois $1 | grep "No match for" &>/dev/null; then
echo "$1 is available"
return 0
else
echo "$1 is not available"
return 1;
fi
}
availabledomains() {
for f in $@; do
domainavailable $f >&/dev/null && echo $f
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment