Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/pi-hole/pi-hole.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDL6ER <dl6er@dl6er.de>2020-12-29 22:28:09 +0300
committerDL6ER <dl6er@dl6er.de>2020-12-29 22:28:09 +0300
commita216848c1db65dc1be5a1928e3f225c7f10be694 (patch)
tree1da65760eac66ecc4bd843bb937f8a30e1ffd75c /gravity.sh
parent8c56f54a1e4a0ad659914471f8aeb8d92b259956 (diff)
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>
Diffstat (limited to 'gravity.sh')
-rwxr-xr-xgravity.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/gravity.sh b/gravity.sh
index 1defa06f..0119b710 100755
--- a/gravity.sh
+++ b/gravity.sh
@@ -524,6 +524,7 @@ compareLists() {
sha1sum "${target}" > "${target}.sha1"
echo " ${INFO} List has been updated"
database_adlist_status "${adlistID}" "1"
+ database_adlist_updated "${adlistID}"
else
echo " ${INFO} List stayed unchanged"
database_adlist_status "${adlistID}" "2"
@@ -531,8 +532,10 @@ compareLists() {
else
# No checksum available, create one for comparing on the next run
sha1sum "${target}" > "${target}.sha1"
+ echo " ${INFO} This list is new"
# We assume here it was changed upstream
database_adlist_status "${adlistID}" "1"
+ database_adlist_updated "${adlistID}"
fi
}
@@ -635,8 +638,8 @@ gravity_DownloadBlocklistFromUrl() {
parseList "${adlistID}" "${saveLocation}" "${target}"
# Compare lists, are they identical?
compareLists "${adlistID}" "${saveLocation}"
- # Update gravity database table (status is set in compareLists)
- database_adlist_updated "${adlistID}"
+ # Update gravity database table (status and updated timestamp are set in
+ # compareLists)
database_adlist_number "${adlistID}"
done="true"
else