-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdomain-finder.sh
61 lines (54 loc) · 1.89 KB
/
domain-finder.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
#!/usr/bin/env bash
#
# This is a super simple way to check for domain name availablility. Here's how it works:
#
# - Run the script bash domain-finder.sh
# - Enter your name
# - Enter the filename containing domain names to check (one per line)
# - Enter the path to save results
#
# The script will use whois and grep for the string "No match for" and output the data as a pipe
# delimited file thet displays domain name, availability, and the name of the person that came up
# with the domain name.
#
# Awesome ascii cat courtesy of http://user.xmission.com/~emailbox/ascii_cats.htm
#
# .__....._ _.....__,
# .": o :': ;': o :".
# `. `-' .'. .'. `-' .'
# `---' `---'
#
# _...----... ... ... ...----..._
# .-'__..-""'---- `. `"` .' ----'""-..__`-.
# '.-' _.--"""' `-._.-' '"""--._ `-.`
# ' .-"' : `"-. `
# ' `. _.'"'._ .' `
# `. ,.-'" "'-., .'
# `. .'
# jgs `-._ _.-'
# `"'--...___...--'"`
#
#
# grab the user input...
read -p "Enter your name: " NAME
read -e -p "Domain list path: " FILENAME
read -e -p "Results path: " SAVE_FILE
# make sure the paths get expanded...
eval NAME=$NAME
eval FILENAME=$FILENAME
eval SAVE_FILE=$SAVE_FILE
# create the column headers...
echo "Domain Name|Is Available?|Author" >> $SAVE_FILE
# Check to see what's available and what's not...
while read DOMAIN || [[ -n "$DOMAIN" ]]
do
if whois $DOMAIN | grep -q "No match for";
then
echo "Processing $DOMAIN..."
echo "$DOMAIN|yes|$NAME" >> $SAVE_FILE
else
echo "Processing $DOMAIN..."
echo "$DOMAIN|no|$NAME" >> $SAVE_FILE
fi
done <$FILENAME
echo "done!"