1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-12-23 07:18:07 +00:00
pi-hole/advanced/Scripts/piholeLogFlush.sh

21 lines
588 B
Bash
Raw Normal View History

2015-12-06 13:55:50 +00:00
#!/usr/bin/env bash
2016-01-30 20:12:40 +00:00
# Pi-hole: A black hole for Internet advertisements
2017-02-22 17:55:20 +00:00
# (c) 2017 Pi-hole, LLC (https://pi-hole.net)
# Network-wide ad blocking via your own hardware.
#
# Flushes /var/log/pihole.log
2015-12-06 13:55:50 +00:00
#
2017-02-22 17:55:20 +00:00
# This file is copyright under the latest version of the EUPL.
# Please see LICENSE file for your rights under this license.
2015-12-06 13:55:50 +00:00
2016-04-03 17:27:18 +00:00
echo -n "::: Flushing /var/log/pihole.log ..."
2017-01-12 19:39:25 +00:00
# Test if logrotate is available on this system
if command -v /usr/sbin/logrotate &> /dev/null; then
/usr/sbin/logrotate --force /etc/pihole/logrotate
2017-01-12 19:39:25 +00:00
else
echo " " > /var/log/pihole.log
fi
2016-04-03 17:27:18 +00:00
echo "... done!"