mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-01 02:23:21 +00:00
Adlists need to be grouped by both address and type to differentiate between anti-/gravity lists
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
parent
1a59b407e0
commit
75fadb9b55
1 changed files with 1 additions and 1 deletions
|
@ -48,7 +48,7 @@ GenerateOutput() {
|
||||||
lists_data=$(printf %s "${data}" | jq '.search.domains | [.[] | {domain: .domain, type: .type}]')
|
lists_data=$(printf %s "${data}" | jq '.search.domains | [.[] | {domain: .domain, type: .type}]')
|
||||||
|
|
||||||
# construct a new json for the gravity results where each object contains the adlist URL and the related domains
|
# construct a new json for the gravity results where each object contains the adlist URL and the related domains
|
||||||
gravity_data=$(printf %s "${data}" | jq '.search.gravity | group_by(.address) | map({ address: (.[0].address), domains: [.[] | .domain] })')
|
gravity_data=$(printf %s "${data}" | jq '.search.gravity | group_by(.address,.type) | map({ address: (.[0].address), domains: [.[] | .domain] })')
|
||||||
|
|
||||||
# number of objects in each json
|
# number of objects in each json
|
||||||
num_gravity=$(printf %s "${gravity_data}" | jq length)
|
num_gravity=$(printf %s "${gravity_data}" | jq length)
|
||||||
|
|
Loading…
Reference in a new issue