forked from nickmkk/freemail
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate.sh
67 lines (58 loc) · 1.46 KB
/
update.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
65
66
67
#!/usr/bin/env bash
set -e
tmp=$(touch tempblacklist)
cat ./data/blacklist.txt \
| sed '/./,$!d' \
| sed -e 's/^ *//' -e 's/ *$//' \
| awk '{print tolower($0)}' \
| sort \
| uniq > '$tmp'
mv '$tmp' ./data/blacklist.txt
tmp=$(touch tempfree)
cat ./data/free.txt \
| sed '/./,$!d' \
| sed -e 's/^ *//' -e 's/ *$//' \
| awk '{print tolower($0)}' \
| sort \
| uniq \
| comm -23 - ./data/blacklist.txt > '$tmp'
mv '$tmp' ./data/free.txt
tmp=$(touch tempdisposable)
cat ./data/disposable.txt \
| sed '/./,$!d' \
| sed -e 's/^ *//' -e 's/ *$//' \
| awk '{print tolower($0)}' \
| sort \
| uniq \
| comm -23 - ./data/blacklist.txt \
| comm -23 - ./data/free.txt > '$tmp'
mv '$tmp' ./data/disposable.txt
sources=$(cat ./data/sources.txt)
new=$(touch tempnew)
for source in $sources; do
echo "$(curl --silent $source)" >> $new
done;
tmp=$(touch tempall)
cat $new \
| sed '/./,$!d' \
| sed -e 's/^ *//' -e 's/ *$//' \
| awk '{print tolower($0)}' \
| sort \
| uniq \
| comm -23 - ./data/blacklist.txt \
| comm -23 - ./data/free.txt \
| comm -23 - ./data/disposable.txt > '$tmp'
confirmed=$(touch tempconfirmed)
for domain in $(cat $tmp); do
result=`dig +short mx $domain`
if [ -n "$result" ]; then
echo $domain >> $confirmed
fi
done
tmp=$(touch tempfreemail)
cat $confirmed ./data/free.txt \
| sort \
| uniq > '$tmp'
mv '$tmp' ./data/free.txt
echo 'Complete!'
read