From 5d7ef9281f3b7ee02070e3bb8797da4bc97007ca Mon Sep 17 00:00:00 2001 From: Jacob Salmela Date: Sat, 20 May 2017 02:01:56 -0500 Subject: [PATCH] get just the OS pretty name for Dan --- advanced/Scripts/piholeDebug.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index 8d57b085..c89218b6 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -90,9 +90,14 @@ get_distro_attributes() { local distro_attribute for distro_attribute in "${distro_info[@]}"; do - # Display the information with the ${INFO} icon - # No need to show the support URLs so they are grepped out - echo " ${INFO} ${distro_attribute}" | grep -v "_URL" | tr -d '"' + # Display the information with the ${INFO} icon (we need just the OS PRETTY_NAME) + pretty_name_key=$(echo "${distro_attribute}" | grep "PRETTY_NAME" | cut -d '=' -f1) + if [[ "${pretty_name_key}" == "PRETTY_NAME" ]]; then + PRETTY_NAME=$(echo "${distro_attribute}" | grep "PRETTY_NAME" | cut -d '=' -f2- | tr -d '"') + echo " ${INFO} ${PRETTY_NAME}" + else + : + fi done # Set the IFS back to what it was IFS="$OLD_IFS"