@@ -157,19 +157,6 @@ lists=("$(cd "$piholeDir" || exit 0; printf "%s\\n" -- *.domains | sort -V)")
157
157
# Query blocklists for occurences of domain
158
158
mapfile -t results <<< " $(scanList " ${domainQuery} " " ${lists[*]} " " ${exact} " )"
159
159
160
- # Handle notices
161
- if [[ -z " ${wbMatch:- } " ]] && [[ -z " ${wcMatch:- } " ]] && [[ -z " ${results[*]} " ]]; then
162
- echo -e " ${INFO} No ${exact/ t/ t } results found for ${COL_BOLD}${domainQuery}${COL_NC} within the block lists"
163
- exit 0
164
- elif [[ -z " ${results[*]} " ]]; then
165
- # Result found in WL/BL/Wildcards
166
- exit 0
167
- elif [[ -z " ${all} " ]] && [[ " ${# results[*]} " -ge 100 ]]; then
168
- echo -e " ${INFO} Over 100 ${exact/ t/ t } results found for ${COL_BOLD}${domainQuery}${COL_NC}
169
- This can be overridden using the -all option"
170
- exit 0
171
- fi
172
-
173
160
# Remove unwanted content from $results
174
161
# Each line in $results is formatted as such: [fileName]:[line]
175
162
# 1. Delete lines starting with #
@@ -183,8 +170,19 @@ mapfile -t results <<< "$(IFS=$'\n'; sed \
183
170
-e " s/:.*[ \\ t]/:/g" \
184
171
-e " /${esc_domain} /!d" \
185
172
<<< " ${results[*]}" )"
186
- # Exit if result was in a comment
187
- [[ -z " ${results[*]} " ]] && exit 0
173
+
174
+ # Handle notices
175
+ if [[ -z " ${wbMatch:- } " ]] && [[ -z " ${wcMatch:- } " ]] && [[ -z " ${results[*]} " ]]; then
176
+ echo -e " ${INFO} No ${exact/ t/ t } results found for ${COL_BOLD}${domainQuery}${COL_NC} within the block lists"
177
+ exit 0
178
+ elif [[ -z " ${results[*]} " ]]; then
179
+ # Result found in WL/BL/Wildcards
180
+ exit 0
181
+ elif [[ -z " ${all} " ]] && [[ " ${# results[*]} " -ge 100 ]]; then
182
+ echo -e " ${INFO} Over 100 ${exact/ t/ t } results found for ${COL_BOLD}${domainQuery}${COL_NC}
183
+ This can be overridden using the -all option"
184
+ exit 0
185
+ fi
188
186
189
187
# Get adlist file content as array
190
188
if [[ -n " ${adlist} " ]] || [[ -n " ${blockpage} " ]]; then
0 commit comments