1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-12-22 14:58:08 +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:
DL6ER 2019-04-26 17:32:05 +02:00
parent 5bb8163674
commit 53e3ff2b24
No known key found for this signature in database
GPG Key ID: 00135ACBD90B28DD

View File

@ -125,7 +125,10 @@ database_table_from_file() {
# Read file line by line
grep -v '^ *#' < "${source}" | while IFS= read -r domain
do
echo "\"${domain}\",1,${timestamp}" >> "${tmpFile}"
# Only add non-empty lines
if [[ ! -z "${domain}" ]]; then
echo "\"${domain}\",1,${timestamp}" >> "${tmpFile}"
fi
done
inputfile="${tmpFile}"
fi