From 7f2d2f553ee6e76ea1e50d22cd1ee4893bb237bb Mon Sep 17 00:00:00 2001 From: Jarell <91372088+jarelllama@users.noreply.github.com> Date: Tue, 2 Apr 2024 12:40:17 +0800 Subject: [PATCH] Update --- functions/test_functions.sh | 5 ++--- functions/validate_raw.sh | 4 +++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/functions/test_functions.sh b/functions/test_functions.sh index 7b95a957e..553ec9a4e 100644 --- a/functions/test_functions.sh +++ b/functions/test_functions.sh @@ -657,9 +657,8 @@ check_terms() { fi done < "$2" - if [[ "$term_error" != true ]]; then - return 0 - fi + # Return if all terms found + [[ "$term_error" != true ]] && return printf "\e[1m[warn] %s is not as expected:\e[0m\n" "$3" cat "$1" diff --git a/functions/validate_raw.sh b/functions/validate_raw.sh index 09d218a78..a7d6ba0b7 100644 --- a/functions/validate_raw.sh +++ b/functions/validate_raw.sh @@ -22,6 +22,7 @@ validate_raw() { # Remove common subdomains domains_with_subdomains_count=0 while read -r subdomain; do # Loop through common subdomains + # Find domains and skip to next subdomain if none found domains_with_subdomains="$(grep "^${subdomain}\." <<< "$domains")" \ || continue @@ -78,7 +79,8 @@ validate_raw() { # Remove redundant domains redundant_count=0 while read -r domain; do # Loop through each domain in the blocklist - # Find redundant domains via wildcard matching + # Find redundant domains via wildcard matching and skip to + # next wildcard if none found redundant_domains="$(grep "\.${domain}$" <<< "$domains")" \ || continue