From 8f8dc66c7052999920d2f83c4f5f1df6d1622646 Mon Sep 17 00:00:00 2001 From: nate Date: Thu, 24 Mar 2016 18:50:53 -0500 Subject: [PATCH] Ignore whitespace when writing config files --- advanced/Scripts/piholeDebug.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index 8bb741ea..e84e9319 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -100,8 +100,10 @@ if [ -e "$DNSMASQFILE" ] then #cat $DNSMASQFILE >> $DEBUG_LOG while read -r line; do - [[ "$line" =~ ^#.*$ ]] && continue - echo "$line" >> $DEBUG_LOG + if [ ! -z "$line" ]; then + [[ "$line" =~ ^#.*$ ]] && continue + echo "$line" >> $DEBUG_LOG + fi done < "$DNSMASQFILE" echo >> $DEBUG_LOG else @@ -117,8 +119,10 @@ if [ -e "$PIHOLECONFFILE" ] then #cat "$PIHOLECONFFILE" >> $DEBUG_LOG while read -r line; do - [[ "$line" =~ ^#.*$ ]] && continue - echo "$line" >> $DEBUG_LOG + if [ ! -z "$line" ]; then + [[ "$line" =~ ^#.*$ ]] && continue + echo "$line" >> $DEBUG_LOG + fi done < "$PIHOLECONFFILE" echo >> $DEBUG_LOG else @@ -134,8 +138,10 @@ if [ -e "$LIGHTTPDFILE" ] then #cat "$PIHOLECONFFILE" >> $DEBUG_LOG while read -r line; do - [[ "$line" =~ ^#.*$ ]] && continue - echo "$line" >> $DEBUG_LOG + if [ ! -z "$line" ]; then + [[ "$line" =~ ^#.*$ ]] && continue + echo "$line" >> $DEBUG_LOG + fi done < "$LIGHTTPDFILE" echo >> $DEBUG_LOG else