1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-12-27 04:15:38 -05:00

Filter out my IP from being added to reject list

This commit is contained in:
toast-ts 2024-01-22 14:42:08 +11:00
parent 6f0dc39606
commit 76780787a9

View File

@ -17,8 +17,9 @@ new_ips=0
# Populate the UFW reject rule with the IP addresses collected from the kernel log # Populate the UFW reject rule with the IP addresses collected from the kernel log
while IFS= read -r ip while IFS= read -r ip
do do
ip_prefix="${ip%.*}"
# Check if the IP is already in the UFW rules # Check if the IP is already in the UFW rules
if ! ufw status | grep -q "$ip" if ! ufw status | grep -q "$ip" && [ "$ip_prefix" != "${TOAST_IP%.*}" ]
then then
ufw reject from $ip ufw reject from $ip
# Increment the counter # Increment the counter