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