From 5120d9ec33a570fe4ad07e5619c27cc18c21b4ea Mon Sep 17 00:00:00 2001 From: DL6ER Date: Thu, 8 Dec 2016 21:15:03 +0100 Subject: [PATCH 1/2] Add tail option --- pihole | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pihole b/pihole index 8adb15ed..9e727809 100755 --- a/pihole +++ b/pihole @@ -198,6 +198,10 @@ piholeStatus() { fi } +tailFunc() { + tail -F /var/log/pihole.log + exit 0 +} helpFunc() { cat << EOM @@ -211,6 +215,7 @@ helpFunc() { ::: -b, blacklist Blacklist domains ::: -d, debug Start a debugging session if having trouble ::: -f, flush Flush the pihole.log file +::: -t, tail Output the last lines of the pihole.log file. Lines are appended as the file grows ::: -up, updatePihole Update Pi-hole ::: -g, updateGravity Update the list of ad-serving domains ::: -s, setupLCD Automatically configures the Pi to use the 2.8 LCD screen to display stats on it @@ -256,5 +261,6 @@ case "${1}" in "status" ) piholeStatus "$2";; "restartdns" ) restartDNS;; "-a" | "admin" ) webpageFunc "$@";; + "-t" | "tail" ) tailFunc;; * ) helpFunc;; esac From b591df55b0c44540ced89561ae53a9846b636236 Mon Sep 17 00:00:00 2001 From: Mcat12 Date: Thu, 8 Dec 2016 16:35:50 -0500 Subject: [PATCH 2/2] Tell user how to exit tail command --- pihole | 1 + 1 file changed, 1 insertion(+) diff --git a/pihole b/pihole index 9e727809..2ab51c05 100755 --- a/pihole +++ b/pihole @@ -199,6 +199,7 @@ piholeStatus() { } tailFunc() { + echo "Press Ctrl-C to exit" tail -F /var/log/pihole.log exit 0 }