mirror of
https://github.com/pi-hole/pi-hole
synced 2025-01-03 12:40:56 +00:00
Merge pull request #932 from pi-hole/feature/debug_timeout
feature/debug_timeout
This commit is contained in:
commit
4333e5487b
@ -27,7 +27,7 @@ PIHOLELOG="/var/log/pihole.log"
|
|||||||
WHITELISTMATCHES="/tmp/whitelistmatches.list"
|
WHITELISTMATCHES="/tmp/whitelistmatches.list"
|
||||||
|
|
||||||
IPV6_READY=false
|
IPV6_READY=false
|
||||||
|
TIMEOUT=60
|
||||||
# Header info and introduction
|
# Header info and introduction
|
||||||
cat << EOM
|
cat << EOM
|
||||||
::: Beginning Pi-hole debug at $(date)!
|
::: Beginning Pi-hole debug at $(date)!
|
||||||
@ -316,6 +316,16 @@ debugLighttpd() {
|
|||||||
echo ":::"
|
echo ":::"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
countdown() {
|
||||||
|
tuvix=${TIMEOUT}
|
||||||
|
printf "::: Logging will automatically teminate in ${TIMEOUT} seconds\n"
|
||||||
|
while [ $tuvix -ge 1 ]
|
||||||
|
do
|
||||||
|
printf ":::\t${tuvix} seconds left. \r"
|
||||||
|
sleep 5
|
||||||
|
tuvix=$(( tuvix - 5 ))
|
||||||
|
done
|
||||||
|
}
|
||||||
### END FUNCTIONS ###
|
### END FUNCTIONS ###
|
||||||
|
|
||||||
# Gather version of required packages / repositories
|
# Gather version of required packages / repositories
|
||||||
@ -356,10 +366,9 @@ dumpPiHoleLog() {
|
|||||||
echo -e "::: Try loading a site that you are having trouble with now from a client web browser.. \n:::\t(Press CTRL+C to finish logging.)"
|
echo -e "::: Try loading a site that you are having trouble with now from a client web browser.. \n:::\t(Press CTRL+C to finish logging.)"
|
||||||
header_write "pihole.log"
|
header_write "pihole.log"
|
||||||
if [ -e "${PIHOLELOG}" ]; then
|
if [ -e "${PIHOLELOG}" ]; then
|
||||||
while true; do
|
# Dummy process to use for flagging down tail to terminate
|
||||||
tail -f "${PIHOLELOG}" >> ${DEBUG_LOG}
|
countdown &
|
||||||
log_write ""
|
tail -n0 -f --pid=$! "${PIHOLELOG}" >> ${DEBUG_LOG}
|
||||||
done
|
|
||||||
else
|
else
|
||||||
log_write "No pihole.log file found!"
|
log_write "No pihole.log file found!"
|
||||||
printf ":::\tNo pihole.log file found!\n"
|
printf ":::\tNo pihole.log file found!\n"
|
||||||
|
Loading…
Reference in New Issue
Block a user