From 42bff1ce1bda887b9cc49752667a0caee8390ce2 Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Fri, 28 Oct 2016 03:53:53 -0700 Subject: [PATCH] Move parse utility to be near other parsing functions. --- advanced/Scripts/piholeDebug.sh | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index 22a2a51a..385ca230 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -88,6 +88,20 @@ block_parse() { log_write "${1}" } +lsof_parse() { + local user + local process + local match + + user=$(echo ${1} | cut -f 3 -d ' ' | cut -c 2-) + process=$(echo ${1} | cut -f 2 -d ' ' | cut -c 2-) + if [[ ${2} -eq ${process} ]]; then + match="as required." + else + match="incorrectly." + fi + log_echo -l "by ${user} for ${process} ${match}" +} version_check() { header_write "Installed Package Versions" echo "::: Detecting Pi-hole installed versions." @@ -209,21 +223,7 @@ hostnameCheck() { log_write "No hosts file found!" printf ":::\tNo hosts file found!\n" fi -} - -lsof_parse() { - local user - local process - local match - - user=$(echo ${1} | cut -f 3 -d ' ' | cut -c 2-) - process=$(echo ${1} | cut -f 2 -d ' ' | cut -c 2-) - if [[ ${2} -eq ${process} ]]; then - match="as required." - else - match="incorrectly." - fi - log_echo -l "by ${user} for ${process} ${match}" + echo ":::" }