Last active
December 16, 2015 10:59
-
-
Save izmailoff/5424470 to your computer and use it in GitHub Desktop.
Check available domain names with this convenience tool.
This file contains hidden or 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/bash | |
# takes one argument as domain name and checks if this domain is registered. | |
# | |
# usage: | |
# sss google.com | |
# | |
function sss() | |
{ | |
if [ $# -eq 0 -o -z "$1" ]; then | |
echo "You must provide a domain name." | |
return | |
fi | |
if [ $(whois "$1" | grep -i 'registrant:' | wc -l) -ge "1" ]; then | |
echo TAKEN; | |
else | |
echo AVAILABLE; | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Unfortunately, whois is not very consistent in its results from different tld. Changing the script to use grep instead of exit code.