1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-11-18 06:08:21 +00:00

Ignore whitespace when writing config files

This commit is contained in:
nate 2016-03-24 18:50:53 -05:00
parent b746250e71
commit 8f8dc66c70

View File

@ -100,8 +100,10 @@ if [ -e "$DNSMASQFILE" ]
then then
#cat $DNSMASQFILE >> $DEBUG_LOG #cat $DNSMASQFILE >> $DEBUG_LOG
while read -r line; do while read -r line; do
if [ ! -z "$line" ]; then
[[ "$line" =~ ^#.*$ ]] && continue [[ "$line" =~ ^#.*$ ]] && continue
echo "$line" >> $DEBUG_LOG echo "$line" >> $DEBUG_LOG
fi
done < "$DNSMASQFILE" done < "$DNSMASQFILE"
echo >> $DEBUG_LOG echo >> $DEBUG_LOG
else else
@ -117,8 +119,10 @@ if [ -e "$PIHOLECONFFILE" ]
then then
#cat "$PIHOLECONFFILE" >> $DEBUG_LOG #cat "$PIHOLECONFFILE" >> $DEBUG_LOG
while read -r line; do while read -r line; do
if [ ! -z "$line" ]; then
[[ "$line" =~ ^#.*$ ]] && continue [[ "$line" =~ ^#.*$ ]] && continue
echo "$line" >> $DEBUG_LOG echo "$line" >> $DEBUG_LOG
fi
done < "$PIHOLECONFFILE" done < "$PIHOLECONFFILE"
echo >> $DEBUG_LOG echo >> $DEBUG_LOG
else else
@ -134,8 +138,10 @@ if [ -e "$LIGHTTPDFILE" ]
then then
#cat "$PIHOLECONFFILE" >> $DEBUG_LOG #cat "$PIHOLECONFFILE" >> $DEBUG_LOG
while read -r line; do while read -r line; do
if [ ! -z "$line" ]; then
[[ "$line" =~ ^#.*$ ]] && continue [[ "$line" =~ ^#.*$ ]] && continue
echo "$line" >> $DEBUG_LOG echo "$line" >> $DEBUG_LOG
fi
done < "$LIGHTTPDFILE" done < "$LIGHTTPDFILE"
echo >> $DEBUG_LOG echo >> $DEBUG_LOG
else else