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:
parent
5bb8163674
commit
53e3ff2b24
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user