mirror of
https://github.com/pi-hole/pi-hole
synced 2025-07-23 23:48:09 +00:00
All gravity related files and dirs should be owned by pihole:pihole (#6186)
This commit is contained in:
commit
398405c303
@ -126,7 +126,7 @@ gravity_swap_databases() {
|
|||||||
oldAvail=false
|
oldAvail=false
|
||||||
if [ "${availableBlocks}" -gt "$((gravityBlocks * 2))" ] && [ -f "${gravityDBfile}" ]; then
|
if [ "${availableBlocks}" -gt "$((gravityBlocks * 2))" ] && [ -f "${gravityDBfile}" ]; then
|
||||||
oldAvail=true
|
oldAvail=true
|
||||||
cp "${gravityDBfile}" "${gravityOLDfile}"
|
cp -p "${gravityDBfile}" "${gravityOLDfile}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Drop the gravity and antigravity tables + subsequent VACUUM the current
|
# Drop the gravity and antigravity tables + subsequent VACUUM the current
|
||||||
@ -139,7 +139,7 @@ gravity_swap_databases() {
|
|||||||
else
|
else
|
||||||
# Check if the backup directory exists
|
# Check if the backup directory exists
|
||||||
if [ ! -d "${gravityBCKdir}" ]; then
|
if [ ! -d "${gravityBCKdir}" ]; then
|
||||||
mkdir -p "${gravityBCKdir}"
|
mkdir -p "${gravityBCKdir}" && chown pihole:pihole "${gravityBCKdir}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If multiple gravityBCKfile's are present (appended with a number), rotate them
|
# If multiple gravityBCKfile's are present (appended with a number), rotate them
|
||||||
@ -1022,7 +1022,7 @@ migrate_to_listsCache_dir() {
|
|||||||
# If not, we need to migrate the old files to the new directory
|
# If not, we need to migrate the old files to the new directory
|
||||||
local str="Migrating the list's cache directory to new location"
|
local str="Migrating the list's cache directory to new location"
|
||||||
echo -ne " ${INFO} ${str}..."
|
echo -ne " ${INFO} ${str}..."
|
||||||
mkdir -p "${listsCacheDir}"
|
mkdir -p "${listsCacheDir}" && chown pihole:pihole "${listsCacheDir}"
|
||||||
|
|
||||||
# Move the old files to the new directory
|
# Move the old files to the new directory
|
||||||
if mv "${piholeDir}"/list.* "${listsCacheDir}/" 2>/dev/null; then
|
if mv "${piholeDir}"/list.* "${listsCacheDir}/" 2>/dev/null; then
|
||||||
|
Loading…
Reference in New Issue
Block a user