From 685b775b680f2724076ae52d997d92651049fdd5 Mon Sep 17 00:00:00 2001 From: Tommy Huff Date: Thu, 20 Oct 2016 11:24:34 -0400 Subject: [PATCH] rework status if statments --- pihole | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pihole b/pihole index afabe9bb..29acfe29 100755 --- a/pihole +++ b/pihole @@ -130,10 +130,10 @@ piholeStatus() { if [[ $(cat /etc/dnsmasq.d/01-pihole.conf | grep "#addn-hosts=") ]] ; then if [[ "${1}" == "web" ]] ; then echo 0; else echo "::: pihole is Disabled"; fi else - if [[ $(cat /etc/dnsmasq.d/01-pihole.conf | grep "addn-hosts=") ]] ; then - if [[ "${1}" == "web" ]] ; then echo 1; else echo "::: pihole is Enabled"; fi - else - if [[ "${1}" == "web" ]] ; then echo 1; else + if [[ "${1}" == "web" ]] ; then echo 1; else + if [[ $(cat /etc/dnsmasq.d/01-pihole.conf | grep "addn-hosts=") ]] ; then + echo "::: pihole is Enabled"; + else echo "::: no hosts file linked to dnsmasq, adding it in enabled state" echo "addn-hosts=/etc/pihole/gravity.list" >> /etc/dnsmasq.d/01-pihole.conf restartDNS