mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-25 15:43:19 +00:00
Remove obsolet files and log file symlink code (#5711)
This commit is contained in:
commit
a16e053b2a
5 changed files with 0 additions and 55 deletions
|
@ -1,10 +0,0 @@
|
||||||
---
|
|
||||||
linters:
|
|
||||||
shellcheck:
|
|
||||||
shell: bash
|
|
||||||
phpcs:
|
|
||||||
flake8:
|
|
||||||
max-line-length: 120
|
|
||||||
yamllint:
|
|
||||||
config: ./.yamllint.conf
|
|
||||||
remarklint:
|
|
|
@ -1,3 +0,0 @@
|
||||||
rules:
|
|
||||||
line-length: disable
|
|
||||||
document-start: disable
|
|
|
@ -32,15 +32,3 @@ find /etc/pihole -type d -exec chmod 0755 {} \;
|
||||||
[ -f /var/log/pihole/FTL.log ] || install -m 640 -o pihole -g pihole /dev/null /var/log/pihole/FTL.log
|
[ -f /var/log/pihole/FTL.log ] || install -m 640 -o pihole -g pihole /dev/null /var/log/pihole/FTL.log
|
||||||
[ -f /var/log/pihole/pihole.log ] || install -m 640 -o pihole -g pihole /dev/null /var/log/pihole/pihole.log
|
[ -f /var/log/pihole/pihole.log ] || install -m 640 -o pihole -g pihole /dev/null /var/log/pihole/pihole.log
|
||||||
[ -f /etc/pihole/dhcp.leases ] || install -m 644 -o pihole -g pihole /dev/null /etc/pihole/dhcp.leases
|
[ -f /etc/pihole/dhcp.leases ] || install -m 644 -o pihole -g pihole /dev/null /etc/pihole/dhcp.leases
|
||||||
|
|
||||||
|
|
||||||
# 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
|
|
||||||
if [ ! -f /var/log/pihole.log ]; then
|
|
||||||
ln -sf /var/log/pihole/pihole.log /var/log/pihole.log
|
|
||||||
chown -h pihole:pihole /var/log/pihole.log
|
|
||||||
fi
|
|
||||||
if [ ! -f /var/log/pihole-FTL.log ]; then
|
|
||||||
ln -sf /var/log/pihole/FTL.log /var/log/pihole-FTL.log
|
|
||||||
chown -h pihole:pihole /var/log/pihole-FTL.log
|
|
||||||
fi
|
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
#; Pi-hole FTL config file
|
|
||||||
#; Comments should start with #; to avoid issues with PHP and bash reading this file
|
|
|
@ -2323,34 +2323,6 @@ main() {
|
||||||
# the service before enabling causes installer to exit
|
# the service before enabling causes installer to exit
|
||||||
enable_service pihole-FTL
|
enable_service pihole-FTL
|
||||||
|
|
||||||
# If this is an update from a previous Pi-hole installation
|
|
||||||
# we need to move any existing `pihole*` logs from `/var/log` to `/var/log/pihole`
|
|
||||||
# if /var/log/pihole.log is not a symlink (set during FTL startup) move the files
|
|
||||||
# can be removed with Pi-hole v6.0
|
|
||||||
# To be sure FTL is not running when we move the files we explicitly stop it here
|
|
||||||
|
|
||||||
stop_service pihole-FTL &>/dev/null
|
|
||||||
|
|
||||||
if [ ! -d /var/log/pihole/ ]; then
|
|
||||||
mkdir -m 0755 /var/log/pihole/
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Special handling for pihole-FTL.log -> pihole/FTL.log
|
|
||||||
if [ -f /var/log/pihole-FTL.log ] && [ ! -L /var/log/pihole-FTL.log ]; then
|
|
||||||
# /var/log/pihole-FTL.log -> /var/log/pihole/FTL.log
|
|
||||||
# /var/log/pihole-FTL.log.1 -> /var/log/pihole/FTL.log.1
|
|
||||||
# /var/log/pihole-FTL.log.2.gz -> /var/log/pihole/FTL.log.2.gz
|
|
||||||
# /var/log/pihole-FTL.log.3.gz -> /var/log/pihole/FTL.log.3.gz
|
|
||||||
# /var/log/pihole-FTL.log.4.gz -> /var/log/pihole/FTL.log.4.gz
|
|
||||||
# /var/log/pihole-FTL.log.5.gz -> /var/log/pihole/FTL.log.5.gz
|
|
||||||
for f in /var/log/pihole-FTL.log*; do mv "$f" "$(sed "s/pihole-/pihole\//" <<<"$f")"; done
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Remaining log files
|
|
||||||
if [ -f /var/log/pihole.log ] && [ ! -L /var/log/pihole.log ]; then
|
|
||||||
mv /var/log/pihole*.* /var/log/pihole/ 2>/dev/null
|
|
||||||
fi
|
|
||||||
|
|
||||||
restart_service pihole-FTL
|
restart_service pihole-FTL
|
||||||
|
|
||||||
# Download and compile the aggregated block list
|
# Download and compile the aggregated block list
|
||||||
|
|
Loading…
Reference in a new issue