„update_blocklist.sh“ ändern
This commit is contained in:
parent
c80f2b1c5a
commit
4f153c8e47
1 changed files with 4 additions and 4 deletions
|
@ -16,8 +16,8 @@
|
||||||
# Loglevel 1: Show Stats at the bottom / Loglevel 2: Show all / Loglevel 0: disable
|
# Loglevel 1: Show Stats at the bottom / Loglevel 2: Show all / Loglevel 0: disable
|
||||||
LOGLEVEL=1
|
LOGLEVEL=1
|
||||||
|
|
||||||
TYPE=0
|
TYPE=0
|
||||||
META=''
|
META='' # e.g. subnetmask
|
||||||
|
|
||||||
###############################################################################################################
|
###############################################################################################################
|
||||||
# Do NOT change after here!
|
# Do NOT change after here!
|
||||||
|
@ -56,8 +56,8 @@ UNIXTIME_DELETE_IP=$(date -d "+$DELETE_IP_AFTER days" +%s)
|
||||||
# filter diffs:
|
# filter diffs:
|
||||||
diff "/tmp/before.txt" "/tmp/onlinelist.txt" | grep '^>' | sed -e 's/> //' > /tmp/blocklist.txt # only diffs from left to right
|
diff "/tmp/before.txt" "/tmp/onlinelist.txt" | grep '^>' | sed -e 's/> //' > /tmp/blocklist.txt # only diffs from left to right
|
||||||
# delete IP if expired:
|
# delete IP if expired:
|
||||||
CountExpiredIP=$(sqlite3 /etc/synoautoblock.db "SELECT count(IP) 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"
|
sqlite3 /etc/synoautoblock.db "DELETE FROM AutoBlockIP WHERE ExpireTime <= $UNIXTIME AND Deny='1' "
|
||||||
|
|
||||||
while read BLOCKED_IP
|
while read BLOCKED_IP
|
||||||
do
|
do
|
||||||
|
|
Loading…
Reference in a new issue