mirror of
https://github.com/pi-hole/pi-hole
synced 2025-02-22 21:12:01 +00:00
Merge pull request #2601 from pi-hole/fix/double_disable_kills_gravity
Prevent double disabling/enabling
This commit is contained in:
commit
26361883b4
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 New Issue
Block a user