-
Notifications
You must be signed in to change notification settings - Fork 0
/
dcheck.sh
64 lines (57 loc) · 2.36 KB
/
dcheck.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
# USAGE
# $ cd /c/www/bash/domain-availability-checker
# $ LANG=C LC_ALL=C ./dcheck.sh
# TEST
# $ cd /c/www/bash/domain-availability-checker && time ./dcheck.sh
# $ cd /c/www/bash/domain-availability-checker
# $ time LANG=C LC_ALL=C echo files/test.txt | grep -Foaq '^.*(Creation Date).*$'
# CONSOLE MATCH
# $ LANG=hu_HU whois -h whois.nic.hu -H domain.hu | grep -oPa '.*(record created|No match).*'
# jwhois.conf
# https://github.com/jonasob/jwhois/blob/master/example/jwhois.conf
# whois.conf
# https://github.com/rfc1036/whois
# https://gist.github.com/thde/3890aa48e03a2b551374
# https://www.iana.org/domains/root/db
# https://github.com/weppos/whois/blob/master/data/tld.json
# WHOIS SERVERS
# whois.verisign-grs.com
# whois.iana.org
# com.whois-servers.net
#
TLD='.com'
#TLD_HOST='whois.verisign-grs.com'
#TLD='.hu'
#TLD_HOST='whois.nic.hu'
while read -r domain; do
#MATCH=$(jwhois --force-lookup --disable-cache --no-redirect -c jwhois.conf "$domain$TLD" | grep -oPa '^.*\b(Updated Date|Creation Date|Expiration Date)\b.*\$')
#MATCH=$(whois -H "$domain.com" | grep -oPa '^.*(Updated Date|Creation Date|Expiration Date).*$')
#
#whois -H $domain'.com' | grep -oPaq '^.*(Updated Date|Creation Date|Expiration Date).*$'
#whois -H $domain'.com' | grep -oPaq '.*Creation Date.*'
#whois -H $domain'.com' | grep -oPaq '.*Creation Date.'
#
#whois -H $domain$TLD | grep -oPaq '.*Creation Date.*'
#whois -H $domain$TLD | grep -oPaq '.*Creation Date.*'
#
#if [ $TLD = '.hu' ]; then
# whois -H $domain$TLD | grep -oPaq '.*record created.*'
#else
# whois -H $domain$TLD | grep -oPaq '.*Creation Date.*'
#fi
#
#
#whois -h $TLD_HOST -H $domain$TLD | grep -oPaq '^.*(Creation Date|record created).*$'
whois -H $domain$TLD | grep -oPaq '^.*(Creation Date|record created).*$'
#/c/Users/Lanti/cmd/whoiscl -r -n $domain$TLD | grep -oPaq '^.*(Creation Date|record created).*$'
if [ $? -eq 0 ]; then
#echo $domain'.com' | tee --append files/registered.txt && echo ' registered'
echo $domain$TLD | tee --append 'files/registered.txt'
#echo "" |& tee --append remove/registered.txt
#echo -e "$domain$TLD\tregistered\t$MATCH" | tr '\n' '\t' |& tee --append files/registered.txt
else
#echo $domain'.com' | tee --append files/available.txt && echo ' available'
echo $domain$TLD | tee --append 'files/available.txt'
fi
done < 'files/domains.txt'