firewall/modules/module-akkoma-timeline-home.sh

20 lines
555 B
Bash
Raw Normal View History

2024-09-24 21:33:14 -06:00
#!/bin/bash
FIREWALL="/opt/firewall/firewall.sh"
2024-09-24 21:56:20 -06:00
NFT_CACHE='/tmp/nft.cache'
2024-09-24 21:33:14 -06:00
ACCESS="/tmp/minute.log"
ATTACK="module-akkoma-timeline-home DDOS Attack "
2024-09-24 21:48:25 -06:00
echo $ATTACK
2024-09-24 21:33:14 -06:00
SEARCH_SPAM=$(grep $2 $ACCESS | grep -E "timelines/home" | grep $1 | wc -l)
CHECK=$(cat $NFT_CACHE | sort -u | grep $1)
if [[ "$SEARCH_SPAM" -gt 30 ]]; then
echo "$IP $CHECK $COUNT"
if [ "$CHECK" = "" ]; then
2024-09-24 21:56:20 -06:00
bash $FIREWALL ipBlockParser "$1"
2024-09-24 21:33:14 -06:00
bash $FIREWALL message "$ATTACK $1"
redis-cli SADD tmp_block $1
echo "$ATTACK $1"
else
echo "$ATTACK Ignoring Duplicate IP: $1"
fi
fi