From a3b3a7a34dfbef0eb73c915829bca18aedfca700 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Mon, 1 Aug 2016 21:43:13 +0100 Subject: [PATCH 1/3] Add option for uploading debug log to termbin --- advanced/Scripts/piholeDebug.sh | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index 36ae15bc..ec08c984 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -337,17 +337,27 @@ function dumpPiHoleLog { # Anything to be done after capturing of pihole.log terminates function finalWork { - echo "::: Finshed debugging!" - TERMBIN=$(cat /var/log/pihole_debug.log | nc termbin.com 9999) + echo "::: Finshed debugging!" + echo "::: The degug log can be uploaded to Termbin.com for easier sharing." + read -r -p "::: Would you like to upload the log? [y/N] " response + case $response in + [yY][eE][sS]|[yY]) + TERMBIN=$(cat /var/log/pihole_debug.log | nc termbin.com 9999) + ;; + *) + echo "::: Log will NOT be uploaded to Termbin." + ;; + esac - # Check if termbin.com is reachable. When it's not, point to local log instead - if [ -n "$TERMBIN" ] - then - echo "::: Debug log can be found at : $TERMBIN" - else - echo "::: Debug log can be found at : /var/log/pihole_debug.log" - fi + # Check if termbin.com is reachable. When it's not, point to local log instead + if [ -n "$TERMBIN" ] + then + echo "::: Debug log can be found at : $TERMBIN" + else + echo "::: Debug log can be found at : /var/log/pihole_debug.log" + fi } + trap finalWork EXIT ### Method calls for additional logging ### From 66ff9a24c6a2c37816702adc527aa802f9f90951 Mon Sep 17 00:00:00 2001 From: Promofaux Date: Mon, 1 Aug 2016 21:54:42 +0100 Subject: [PATCH 2/3] Add piholeDebug to the chmod 755 command in install script. Not sure how that went missing... --- automated install/basic-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 29e3237f..afd5f351 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -547,7 +547,7 @@ installScripts() { $SUDO cp /etc/.pihole/advanced/Scripts/updateDashboard.sh /opt/pihole/updateDashboard.sh $SUDO cp /etc/.pihole/automated\ install/uninstall.sh /opt/pihole/uninstall.sh $SUDO cp /etc/.pihole/advanced/Scripts/setupLCD.sh /opt/pihole/setupLCD.sh - $SUDO chmod 755 /opt/pihole/{gravity,chronometer,whitelist,blacklist,piholeLogFlush,updateDashboard,uninstall,setupLCD}.sh + $SUDO chmod 755 /opt/pihole/{gravity,chronometer,whitelist,blacklist,piholeDebug,piholeLogFlush,updateDashboard,uninstall,setupLCD}.sh $SUDO cp /etc/.pihole/pihole /usr/local/bin/pihole $SUDO chmod 755 /usr/local/bin/pihole $SUDO cp /etc/.pihole/advanced/bash-completion/pihole /etc/bash_completion.d/pihole From 95edb49bb824daa93fc37a57a014256844728d92 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Mon, 1 Aug 2016 21:43:13 +0100 Subject: [PATCH 3/3] Add option for uploading debug log to termbin --- advanced/Scripts/piholeDebug.sh | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index 36ae15bc..ec08c984 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -337,17 +337,27 @@ function dumpPiHoleLog { # Anything to be done after capturing of pihole.log terminates function finalWork { - echo "::: Finshed debugging!" - TERMBIN=$(cat /var/log/pihole_debug.log | nc termbin.com 9999) + echo "::: Finshed debugging!" + echo "::: The degug log can be uploaded to Termbin.com for easier sharing." + read -r -p "::: Would you like to upload the log? [y/N] " response + case $response in + [yY][eE][sS]|[yY]) + TERMBIN=$(cat /var/log/pihole_debug.log | nc termbin.com 9999) + ;; + *) + echo "::: Log will NOT be uploaded to Termbin." + ;; + esac - # Check if termbin.com is reachable. When it's not, point to local log instead - if [ -n "$TERMBIN" ] - then - echo "::: Debug log can be found at : $TERMBIN" - else - echo "::: Debug log can be found at : /var/log/pihole_debug.log" - fi + # Check if termbin.com is reachable. When it's not, point to local log instead + if [ -n "$TERMBIN" ] + then + echo "::: Debug log can be found at : $TERMBIN" + else + echo "::: Debug log can be found at : /var/log/pihole_debug.log" + fi } + trap finalWork EXIT ### Method calls for additional logging ###