mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-02-17 17:04:07 +00:00
Automatically upload log file to sprunge.us
========================================== Adds the function to upload log file. When their are connection issues, the log file will be output in the original fasion. Otherwise, the user will be presented now with a link the resembles sprunge.us/XXXX
This commit is contained in:
parent
024b741552
commit
7f8ad44b00
1 changed files with 10 additions and 2 deletions
|
@ -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.
|
||||
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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue