mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-07-28 16:14:07 +02:00
ensure gravity_Cleanup() checks the correct directory for list data
also glob with * to ensure .etag & .sha1 are removed as well should fix #6075 Co-authored-by: yubiuser <github@yubiuser.dev> Signed-off-by: Michael Woolweaver <michael@woolweaver.bid>
This commit is contained in:
parent
8797a0df05
commit
e548ed043f
14
gravity.sh
14
gravity.sh
@ -572,7 +572,7 @@ gravity_DownloadBlocklists() {
|
|||||||
echo ""
|
echo ""
|
||||||
done
|
done
|
||||||
|
|
||||||
gravity_Blackbody=true
|
DownloadBlocklists_done=true
|
||||||
}
|
}
|
||||||
|
|
||||||
compareLists() {
|
compareLists() {
|
||||||
@ -932,13 +932,13 @@ gravity_Cleanup() {
|
|||||||
# invalid_domains location
|
# invalid_domains location
|
||||||
rm "${GRAVITY_TMPDIR}"/*.ph-non-domains 2>/dev/null
|
rm "${GRAVITY_TMPDIR}"/*.ph-non-domains 2>/dev/null
|
||||||
|
|
||||||
# Ensure this function only runs when gravity_SetDownloadOptions() has completed
|
# Ensure this function only runs when gravity_DownloadBlocklists() has completed
|
||||||
if [[ "${gravity_Blackbody:-}" == true ]]; then
|
if [[ "${DownloadBlocklists_done:-}" == true ]]; then
|
||||||
# Remove any unused .domains files
|
# Remove any unused .domains/.etag/.sha files
|
||||||
for file in "${piholeDir}"/*."${domainsExtension}"; do
|
for file in "${listsCacheDir}"/*."${domainsExtension}"; do
|
||||||
# If list is not in active array, then remove it
|
# If list is not in active array, then remove it and all associated files
|
||||||
if [[ ! "${activeDomains[*]}" == *"${file}"* ]]; then
|
if [[ ! "${activeDomains[*]}" == *"${file}"* ]]; then
|
||||||
rm -f "${file}" 2>/dev/null ||
|
rm -f "${file}"* 2>/dev/null ||
|
||||||
echo -e " ${CROSS} Failed to remove ${file##*/}"
|
echo -e " ${CROSS} Failed to remove ${file##*/}"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user