1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-10-18 22:09:04 +00:00
pi-hole/advanced/Scripts/piholeLogFlush.sh

21 lines
720 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
# (c) 2015, 2016 by Jacob Salmela
# Network-wide ad blocking via your Raspberry Pi
# http://pi-hole.net
# Flushes /var/log/pihole.log
2015-12-06 13:55:50 +00:00
#
2016-01-30 20:12:40 +00:00
# Pi-hole is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
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
2017-01-12 20:01:52 +00:00
/usr/sbin/logrotate --force /etc/.pihole/advanced/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!"