cowgill / spamhaus

A shell script that grabs the latest Spamhaus DROP List and adds it to iptables.
48 stars 21 forks source link

drop/edrop v6? #9

Open gilgongo opened 4 months ago

gilgongo commented 4 months ago

EDIT: Oops wrong GH repo! This question refers to a fork I think...

To get the script to work with ipv6, I think (along with changing the relevant variables) I need to alter this line:

# iterate through all known spamming hosts
for IP in $( cat "$CACHE_FILE" | grep -e "^\([0-9]\{1,3\}\.\)\{3\}[0-9]\{1,3\}\/[0-9]\{1,2\} " | cut -d' ' -f1 ); do

But I'm not sure how. Does anyone know?

gilgongo commented 4 months ago

Oh actually, this works. Change line 49 to be:

for IP in $( awk '!/^;/{print $1}' "$FILE" ); do