-
Notifications
You must be signed in to change notification settings - Fork 0
/
bludgeon.sh
14 lines (14 loc) · 2.05 KB
/
bludgeon.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash
while true
do
suspect="$(tac access.log | grep -m 1 ".*\.m3u8")"
if [ -n "$suspect" ]; then
suspect="$(echo $suspect | cut -c 1-15 | grep -Eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}')"
if $(ipset list | grep -q $suspect); then
:
else
ipset -A blockedip $suspect
fi
fi
sleep 5
done