mirror of
https://github.com/pi-hole/pi-hole
synced 2024-12-22 14:58:08 +00:00
pihole -g should respose GRAVITYDB in pihole-FTL.conf
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
parent
f27fd9f899
commit
d25240fe9f
14
gravity.sh
14
gravity.sh
@ -35,8 +35,9 @@ localList="${piholeDir}/local.list"
|
|||||||
VPNList="/etc/openvpn/ipp.txt"
|
VPNList="/etc/openvpn/ipp.txt"
|
||||||
|
|
||||||
piholeGitDir="/etc/.pihole"
|
piholeGitDir="/etc/.pihole"
|
||||||
gravityDBfile="${piholeDir}/gravity.db"
|
gravityDBfile_default="${piholeDir}/gravity.db"
|
||||||
gravityTEMPfile="${piholeDir}/gravity_temp.db"
|
# GRAVITYDB may be overwritten by source pihole-FTL.conf below
|
||||||
|
GRAVITYDB="${gravityDBfile_default}"
|
||||||
gravityDBschema="${piholeGitDir}/advanced/Templates/gravity.db.sql"
|
gravityDBschema="${piholeGitDir}/advanced/Templates/gravity.db.sql"
|
||||||
gravityDBcopy="${piholeGitDir}/advanced/Templates/gravity_copy.sql"
|
gravityDBcopy="${piholeGitDir}/advanced/Templates/gravity_copy.sql"
|
||||||
|
|
||||||
@ -68,6 +69,11 @@ if [[ -f "${pihole_FTL}" ]]; then
|
|||||||
source "${pihole_FTL}"
|
source "${pihole_FTL}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Set this only after sourcing pihole-FTL.conf as the gravity database path may
|
||||||
|
# have changed
|
||||||
|
gravityDBfile="${GRAVITYDB}"
|
||||||
|
gravityTEMPfile="${GRAVITYDB}_temp"
|
||||||
|
|
||||||
if [[ -z "${BLOCKINGMODE}" ]] ; then
|
if [[ -z "${BLOCKINGMODE}" ]] ; then
|
||||||
BLOCKINGMODE="NULL"
|
BLOCKINGMODE="NULL"
|
||||||
fi
|
fi
|
||||||
@ -359,6 +365,10 @@ gravity_CheckDNSResolutionAvailable() {
|
|||||||
gravity_DownloadBlocklists() {
|
gravity_DownloadBlocklists() {
|
||||||
echo -e " ${INFO} ${COL_BOLD}Neutrino emissions detected${COL_NC}..."
|
echo -e " ${INFO} ${COL_BOLD}Neutrino emissions detected${COL_NC}..."
|
||||||
|
|
||||||
|
if [[ "${gravityDBfile}" != "${gravityDBfile_default}" ]]; then
|
||||||
|
echo -e " ${INFO} Storing gravity database in ${COL_BOLD}${gravityDBfile}${COL_NC}"
|
||||||
|
fi
|
||||||
|
|
||||||
# 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 vw_adlist;" 2> /dev/null)"
|
mapfile -t sources <<< "$(sqlite3 "${gravityDBfile}" "SELECT address FROM vw_adlist;" 2> /dev/null)"
|
||||||
|
Loading…
Reference in New Issue
Block a user