From 4f153c8e47f02015f25f17ffdcfc939ebaa4d0b5 Mon Sep 17 00:00:00 2001 From: Stephan Geisler Date: Sat, 28 Sep 2019 22:33:50 +0000 Subject: [PATCH] =?UTF-8?q?=E2=80=9Eupdate=5Fblocklist.sh=E2=80=9C=20?= =?UTF-8?q?=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- update_blocklist.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/update_blocklist.sh b/update_blocklist.sh index 8363657..f5a96ce 100644 --- a/update_blocklist.sh +++ b/update_blocklist.sh @@ -16,8 +16,8 @@ # Loglevel 1: Show Stats at the bottom / Loglevel 2: Show all / Loglevel 0: disable LOGLEVEL=1 - TYPE=0 - META='' + TYPE=0 + META='' # e.g. subnetmask ############################################################################################################### # Do NOT change after here! @@ -56,8 +56,8 @@ UNIXTIME_DELETE_IP=$(date -d "+$DELETE_IP_AFTER days" +%s) # filter diffs: diff "/tmp/before.txt" "/tmp/onlinelist.txt" | grep '^>' | sed -e 's/> //' > /tmp/blocklist.txt # only diffs from left to right # delete IP if expired: - CountExpiredIP=$(sqlite3 /etc/synoautoblock.db "SELECT count(IP) FROM AutoBlockIP WHERE ExpireTime <= $UNIXTIME") - sqlite3 /etc/synoautoblock.db "DELETE FROM AutoBlockIP WHERE ExpireTime <= $UNIXTIME" + CountExpiredIP=$(sqlite3 /etc/synoautoblock.db "SELECT count(IP) FROM AutoBlockIP WHERE ExpireTime <= $UNIXTIME AND Deny='1'") + sqlite3 /etc/synoautoblock.db "DELETE FROM AutoBlockIP WHERE ExpireTime <= $UNIXTIME AND Deny='1' " while read BLOCKED_IP do