1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-15 03:51:51 +00:00
This commit is contained in:
Paul Curry 2020-11-10 13:59:55 +00:00 committed by suyuan
parent 402d51ae14
commit 4abe0ab8af

View file

@ -339,21 +339,21 @@ _bypass_proto() {
domainlist="" domainlist=""
# construct list of domains to query # construct list of domains to query
for tld in $tlds; do for tld in $tlds; do
i=$((i+1)) i=$((i+1))
# trim off header # trim off header
if [ "$i" -lt "12" ] || [ "$i" -gt "50" ]; then if [ "$i" -lt "12" ] || [ "$i" -gt "50" ]; then
continue continue
fi fi
# add to command # add to command
domainlist="${domainlist} ${domain}${tld}" domainlist="${domainlist} ${domain}${tld}"
done done
domainlist="$(echo $domainlist `# Get the list of valid domains, pass it to awk` \ domainlist="$(echo $domainlist `# Get the list of valid domains, pass it to awk` \
| awk '{print tolower($0)}' `# awk lowercases the whole string and passes it to ` \ | awk '{print tolower($0)}' `# awk lowercases the whole string and passes it to ` \
| xargs -n8 -P12 `# xargs sends 8 arguments at a time across 12 threads to` \ | xargs -n8 -P12 `# xargs sends 8 arguments at a time across 12 threads to` \
dig a +nocmd +noall +answer `# dig, which passes results (if any) to` \ dig a +nocmd +noall +answer `# dig, which passes results (if any) to` \
| awk '{print $1}' `# awk, which outputs queried domain to` \ | awk '{print $1}' `# awk, which outputs queried domain to` \
| sed -e 's/.$//' `# sed, which trims off the trailing dot (google.com. -> google.com)` \ | sed -e 's/.$//' `# sed, which trims off the trailing dot (google.com. -> google.com)` \
| awk '{for (i=1;i<=NF;i++) if (!a[$i]++) printf("%s%s",$i,FS)}{printf("\n")}')" # deduplicate | awk '{for (i=1;i<=NF;i++) if (!a[$i]++) printf("%s%s",$i,FS)}{printf("\n")}')" # deduplicate
for validdomain in $domainlist; do for validdomain in $domainlist; do
_bypass_domain $validdomain $intf _bypass_domain $validdomain $intf
done done