Follow symlinks with find

Incorporating https://github.com/pi-hole/pi-hole/pull/5997

Signed-off-by: MichaIng <micha@dietpi.com>
This commit is contained in:
MichaIng 2025-02-24 17:34:32 +01:00
parent 65bcb24d0e
commit 0b380d671d
No known key found for this signature in database
GPG Key ID: 1DF45FDB9C6CE851

6
advanced/Templates/pihole-FTL-prestart.sh Normal file → Executable file
View File

@ -12,9 +12,9 @@ FTL_PID_FILE="$(getFTLConfigValue files.pid)"
# Ensure that permissions are set so that pihole-FTL can edit all necessary files
mkdir -p /var/log/pihole
chown -R pihole:pihole /etc/pihole /var/log/pihole
find /etc/pihole /var/log/pihole -type d -exec chmod 0755 {} +
find /etc/pihole /var/log/pihole -type f ! \( -name '*.pem' -o -name '*.crt' \) -exec chmod 0640 {} +
find /etc/pihole /var/log/pihole -type f -name '*.pem' -o -name '*.crt' -exec chmod 0600 {} +
find /etc/pihole/ /var/log/pihole/ -type d -exec chmod 0755 {} +
find /etc/pihole/ /var/log/pihole/ -type f ! \( -name '*.pem' -o -name '*.crt' \) -exec chmod 0640 {} +
find /etc/pihole/ /var/log/pihole/ -type f -name '*.pem' -o -name '*.crt' -exec chmod 0600 {} +
# Logrotate config file need to be owned by root
chown root:root /etc/pihole/logrotate