mirror of
https://github.com/pi-hole/pi-hole
synced 2025-03-06 03:06:07 +00:00
Fix gravity.sh -- Alpine / Docker specific issue (#6030)
This commit is contained in:
commit
edf336067a
@ -541,14 +541,16 @@ gravity_DownloadBlocklists() {
|
||||
# it (in case it doesn't exist)
|
||||
# First, check if the directory is writable
|
||||
directory="$(dirname -- "${saveLocation}")"
|
||||
if [ ! -w "${directory}" ]; then
|
||||
directory_permissions=$(stat -c %a ${directory})
|
||||
if [ $directory_permissions -lt 700 ]; 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)
|
||||
if [ -e "${saveLocation}" ] && [ ! -w "${saveLocation}" ]; then
|
||||
saveLocation_permissions=$(stat -c %a ${saveLocation})
|
||||
if [ -e "${saveLocation}" ] && [ ${saveLocation_permissions} -lt 600 ]; then
|
||||
echo -e " ${CROSS} Unable to write to ${saveLocation}"
|
||||
echo " Please run pihole -g as root"
|
||||
echo ""
|
||||
|
Loading…
Reference in New Issue
Block a user