diff options
Diffstat (limited to 'advanced/Scripts/piholeLogFlush.sh')
-rwxr-xr-x | advanced/Scripts/piholeLogFlush.sh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/advanced/Scripts/piholeLogFlush.sh b/advanced/Scripts/piholeLogFlush.sh index 8b16e3d5..d8f4fd79 100755 --- a/advanced/Scripts/piholeLogFlush.sh +++ b/advanced/Scripts/piholeLogFlush.sh @@ -11,5 +11,10 @@ # (at your option) any later version. echo -n "::: Flushing /var/log/pihole.log ..." -echo " " > /var/log/pihole.log +# Test if logrotate is available on this system +if command -v /usr/sbin/logrotate &> /dev/null; then + /usr/sbin/logrotate --force /etc/pihole/logrotate +else + echo " " > /var/log/pihole.log +fi echo "... done!" |