Created
September 10, 2017 11:24
-
-
Save ayatmaulana/039301e1e6b2ddfb36eefbfdfd4a7d95 to your computer and use it in GitHub Desktop.
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/bash | |
# Name: Check for domain name availability | |
# linuxconfig.org | |
# Please copy, share, redistribute and improve | |
# modify by Ayat Maulana | |
if [ "$#" == "0" ]; then | |
echo "You need tu supply at least one argument!" | |
exit 1 | |
fi | |
DOMAINS=('.id' '.com' '.co.uk' '.net' '.info' '.mobi' '.org' '.tel' '.biz' '.tv' '.cc' '.eu' '.ru' '.in' '.it' '.sk' '.com.au' ) | |
ELEMENTS=${#DOMAINS[@]} | |
while (( "$#" )); do | |
for (( i=0;i<$ELEMENTS;i++)); do | |
whois $1${DOMAINS[${i}]} | egrep -q '^No match|^NOT FOUND|^Not fo|AVAILABLE|^No Data Fou|has not been regi|No entri|DOMAIN NOT FOUND' | |
if [ $? -eq 0 ]; then | |
echo "$1${DOMAINS[${i}]} : available" | |
else | |
echo "$1${DOMAINS[${i}]} : not available" | |
fi | |
done | |
shift | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment