1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-11-17 00:10:58 -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
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