From 3ff70e923666e8816dfb1e5dc58be3f6d8d7d78f Mon Sep 17 00:00:00 2001 From: AnxietyisReal <96593068+AnxietyisReal@users.noreply.github.com> Date: Mon, 22 Jan 2024 14:42:08 +1100 Subject: [PATCH] Filter out my IP from being added to reject list --- ufwReject.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ufwReject.sh b/ufwReject.sh index 8dd9e49..40e809a 100755 --- a/ufwReject.sh +++ b/ufwReject.sh @@ -17,8 +17,9 @@ new_ips=0 # Populate the UFW reject rule with the IP addresses collected from the kernel log while IFS= read -r ip do + ip_prefix="${ip%.*}" # 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 ufw reject from $ip # Increment the counter