summaryrefslogtreecommitdiff
path: root/domain
blob: 3dc1ecc3cdf24280329a71295d19d232712c029f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env bash
#
# Check if domain is free or not.
#
if [ "$#" == "0" ]; then
    echo "usage: domain <name.tld>"
    exit 1
fi
#
whois $1 | egrep -q \
    '^No match|^NOT FOUND|^Not fo|AVAILABLE|^No Data Fou|has not been regi|No entri'
#
if [ $? -eq 0 ]; then
    echo "ok : $1"
else
    echo "no : $1"
fi
#