fix: subdomains may be completely excluded

This commit is contained in:
MDLeom 2024-05-03 11:16:01 +00:00
parent 2ee0b2d661
commit 358003b782
No known key found for this signature in database
GPG Key ID: 32D3E28E96A695E8
1 changed files with 5 additions and 2 deletions

View File

@ -222,8 +222,11 @@ set -x
## "phishing-subdomains.txt" is derived from URLs of top domains that does not have a path
# exclude from top (sub)domains
if [ -s "phishing-subdomains.txt" ]; then
cat "phishing-subdomains.txt" | \
grep -Fx -vf "phishing-top-domains.txt" >> "phishing-notop-domains-temp.txt"
excluded_subdomains=$(cat "phishing-subdomains.txt" | grep -Fx -vf "phishing-top-domains.txt" || [ $? = 1 ])
if [ "$excluded_subdomains" != "" ] && [ -n "$excluded_subdomains" ]; then
echo "$excluded_subdomains" >> "phishing-notop-domains-temp.txt"
fi
fi
## "phishing-subdomains.txt" & "phishing-url-top-domains-temp.txt" may add duplicate entries