mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 10:43:55 +00:00
Only add non-empty lines when moving file content into database tables
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
parent
5bb8163674
commit
53e3ff2b24
1 changed files with 4 additions and 1 deletions
|
@ -125,7 +125,10 @@ database_table_from_file() {
|
||||||
# Read file line by line
|
# Read file line by line
|
||||||
grep -v '^ *#' < "${source}" | while IFS= read -r domain
|
grep -v '^ *#' < "${source}" | while IFS= read -r domain
|
||||||
do
|
do
|
||||||
|
# Only add non-empty lines
|
||||||
|
if [[ ! -z "${domain}" ]]; then
|
||||||
echo "\"${domain}\",1,${timestamp}" >> "${tmpFile}"
|
echo "\"${domain}\",1,${timestamp}" >> "${tmpFile}"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
inputfile="${tmpFile}"
|
inputfile="${tmpFile}"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue