From 9b8efe1b27f296fafc88652b43e46afd6bd4223a Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 3 Jul 2016 19:50:42 -0400 Subject: [PATCH] Upload log to sprunge.us --- advanced/Scripts/piholeDebug.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index a5958bbd..dfe9f4ac 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -330,8 +330,16 @@ function dumpPiHoleLog { # Anything to be done after capturing of pihole.log terminates function finalWork { - echo "::: Finshed debugging!" - echo "::: Debug log can be found at : /var/log/pihole_debug.log" + echo "::: Finshed debugging!" + SPRUNGE=$(cat /var/log/pihole_debug.log | curl --silent --connect-timeout 5 -F 'sprunge=<-' http://sprunge.us) + + # Check if sprunge.us is reachable. When it's not, point to local log instead + if [ -n "$SPRUNGE" ] + then + echo "::: Debug log can be found at : $SPRUNGE" + else + echo "::: Debug log can be found at : /var/log/pihole_debug.log" + fi } trap finalWork EXIT