pi-hole/advanced/Scripts/piholeLogFlush.sh

21 lines
588 B
Bash
Raw Normal View History

2015-12-06 14:55:50 +01:00
#!/usr/bin/env bash
2016-01-30 21:12:40 +01:00
# Pi-hole: A black hole for Internet advertisements
2017-02-22 18:55:20 +01: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 14:55:50 +01:00
#
2017-02-22 18:55:20 +01: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 14:55:50 +01:00
2016-04-03 19:27:18 +02:00
echo -n "::: Flushing /var/log/pihole.log ..."
2017-01-12 20:39:25 +01: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 20:39:25 +01:00
else
echo " " > /var/log/pihole.log
fi
2016-04-03 19:27:18 +02:00
echo "... done!"