Created
September 3, 2015 23:17
-
-
Save yousefamar/fe60d555024decf72f13 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 | |
# domain-filter.sh | |
# Reads URLs from stdin, writes the valid ones to stdout | |
# Based off of http://linuxconfig.org/check-domain-name-availability-with-bash-and-whois | |
# @author Yousef Amar <yousef@amar.io> | |
while read line | |
do | |
whois "$line" | grep -Eq '^No match|^NOT FOUND|^Not fo|AVAILABLE|^No Data Fou|has not been regi|No entri' | |
if [ $? -eq 0 ]; then | |
echo "$line" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment