From 4c249a1186dfa1023567cfd250b689ff72996d92 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sun, 21 Jan 2018 13:48:13 +0100 Subject: [PATCH] Flush most recent 24 hours from FTL's database Signed-off-by: DL6ER --- advanced/Scripts/piholeLogFlush.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/advanced/Scripts/piholeLogFlush.sh b/advanced/Scripts/piholeLogFlush.sh index 8685012d..0816678f 100755 --- a/advanced/Scripts/piholeLogFlush.sh +++ b/advanced/Scripts/piholeLogFlush.sh @@ -42,8 +42,11 @@ else fi fi # Delete most recent 24 hours from FTL's database + deleted=$(sqlite3 /etc/pihole/pihole-FTL.db "DELETE FROM queries WHERE timestamp >= strftime('%s','now')-86400; select changes() from queries limit 1") + fi if [[ "$@" != *"quiet"* ]]; then echo -e "${OVER} ${TICK} Flushed /var/log/pihole.log" + echo -e " ${TICK} Deleted ${deleted} queries from database" fi