mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 10:43:55 +00:00
Print table name before entering the loop for the sake of simplicity
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
parent
a904c183df
commit
5060605626
1 changed files with 9 additions and 11 deletions
|
@ -103,7 +103,7 @@ if [[ -n "${str:-}" ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
scanDatabaseTable() {
|
scanDatabaseTable() {
|
||||||
local domain table type querystr result table_prev
|
local domain table type querystr result
|
||||||
domain="$(printf "%q" "${1}")"
|
domain="$(printf "%q" "${1}")"
|
||||||
table="${2}"
|
table="${2}"
|
||||||
type="${3:-}"
|
type="${3:-}"
|
||||||
|
@ -126,22 +126,20 @@ scanDatabaseTable() {
|
||||||
|
|
||||||
# Mark domain as having been white-/blacklist matched (global variable)
|
# Mark domain as having been white-/blacklist matched (global variable)
|
||||||
wbMatch=true
|
wbMatch=true
|
||||||
# Loop through each result
|
|
||||||
|
# Print table name
|
||||||
|
if [[ ! -z "${result}" ]]; then
|
||||||
|
echo " ${matchType^} found in ${COL_BOLD}${table^}${COL_NC}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Loop over results and print them
|
||||||
mapfile -t results <<< "${result}"
|
mapfile -t results <<< "${result}"
|
||||||
for result in "${results[@]}"; do
|
for result in "${results[@]}"; do
|
||||||
if [[ -n "${blockpage}" ]]; then
|
if [[ -n "${blockpage}" ]]; then
|
||||||
echo "π ${result}"
|
echo "π ${result}"
|
||||||
exit 0
|
exit 0
|
||||||
elif [[ -n "${exact}" ]]; then
|
|
||||||
echo " ${matchType^} found in ${COL_BOLD}${table^}${COL_NC}"
|
|
||||||
else
|
|
||||||
# Only print table name once
|
|
||||||
if [[ ! "${table}" == "${table_prev:-}" ]]; then
|
|
||||||
echo " ${matchType^} found in ${COL_BOLD}${table^}${COL_NC}"
|
|
||||||
table_prev="${table}"
|
|
||||||
fi
|
|
||||||
echo " ${result}"
|
|
||||||
fi
|
fi
|
||||||
|
echo " ${result}"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue