revert pi-hole/pi-hole/pull/6030

in preparation for pi-hole/docker-pi-hole/pull/1786

Signed-off-by: Michael Woolweaver <michael@woolweaver.bid>
This commit is contained in:
Michael Woolweaver 2025-03-14 14:32:29 -05:00 committed by GitHub
parent 3f5c00919b
commit 3a592471c6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -541,16 +541,14 @@ gravity_DownloadBlocklists() {
# it (in case it doesn't exist)
# First, check if the directory is writable
directory="$(dirname -- "${saveLocation}")"
directory_permissions=$(stat -c %a ${directory})
if [ $directory_permissions -lt 700 ]; then
if [ ! -w "${directory}" ]; then
echo -e " ${CROSS} Unable to write to ${directory}"
echo " Please run pihole -g as root"
echo ""
continue
fi
# Then, check if the file is writable (if it exists)
saveLocation_permissions=$(stat -c %a ${saveLocation})
if [ -e "${saveLocation}" ] && [ ${saveLocation_permissions} -lt 600 ]; then
if [ -e "${saveLocation}" ] && [ ! -w "${saveLocation}" ]; then
echo -e " ${CROSS} Unable to write to ${saveLocation}"
echo " Please run pihole -g as root"
echo ""