From 19b656132d98e386f249125f5d73ac00117c74f0 Mon Sep 17 00:00:00 2001 From: Promofaux Date: Tue, 6 Sep 2016 19:16:04 +0100 Subject: [PATCH 1/2] Make the output of pihole -q a bit clearer. Bye Bye nifty one-liner! --- pihole | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pihole b/pihole index 29f8821b..573fb118 100755 --- a/pihole +++ b/pihole @@ -72,7 +72,16 @@ function setupLCDFunction { function queryFunc { domain=$2 - for list in /etc/pihole/list.*;do echo $list;grep ${domain} $list;done + for list in /etc/pihole/list.* + do + count=$(grep ${domain} $list | wc -l) + + if [[ ${count} > 0 ]]; then + echo "::: ${list} (${count} results)" + grep ${domain} ${list} + echo "" + fi + done exit 1 } From 4ec01769cb9a883c7e8f26c3117e5303eae87cea Mon Sep 17 00:00:00 2001 From: Promofaux Date: Tue, 6 Sep 2016 19:21:56 +0100 Subject: [PATCH 2/2] Appease Jacob. --- pihole | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pihole b/pihole index 573fb118..bd948b55 100755 --- a/pihole +++ b/pihole @@ -75,12 +75,11 @@ function queryFunc { for list in /etc/pihole/list.* do count=$(grep ${domain} $list | wc -l) - + echo "::: ${list} (${count} results)" if [[ ${count} > 0 ]]; then - echo "::: ${list} (${count} results)" grep ${domain} ${list} - echo "" fi + echo "" done exit 1 }