mirror of
https://github.com/pi-hole/pi-hole
synced 2024-12-22 14:58:08 +00:00
test out new status logic
This commit is contained in:
parent
685b775b68
commit
78fbafa1cd
24
pihole
24
pihole
@ -127,19 +127,31 @@ piholeEnable() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
piholeStatus() {
|
piholeStatus() {
|
||||||
if [[ $(cat /etc/dnsmasq.d/01-pihole.conf | grep "#addn-hosts=") ]] ; then
|
if [[ $(cat /etc/dnsmasq.d/01-pihole.conf | grep "#addn-hosts=/") ]] ; then
|
||||||
if [[ "${1}" == "web" ]] ; then echo 0; else echo "::: pihole is Disabled"; fi
|
#list is commented out
|
||||||
|
if [[ "${1}" == "web" ]] ; then
|
||||||
|
echo 0;
|
||||||
|
else
|
||||||
|
echo "::: pihole is Disabled";
|
||||||
|
fi
|
||||||
|
elif [[ $(cat /etc/dnsmasq.d/01-pihole.conf | grep "addn-hosts=/") ]] ; then
|
||||||
|
#list set
|
||||||
|
if [[ "${1}" == "web" ]] ; then
|
||||||
|
echo 1;
|
||||||
else
|
else
|
||||||
if [[ "${1}" == "web" ]] ; then echo 1; else
|
|
||||||
if [[ $(cat /etc/dnsmasq.d/01-pihole.conf | grep "addn-hosts=") ]] ; then
|
|
||||||
echo "::: pihole is Enabled";
|
echo "::: pihole is Enabled";
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
#addn-host not found
|
||||||
|
if [[ "${1}" == "web" ]] ; then
|
||||||
|
echo 99
|
||||||
else
|
else
|
||||||
echo "::: no hosts file linked to dnsmasq, adding it in enabled state"
|
echo "::: no hosts file linked to dnsmasq, adding it in enabled state"
|
||||||
|
fi
|
||||||
|
#add addn-host= to dnsmasq
|
||||||
echo "addn-hosts=/etc/pihole/gravity.list" >> /etc/dnsmasq.d/01-pihole.conf
|
echo "addn-hosts=/etc/pihole/gravity.list" >> /etc/dnsmasq.d/01-pihole.conf
|
||||||
restartDNS
|
restartDNS
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user