From 83b0600863d787d005621820ce11dcd69b5cbc83 Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Mon, 27 Feb 2017 11:03:57 -0800 Subject: [PATCH] Carriage return or newline based webcalls. Signed-off-by: Dan Schaper --- advanced/Scripts/piholeDebug.sh | 10 ++++++++-- pihole | 9 ++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index 176a3ead..70d73379 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -332,11 +332,17 @@ debugLighttpd() { } countdown() { + local tuvix tuvix=${TIMEOUT} - printf "::: Logging will automatically teminate in ${TIMEOUT} seconds\n" + printf "::: Logging will automatically teminate in %s seconds\n" "${TIMEOUT}" while [ $tuvix -ge 1 ] do - printf ":::\t${tuvix} seconds left. \r" + printf ":::\t%s seconds left. " "${tuvix}" + if [[ -z "${WEBCALL}" ]]; then + printf "\r" + else + printf "\n" + fi sleep 5 tuvix=$(( tuvix - 5 )) done diff --git a/pihole b/pihole index e4d832a5..cfe032ff 100755 --- a/pihole +++ b/pihole @@ -46,11 +46,18 @@ wildcardFunc() { debugFunc() { local automated + local web + + # Pull off the `debug` leaving passed call augmentation flags in $1 shift if [[ "${1}" == "-a" ]]; then automated="true" fi - AUTOMATED=${automated:-} "${PI_HOLE_SCRIPT_DIR}"/piholeDebug.sh + if [[ "${2}" == "-w" ]]; then + web="true" + fi + + AUTOMATED=${automated:-} WEBCALL=${web:-} "${PI_HOLE_SCRIPT_DIR}"/piholeDebug.sh exit 0 }