mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
Use ',' as the separator char in query rather than the default '|' as we now expect some valid results to contain '|'
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
This commit is contained in:
parent
1f3f849106
commit
c5faf3d174
1 changed files with 7 additions and 7 deletions
|
@ -116,7 +116,7 @@ scanDatabaseTable() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Send prepared query to gravity database
|
# Send prepared query to gravity database
|
||||||
result="$(pihole-FTL sqlite3 "${gravityDBfile}" "${querystr}")" 2> /dev/null
|
result="$(pihole-FTL sqlite3 -separator ',' "${gravityDBfile}" "${querystr}")" 2> /dev/null
|
||||||
if [[ -z "${result}" ]]; then
|
if [[ -z "${result}" ]]; then
|
||||||
# Return early when there are no matches in this table
|
# Return early when there are no matches in this table
|
||||||
return
|
return
|
||||||
|
@ -136,8 +136,8 @@ scanDatabaseTable() {
|
||||||
# Loop over results and print them
|
# Loop over results and print them
|
||||||
mapfile -t results <<< "${result}"
|
mapfile -t results <<< "${result}"
|
||||||
for result in "${results[@]}"; do
|
for result in "${results[@]}"; do
|
||||||
domain="${result/|*}"
|
domain="${result/,*}"
|
||||||
if [[ "${result#*|}" == "0" ]]; then
|
if [[ "${result#*,}" == "0" ]]; then
|
||||||
extra=" (disabled)"
|
extra=" (disabled)"
|
||||||
else
|
else
|
||||||
extra=""
|
extra=""
|
||||||
|
@ -212,10 +212,10 @@ if [[ -n "${exact}" ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for result in "${results[@]}"; do
|
for result in "${results[@]}"; do
|
||||||
match="${result/|*/}"
|
match="${result/,*/}"
|
||||||
extra="${result#*|}"
|
extra="${result#*,}"
|
||||||
adlistAddress="${extra/|*/}"
|
adlistAddress="${extra/,*/}"
|
||||||
extra="${extra#*|}"
|
extra="${extra#*,}"
|
||||||
if [[ "${extra}" == "0" ]]; then
|
if [[ "${extra}" == "0" ]]; then
|
||||||
extra=" (disabled)"
|
extra=" (disabled)"
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue