From 36937b19132df631220e4a5912f889e58a357cbc Mon Sep 17 00:00:00 2001 From: DL6ER Date: Wed, 2 Dec 2020 20:52:39 +0100 Subject: [PATCH] Strip such lines starting with a #. Do not silently truncate lines if they have a # somewhere in between (like server=127.0.0.1#5353) Signed-off-by: DL6ER --- 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 5c2b5f1c..30ca6031 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -977,7 +977,7 @@ make_array_from_file() { # Otherwise, read the file line by line while IFS= read -r line;do # Othwerise, strip out comments and blank lines - new_line=$(echo "${line}" | sed -e 's/#.*$//' -e '/^$/d') + new_line=$(echo "${line}" | sed -e 's/^\s*#.*$//' -e '/^$/d') # If the line still has content (a non-zero value) if [[ -n "${new_line}" ]]; then # Put it into the array