1
0
mirror of https://github.com/pi-hole/pi-hole synced 2025-02-11 15:42:38 +00:00

Merge branch 'development' into new/etags

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER 2025-01-29 19:24:31 +01:00
commit 68b03e114c
No known key found for this signature in database
GPG Key ID: 00135ACBD90B28DD

View File

@ -414,7 +414,7 @@ gravity_DownloadBlocklists() {
echo -e " ${INFO} Storing gravity database in ${COL_BOLD}${gravityDBfile}${COL_NC}" echo -e " ${INFO} Storing gravity database in ${COL_BOLD}${gravityDBfile}${COL_NC}"
fi fi
local url domain str target compression adlist_type directory curlVersion local url domain str target compression adlist_type directory curlVersion success
echo "" echo ""
# Prepare new gravity database # Prepare new gravity database
@ -448,16 +448,18 @@ gravity_DownloadBlocklists() {
echo -e "\\n ${CROSS} Unable to copy data from ${gravityDBfile} to ${gravityTEMPfile}\\n ${output}" echo -e "\\n ${CROSS} Unable to copy data from ${gravityDBfile} to ${gravityTEMPfile}\\n ${output}"
# Try to attempt a backup restore # Try to attempt a backup restore
success=false
if [[ -d "${gravityBCKdir}" ]]; then if [[ -d "${gravityBCKdir}" ]]; then
for i in {1..10}; do for i in {1..10}; do
if try_restore_backup "${i}"; then if try_restore_backup "${i}"; then
success=true
break break
fi fi
done done
fi fi
# If none of the attempts worked, return 1 # If none of the attempts worked, return 1
if [[ "${i}" -eq 10 ]]; then if [[ "${success}" == false ]]; then
pihole-FTL sqlite3 "${gravityTEMPfile}" "INSERT OR REPLACE INTO info (property,value) values ('gravity_restored','failed');" pihole-FTL sqlite3 "${gravityTEMPfile}" "INSERT OR REPLACE INTO info (property,value) values ('gravity_restored','failed');"
return 1 return 1
fi fi