-
-
Save applicato/0a3c4d3c19aa6f6b90acab6f36f5e8e1 to your computer and use it in GitHub Desktop.
Find .com Domain availability from terminal
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 | |
| while [ "$name" != "exit" ] | |
| do | |
| # Get the Domain Name from User | |
| echo "What domain name do you want?: [Enter]" | |
| read name | |
| # Check if the input is not empty or just spaces | |
| if [[ -z "${name// }" ]]; then | |
| echo "Input is empty" | |
| continue | |
| fi | |
| # Check if the input has .com in it | |
| if [[ ! "$name" =~ ".com" ]]; then | |
| echo "Enter valid .com domain" | |
| continue | |
| fi | |
| # Check if the input domain is available | |
| if whois $name | grep -q 'No match for'; then | |
| echo "Available" | |
| else | |
| echo "Oops. Taken" | |
| fi | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment