test out new status logic

pull/823/head
tuplink 8 years ago
parent 685b775b68
commit 78fbafa1cd

@ -127,18 +127,30 @@ 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
else if [[ "${1}" == "web" ]] ; then
if [[ "${1}" == "web" ]] ; then echo 1; else echo 0;
if [[ $(cat /etc/dnsmasq.d/01-pihole.conf | grep "addn-hosts=") ]] ; then else
echo "::: pihole is Enabled"; echo "::: pihole is Disabled";
else fi
echo "::: no hosts file linked to dnsmasq, adding it in enabled state" elif [[ $(cat /etc/dnsmasq.d/01-pihole.conf | grep "addn-hosts=/") ]] ; then
echo "addn-hosts=/etc/pihole/gravity.list" >> /etc/dnsmasq.d/01-pihole.conf #list set
restartDNS if [[ "${1}" == "web" ]] ; then
fi echo 1;
else
echo "::: pihole is Enabled";
fi fi
else
#addn-host not found
if [[ "${1}" == "web" ]] ; then
echo 99
else
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
restartDNS
fi fi
} }

Loading…
Cancel
Save