1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-11-18 22:28:18 +00:00

Set file owner and permission to symlinks

Signed-off-by: Christian König <ckoenig@posteo.de>
This commit is contained in:
Christian König 2022-05-18 22:06:36 +02:00
parent 60615e60aa
commit 08faf21b2e
No known key found for this signature in database
GPG Key ID: 4CDA6F249DD2B485

View File

@ -85,8 +85,17 @@ start() {
# Backward compatibility for user-scripts that still expect log files in /var/log instead of /var/log/pihole/ # Backward compatibility for user-scripts that still expect log files in /var/log instead of /var/log/pihole/
# Should be removed with Pi-hole v6.0 # Should be removed with Pi-hole v6.0
[ ! -f /var/log/pihole.log ] && ln -s /var/log/pihole/pihole.log /var/log/pihole.log if [ ! -f /var/log/pihole.log ]; then
[ ! -f /var/log/pihole-FTL.log ] && ln -s /var/log/pihole/pihole-FTL.log /var/log/pihole-FTL.log ln -s /var/log/pihole/pihole.log /var/log/pihole.log
chown pihole:pihole /var/log/pihole.log
chmod -f 0644 /var/log/pihole.log
fi
if [ ! -f /var/log/pihole-FTL.log ]; then
ln -s /var/log/pihole/pihole-FTL.log /var/log/pihole-FTL.log
chown pihole:pihole /var/log/pihole-FTL.log
chmod -f 0644 /var/log/pihole-FTL.log
fi
if setcap CAP_NET_BIND_SERVICE,CAP_NET_RAW,CAP_NET_ADMIN,CAP_SYS_NICE,CAP_IPC_LOCK,CAP_CHOWN+eip "/usr/bin/pihole-FTL"; then if setcap CAP_NET_BIND_SERVICE,CAP_NET_RAW,CAP_NET_ADMIN,CAP_SYS_NICE,CAP_IPC_LOCK,CAP_CHOWN+eip "/usr/bin/pihole-FTL"; then
su -s /bin/sh -c "/usr/bin/pihole-FTL" pihole su -s /bin/sh -c "/usr/bin/pihole-FTL" pihole