mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-25 06:10:20 +00:00
Solve piholeLogFlush.sh having to be issued 2 x to clear logs (#1460)
Simplified the command -v syntax, and added a sleep 3 timer to the first execution of the log rotation. The second execution was being issued while the first was still running, thus it would fail and you would have to issue the "Flush Logs" command a second time.
This commit is contained in:
parent
31d5a7ae9e
commit
b166410cbf
1 changed files with 2 additions and 2 deletions
|
@ -10,9 +10,9 @@
|
||||||
|
|
||||||
echo -n "::: Flushing /var/log/pihole.log ..."
|
echo -n "::: Flushing /var/log/pihole.log ..."
|
||||||
# Test if logrotate is available on this system
|
# Test if logrotate is available on this system
|
||||||
if command -v /usr/sbin/logrotate &> /dev/null; then
|
if command -v /usr/sbin/logrotate >/dev/null; then
|
||||||
# Flush twice to move all data out of sight of FTL
|
# Flush twice to move all data out of sight of FTL
|
||||||
/usr/sbin/logrotate --force /etc/pihole/logrotate
|
/usr/sbin/logrotate --force /etc/pihole/logrotate; sleep 3
|
||||||
/usr/sbin/logrotate --force /etc/pihole/logrotate
|
/usr/sbin/logrotate --force /etc/pihole/logrotate
|
||||||
else
|
else
|
||||||
# Flush both pihole.log and pihole.log.1 (if existing)
|
# Flush both pihole.log and pihole.log.1 (if existing)
|
||||||
|
|
Loading…
Reference in a new issue