mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-23 21:30:17 +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
|
||||
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 a new issue