From 9a421d510a1cce8aef3a6b98991f467cc188e86a Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Sat, 1 Oct 2016 13:16:58 -0700 Subject: [PATCH] Ignore comments in adlists.list section. --- advanced/Scripts/piholeDebug.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index 718b6c74..aadb083b 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -81,7 +81,6 @@ function version_check { echo "::: Writing PHP version to logfile." php_ver="$(php -v |& head -n1)" && log_write "${php_ver}" || log_write "PHP not installed." - } function distro_check { @@ -190,7 +189,7 @@ function hostnameCheck { } function portCheck { - echo "############################################################" >> ${DEBUG_LOG} + echo "############################################################" >> ${DEBUG_LOG} echo "######## Open Port Information #########" >> ${DEBUG_LOG} echo "############################################################" >> ${DEBUG_LOG} @@ -407,7 +406,12 @@ echo "############ adlists.list #############" >> ${DEBUG_LOG} echo "#######################################" >> ${DEBUG_LOG} if [ -e "$ADLISTSFILE" ] then - cat "$ADLISTSFILE" >> ${DEBUG_LOG} + while read -r line; do + if [ ! -z "$line" ]; then + [[ "$line" =~ ^#.*$ ]] && continue + echo "$line" >> ${DEBUG_LOG} + fi + done < "$ADLISTSFILE" echo >> ${DEBUG_LOG} else echo "No adlists.list file found... using adlists.default!" >> ${DEBUG_LOG}