mirror of
https://github.com/pi-hole/pi-hole
synced 2025-01-03 04:30:55 +00:00
Use new setupVars BLOCKING variable to determine which file to update via gravity
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
parent
d8abc1d266
commit
b011adc453
@ -78,11 +78,12 @@ fi
|
|||||||
# gravity.list.bck and black.list.bck instead of
|
# gravity.list.bck and black.list.bck instead of
|
||||||
# gravity.list and black.list
|
# gravity.list and black.list
|
||||||
detect_pihole_blocking_status() {
|
detect_pihole_blocking_status() {
|
||||||
if [[ -e "${adList}.bck" ]]; then
|
if [[ "${BLOCKING}" == false ]]; then
|
||||||
|
echo -e " ${INFO} Pi-hole blocking is disabled"
|
||||||
adList="${adList}.bck"
|
adList="${adList}.bck"
|
||||||
fi
|
|
||||||
if [[ -e "${blackList}.bck" ]]; then
|
|
||||||
blackList="${blackList}.bck"
|
blackList="${blackList}.bck"
|
||||||
|
else
|
||||||
|
echo -e " ${INFO} Pi-hole blocking is enabled"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
5
pihole
5
pihole
@ -12,6 +12,7 @@
|
|||||||
readonly PI_HOLE_SCRIPT_DIR="/opt/pihole"
|
readonly PI_HOLE_SCRIPT_DIR="/opt/pihole"
|
||||||
readonly gravitylist="/etc/pihole/gravity.list"
|
readonly gravitylist="/etc/pihole/gravity.list"
|
||||||
readonly blacklist="/etc/pihole/black.list"
|
readonly blacklist="/etc/pihole/black.list"
|
||||||
|
readonly setupVars="/etc/pihole/setupVars.conf"
|
||||||
readonly colfile="${PI_HOLE_SCRIPT_DIR}/COL_TABLE"
|
readonly colfile="${PI_HOLE_SCRIPT_DIR}/COL_TABLE"
|
||||||
source "${colfile}"
|
source "${colfile}"
|
||||||
|
|
||||||
@ -192,7 +193,7 @@ Time:
|
|||||||
|
|
||||||
local str="Pi-hole Disabled"
|
local str="Pi-hole Disabled"
|
||||||
sed -i "/BLOCKING=/d" "${setupVars}"
|
sed -i "/BLOCKING=/d" "${setupVars}"
|
||||||
echo "BLOCKING=true" >> "${setupVars}"
|
echo "BLOCKING=false" >> "${setupVars}"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# Enable Pi-hole
|
# Enable Pi-hole
|
||||||
@ -206,7 +207,7 @@ Time:
|
|||||||
mv "${blacklist}.bck" "${blacklist}"
|
mv "${blacklist}.bck" "${blacklist}"
|
||||||
fi
|
fi
|
||||||
sed -i "/BLOCKING=/d" "${setupVars}"
|
sed -i "/BLOCKING=/d" "${setupVars}"
|
||||||
echo "BLOCKING=false" >> "${setupVars}"
|
echo "BLOCKING=true" >> "${setupVars}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
restartDNS reload
|
restartDNS reload
|
||||||
|
Loading…
Reference in New Issue
Block a user