From 6f03e3015154bb018a920c4cd27c9c2663d7b76e Mon Sep 17 00:00:00 2001 From: Jacob Salmela Date: Fri, 8 Dec 2017 18:23:55 -0600 Subject: [PATCH 1/2] fixes #1537 by checking if systemctl is found Signed-off-by: Jacob Salmela --- advanced/Scripts/piholeDebug.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index d69c5e4d..f8955637 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -212,7 +212,7 @@ copy_to_debug_log() { # uploaded to our server, since it can't properly display in color # This is accomplished by use sed to remove characters matching that patter # The entire file is then copied over to a sanitized version of the log - sed 's/\[[0-9;]\{1,5\}m//g' > "${PIHOLE_DEBUG_LOG_SANITIZED}" <<< cat "${PIHOLE_DEBUG_LOG}" + # sed 's/\[[0-9;]\{1,5\}m//g' > "${PIHOLE_DEBUG_LOG_SANITIZED}" <<< cat "${PIHOLE_DEBUG_LOG}" } initiate_debug() { @@ -809,8 +809,14 @@ process_status(){ local i # For each process, for i in "${PIHOLE_PROCESSES[@]}"; do - # get its status via systemctl - local status_of_process=$(systemctl is-active "${i}") + # If systemd + if command -v systemctl &> /dev/null; then + # get its status via systemctl + local status_of_process=$(systemctl is-active "${i}") + else + # Otherwise, use the service command + local status_of_process=$(service "${i}" status | awk '/Active:/ {print $2}') &> /dev/null + fi # and print it out to the user if [[ "${status_of_process}" == "active" ]]; then # If it's active, show it in green From 28bed0041ec668447d7e26de1870ed8977207b33 Mon Sep 17 00:00:00 2001 From: Jacob Salmela Date: Fri, 8 Dec 2017 18:29:28 -0600 Subject: [PATCH 2/2] remove comment Signed-off-by: Jacob Salmela --- advanced/Scripts/piholeDebug.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index f8955637..64334241 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -212,7 +212,7 @@ copy_to_debug_log() { # uploaded to our server, since it can't properly display in color # This is accomplished by use sed to remove characters matching that patter # The entire file is then copied over to a sanitized version of the log - # sed 's/\[[0-9;]\{1,5\}m//g' > "${PIHOLE_DEBUG_LOG_SANITIZED}" <<< cat "${PIHOLE_DEBUG_LOG}" + sed 's/\[[0-9;]\{1,5\}m//g' > "${PIHOLE_DEBUG_LOG_SANITIZED}" <<< cat "${PIHOLE_DEBUG_LOG}" } initiate_debug() {