mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-24 13:50:17 +00:00
Fill comment field with NULL (default) instead of empty string and use a variable for the timestamp instead of periodically calling date
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
parent
f9250d91a5
commit
61840edb30
1 changed files with 3 additions and 1 deletions
|
@ -118,12 +118,14 @@ gravity_store_in_database() {
|
|||
|
||||
local tmpFile
|
||||
tmpFile="$(mktemp -p "/tmp" --suffix=".gravity")"
|
||||
local timestamp
|
||||
timestamp="$(date --utc +'%s')"
|
||||
if [ "$table" == "whitelist" ] || [ "$table" == "blacklist" ] || [ "$table" == "regex" ]; then
|
||||
# Apply format for white-, blacklist, and regex tables
|
||||
# Read file line by line
|
||||
grep -v '^ *#' < "${source}" | while IFS= read -r domain
|
||||
do
|
||||
echo "\"${domain}\",1,$(date --utc +'%s')," >> "${tmpFile}"
|
||||
echo "\"${domain}\",1,${timestamp}" >> "${tmpFile}"
|
||||
done
|
||||
inputfile="${tmpFile}"
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue