mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-05-10 01:44:13 +02:00
commit
e5cb0efd61
1 changed files with 2 additions and 4 deletions
|
@ -541,16 +541,14 @@ gravity_DownloadBlocklists() {
|
||||||
# it (in case it doesn't exist)
|
# it (in case it doesn't exist)
|
||||||
# First, check if the directory is writable
|
# First, check if the directory is writable
|
||||||
directory="$(dirname -- "${saveLocation}")"
|
directory="$(dirname -- "${saveLocation}")"
|
||||||
directory_permissions=$(stat -c %a ${directory})
|
if [ ! -w "${directory}" ]; then
|
||||||
if [ $directory_permissions -lt 700 ]; then
|
|
||||||
echo -e " ${CROSS} Unable to write to ${directory}"
|
echo -e " ${CROSS} Unable to write to ${directory}"
|
||||||
echo " Please run pihole -g as root"
|
echo " Please run pihole -g as root"
|
||||||
echo ""
|
echo ""
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
# Then, check if the file is writable (if it exists)
|
# Then, check if the file is writable (if it exists)
|
||||||
saveLocation_permissions=$(stat -c %a ${saveLocation})
|
if [ -e "${saveLocation}" ] && [ ! -w "${saveLocation}" ]; then
|
||||||
if [ -e "${saveLocation}" ] && [ ${saveLocation_permissions} -lt 600 ]; then
|
|
||||||
echo -e " ${CROSS} Unable to write to ${saveLocation}"
|
echo -e " ${CROSS} Unable to write to ${saveLocation}"
|
||||||
echo " Please run pihole -g as root"
|
echo " Please run pihole -g as root"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue