mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-04-07 19:55:09 +02:00
Ensure gravity_Cleanup() checks the correct directory (#6131)
This commit is contained in:
commit
65b42c1c8f
14
gravity.sh
14
gravity.sh
@ -572,7 +572,7 @@ gravity_DownloadBlocklists() {
|
||||
echo ""
|
||||
done
|
||||
|
||||
gravity_Blackbody=true
|
||||
DownloadBlocklists_done=true
|
||||
}
|
||||
|
||||
compareLists() {
|
||||
@ -932,13 +932,13 @@ gravity_Cleanup() {
|
||||
# invalid_domains location
|
||||
rm "${GRAVITY_TMPDIR}"/*.ph-non-domains 2>/dev/null
|
||||
|
||||
# Ensure this function only runs when gravity_SetDownloadOptions() has completed
|
||||
if [[ "${gravity_Blackbody:-}" == true ]]; then
|
||||
# Remove any unused .domains files
|
||||
for file in "${piholeDir}"/*."${domainsExtension}"; do
|
||||
# If list is not in active array, then remove it
|
||||
# Ensure this function only runs when gravity_DownloadBlocklists() has completed
|
||||
if [[ "${DownloadBlocklists_done:-}" == true ]]; then
|
||||
# Remove any unused .domains/.etag/.sha files
|
||||
for file in "${listsCacheDir}"/*."${domainsExtension}"; do
|
||||
# If list is not in active array, then remove it and all associated files
|
||||
if [[ ! "${activeDomains[*]}" == *"${file}"* ]]; then
|
||||
rm -f "${file}" 2>/dev/null ||
|
||||
rm -f "${file}"* 2>/dev/null ||
|
||||
echo -e " ${CROSS} Failed to remove ${file##*/}"
|
||||
fi
|
||||
done
|
||||
|
Loading…
x
Reference in New Issue
Block a user