From b51a3099d79fc8b2389c801db84e5aa8acbdf8d8 Mon Sep 17 00:00:00 2001 From: Sefinek Date: Thu, 31 Oct 2024 02:25:39 +0100 Subject: [PATCH] Update report_to_abuseipdb --- reporter.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/reporter.sh b/reporter.sh index f731b77..93229d4 100644 --- a/reporter.sh +++ b/reporter.sh @@ -72,7 +72,7 @@ is_local_ip() { } report_to_abuseipdb() { - local ip="$1" categories="$2" proto="$3" spt="$4" dpt="$5" ttl="$6" len="$7" tos="$8" warsaw_time="$9" + local ip="$1" categories="$2" proto="$3" spt="$4" dpt="$5" ttl="$6" len="$7" tos="$8" timestamp="$9" local comment="Blocked by UFW ($proto on port $dpt). Source port: $spt" @@ -87,7 +87,6 @@ Packet length: $len" TOS: $tos" comment+=" -Timestamp: $warsaw_time [Europe/Warsaw] This report (for $ip) was generated by: https://github.com/sefinek24/UFW-AbuseIPDB-Reporter" # Please do not remove the URL to the repository of this script. I would be really grateful. 💙 @@ -197,10 +196,9 @@ process_log_line() { fi categories=$(determine_categories "$proto" "$dpt") - warsaw_time=$(TZ="Europe/Warsaw" date -d "$timestamp" '+%Y-%m-%d %H:%M:%S') log "INFO" "Reporting IP $src_ip ($proto $dpt) with categories $categories..." - if report_to_abuseipdb "$src_ip" "$categories" "$proto" "$spt" "$dpt" "$ttl" "$len" "$tos" "$warsaw_time"; then + if report_to_abuseipdb "$src_ip" "$categories" "$proto" "$spt" "$dpt" "$ttl" "$len" "$tos" "$timestamp"; then mark_ip_as_reported "$src_ip" save_reported_ips fi