mirror of
https://github.com/pi-hole/pi-hole
synced 2024-12-22 14:58:08 +00:00
Only update time of last list change when we see a list for the first time or when it really changed content
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
parent
8c56f54a1e
commit
a216848c1d
@ -524,6 +524,7 @@ compareLists() {
|
|||||||
sha1sum "${target}" > "${target}.sha1"
|
sha1sum "${target}" > "${target}.sha1"
|
||||||
echo " ${INFO} List has been updated"
|
echo " ${INFO} List has been updated"
|
||||||
database_adlist_status "${adlistID}" "1"
|
database_adlist_status "${adlistID}" "1"
|
||||||
|
database_adlist_updated "${adlistID}"
|
||||||
else
|
else
|
||||||
echo " ${INFO} List stayed unchanged"
|
echo " ${INFO} List stayed unchanged"
|
||||||
database_adlist_status "${adlistID}" "2"
|
database_adlist_status "${adlistID}" "2"
|
||||||
@ -531,8 +532,10 @@ compareLists() {
|
|||||||
else
|
else
|
||||||
# No checksum available, create one for comparing on the next run
|
# No checksum available, create one for comparing on the next run
|
||||||
sha1sum "${target}" > "${target}.sha1"
|
sha1sum "${target}" > "${target}.sha1"
|
||||||
|
echo " ${INFO} This list is new"
|
||||||
# We assume here it was changed upstream
|
# We assume here it was changed upstream
|
||||||
database_adlist_status "${adlistID}" "1"
|
database_adlist_status "${adlistID}" "1"
|
||||||
|
database_adlist_updated "${adlistID}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -635,8 +638,8 @@ gravity_DownloadBlocklistFromUrl() {
|
|||||||
parseList "${adlistID}" "${saveLocation}" "${target}"
|
parseList "${adlistID}" "${saveLocation}" "${target}"
|
||||||
# Compare lists, are they identical?
|
# Compare lists, are they identical?
|
||||||
compareLists "${adlistID}" "${saveLocation}"
|
compareLists "${adlistID}" "${saveLocation}"
|
||||||
# Update gravity database table (status is set in compareLists)
|
# Update gravity database table (status and updated timestamp are set in
|
||||||
database_adlist_updated "${adlistID}"
|
# compareLists)
|
||||||
database_adlist_number "${adlistID}"
|
database_adlist_number "${adlistID}"
|
||||||
done="true"
|
done="true"
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user