From 3a592471c69ddfbe68867bc3045b31a1dbc0d6a1 Mon Sep 17 00:00:00 2001 From: Michael Woolweaver Date: Fri, 14 Mar 2025 14:32:29 -0500 Subject: [PATCH] revert pi-hole/pi-hole/pull/6030 in preparation for pi-hole/docker-pi-hole/pull/1786 Signed-off-by: Michael Woolweaver --- gravity.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gravity.sh b/gravity.sh index 3a7db5ae..493f2b15 100755 --- a/gravity.sh +++ b/gravity.sh @@ -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 ""