mirror of
https://github.com/pi-hole/pi-hole
synced 2025-01-03 12:40:56 +00:00
Show whitelist, blacklist, and regexlist details
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
This commit is contained in:
parent
3f05efd60f
commit
807ce0af4e
@ -1051,21 +1051,40 @@ head_tail_log() {
|
|||||||
IFS="$OLD_IFS"
|
IFS="$OLD_IFS"
|
||||||
}
|
}
|
||||||
|
|
||||||
show_adlists() {
|
show_db_entries() {
|
||||||
echo_current_diagnostic "Adlists"
|
local title="${1}"
|
||||||
|
local query="${2}"
|
||||||
|
|
||||||
|
echo_current_diagnostic "${title}"
|
||||||
|
|
||||||
OLD_IFS="$IFS"
|
OLD_IFS="$IFS"
|
||||||
IFS=$'\r\n'
|
IFS=$'\r\n'
|
||||||
local adlists=()
|
local entries=()
|
||||||
mapfile -t adlists < <(sqlite3 "${PIHOLE_GRAVITY_DB_FILE}" "SELECT address FROM vw_adlists")
|
mapfile -t entries < <(sqlite3 "${PIHOLE_GRAVITY_DB_FILE}" -cmd ".headers on" "${query}")
|
||||||
|
|
||||||
for line in "${adlists[@]}"; do
|
for line in "${entries[@]}"; do
|
||||||
log_write " ${line}"
|
log_write " ${line}"
|
||||||
done
|
done
|
||||||
|
|
||||||
IFS="$OLD_IFS"
|
IFS="$OLD_IFS"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
show_adlists() {
|
||||||
|
show_db_entries "Adlists" "SELECT * FROM adlists"
|
||||||
|
}
|
||||||
|
|
||||||
|
show_whitelist() {
|
||||||
|
show_db_entries "Whitelist" "SELECT * FROM whitelist"
|
||||||
|
}
|
||||||
|
|
||||||
|
show_blacklist() {
|
||||||
|
show_db_entries "Blacklist" "SELECT * FROM blacklist"
|
||||||
|
}
|
||||||
|
|
||||||
|
show_regexlist() {
|
||||||
|
show_db_entries "Regexlist" "SELECT * FROM regex"
|
||||||
|
}
|
||||||
|
|
||||||
analyze_gravity_list() {
|
analyze_gravity_list() {
|
||||||
echo_current_diagnostic "Gravity List and Database"
|
echo_current_diagnostic "Gravity List and Database"
|
||||||
|
|
||||||
@ -1240,6 +1259,9 @@ parse_setup_vars
|
|||||||
check_x_headers
|
check_x_headers
|
||||||
analyze_gravity_list
|
analyze_gravity_list
|
||||||
show_adlists
|
show_adlists
|
||||||
|
show_whitelist
|
||||||
|
show_blacklist
|
||||||
|
show_regexlist
|
||||||
show_content_of_pihole_files
|
show_content_of_pihole_files
|
||||||
parse_locale
|
parse_locale
|
||||||
analyze_pihole_log
|
analyze_pihole_log
|
||||||
|
Loading…
Reference in New Issue
Block a user