mirror of
https://github.com/pi-hole/pi-hole
synced 2025-01-03 12:40:56 +00:00
Add vw_adlists view which returns only enabled adlists
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
parent
53e3ff2b24
commit
bd0215524b
@ -20,6 +20,10 @@ CREATE VIEW vw_whitelist AS SELECT DISTINCT a.domain
|
|||||||
FROM whitelist a
|
FROM whitelist a
|
||||||
WHERE a.enabled == 1;
|
WHERE a.enabled == 1;
|
||||||
|
|
||||||
CREATE VIEW vw_regex AS SELECT DISTINCT a.filter
|
CREATE VIEW vw_regex AS SELECT DISTINCT a.domain
|
||||||
FROM regex a
|
FROM regex a
|
||||||
WHERE a.enabled == 1;
|
WHERE a.enabled == 1;
|
||||||
|
|
||||||
|
CREATE VIEW vw_adlists AS SELECT DISTINCT a.address
|
||||||
|
FROM adlists a
|
||||||
|
WHERE a.enabled == 1;
|
||||||
|
@ -238,7 +238,7 @@ gravity_GetBlocklistUrls() {
|
|||||||
|
|
||||||
# Retrieve source URLs from gravity database
|
# Retrieve source URLs from gravity database
|
||||||
# We source only enabled adlists, sqlite3 stores boolean values as 0 (false) or 1 (true)
|
# We source only enabled adlists, sqlite3 stores boolean values as 0 (false) or 1 (true)
|
||||||
mapfile -t sources <<< "$(sqlite3 "${gravityDBfile}" "SELECT address FROM adlists WHERE enabled = 1;" 2> /dev/null)"
|
mapfile -t sources <<< "$(sqlite3 "${gravityDBfile}" "SELECT address FROM vw_adlists;" 2> /dev/null)"
|
||||||
|
|
||||||
# Parse source domains from $sources
|
# Parse source domains from $sources
|
||||||
mapfile -t sourceDomains <<< "$(
|
mapfile -t sourceDomains <<< "$(
|
||||||
|
Loading…
Reference in New Issue
Block a user