„update_blocklist.sh“ ändern
This commit is contained in:
parent
c80f2b1c5a
commit
4f153c8e47
1 changed files with 4 additions and 4 deletions
|
@ -17,7 +17,7 @@
|
|||
LOGLEVEL=1
|
||||
|
||||
TYPE=0
|
||||
META=''
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue