mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-23 21:30:17 +00:00
Prevent double disabling/enabling by checking BLOCKING_ENABLED value in setupVars.conf
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
parent
465589c0fd
commit
a4ba8d4b8f
1 changed files with 8 additions and 0 deletions
8
pihole
8
pihole
|
@ -144,6 +144,10 @@ Time:
|
|||
|
||||
elif [[ "${1}" == "0" ]]; then
|
||||
# Disable Pi-hole
|
||||
if grep -cq "BLOCKING_ENABLED=false" "${setupVars}"; then
|
||||
echo -e " ${INFO} Blocking already disabled, nothing to do"
|
||||
exit 0
|
||||
fi
|
||||
if [[ -e "${gravitylist}" ]]; then
|
||||
mv "${gravitylist}" "${gravitylist}.bck"
|
||||
echo "" > "${gravitylist}"
|
||||
|
@ -193,6 +197,10 @@ Time:
|
|||
fi
|
||||
else
|
||||
# Enable Pi-hole
|
||||
if grep -cq "BLOCKING_ENABLED=true" "${setupVars}"; then
|
||||
echo -e " ${INFO} Blocking already enabled, nothing to do"
|
||||
exit 0
|
||||
fi
|
||||
echo -e " ${INFO} Enabling blocking"
|
||||
local str="Pi-hole Enabled"
|
||||
|
||||
|
|
Loading…
Reference in a new issue