From 9170488b0a73a11bbc0267de6b3747dab1d80094 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Wed, 28 Dec 2016 15:58:48 +0000 Subject: [PATCH] Test if DNS service is listening on local port 53 --- pihole | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pihole b/pihole index 5a54fae4..7021ab0a 100755 --- a/pihole +++ b/pihole @@ -185,6 +185,19 @@ piholeLogging() { } piholeStatus() { + if [[ $(netstat -plnt | grep -c ':53') > 0 ]]; then + if [[ "${1}" != "web" ]] ; then + echo "::: DNS service is running" + fi + else + if [[ "${1}" == "web" ]] ; then + echo "-1"; + else + echo "::: DNS service is NOT running" + fi + return + fi + if [[ $(grep -i "^#addn-hosts=/" /etc/dnsmasq.d/01-pihole.conf) ]] ; then #list is commented out if [[ "${1}" == "web" ]] ; then