mirror of
https://github.com/pi-hole/pi-hole
synced 2024-12-22 14:58:08 +00:00
Have gravity detect the presence of files like gravity.list.bck and update this file if present (assuming blocking is disabled)
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
parent
20b946eae5
commit
6cde066edd
15
gravity.sh
15
gravity.sh
@ -73,6 +73,19 @@ if [[ -r "${piholeDir}/pihole.conf" ]]; then
|
|||||||
echo -e " ${COL_LIGHT_RED}Ignoring overrides specified within pihole.conf! ${COL_NC}"
|
echo -e " ${COL_LIGHT_RED}Ignoring overrides specified within pihole.conf! ${COL_NC}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Determine if Pi-hole blocking is disabled
|
||||||
|
# If this is the case, we want to update
|
||||||
|
# gravity.list.bck and black.list.bck instead of
|
||||||
|
# gravity.list and black.list
|
||||||
|
detect_pihole_blocking_status() {
|
||||||
|
if [[ -e "${adList}.bck" ]]; then
|
||||||
|
adList="${adList}.bck"
|
||||||
|
fi
|
||||||
|
if [[ -e "${blackList}.bck" ]]; then
|
||||||
|
blackList="${blackList}.bck"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Determine if DNS resolution is available before proceeding
|
# Determine if DNS resolution is available before proceeding
|
||||||
gravity_CheckDNSResolutionAvailable() {
|
gravity_CheckDNSResolutionAvailable() {
|
||||||
local lookupDomain="pi.hole"
|
local lookupDomain="pi.hole"
|
||||||
@ -621,6 +634,8 @@ if [[ "${forceDelete:-}" == true ]]; then
|
|||||||
echo -e "${OVER} ${TICK} ${str}"
|
echo -e "${OVER} ${TICK} ${str}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
detect_pihole_blocking_status
|
||||||
|
|
||||||
# Determine which functions to run
|
# Determine which functions to run
|
||||||
if [[ "${skipDownload}" == false ]]; then
|
if [[ "${skipDownload}" == false ]]; then
|
||||||
# Gravity needs to download blocklists
|
# Gravity needs to download blocklists
|
||||||
|
Loading…
Reference in New Issue
Block a user