corbanworks / aws-blocker

A simple bash script to block all AWS IP ranges using iptables.
The Unlicense
143 stars 34 forks source link

Getting an error trying aws-block: Join is not defined. #7

Open chubbard opened 6 years ago

chubbard commented 6 years ago

I got the latest script and tried to execute it using:

sudo ./aws-blocker

And I got the following error:

2 compile errors
error: join is not defined
[ .ipv6_prefixes[] ] | group_by(.ipv6_prefix) | map({ "ip": .[0].ipv6_prefix, "regions": map(.region) | 
unique, "services": map(.service) | unique }) | .[] | .ip + " \"" + (.regions | sort | join (", ")) + "\" \"" + 
(.services | sort | join (", ")) + "\""

^^^^
error: join is not defined
[ .ipv6_prefixes[] ] | group_by(.ipv6_prefix) | map({ "ip": .[0].ipv6_prefix, "regions": map(.region) | 
unique, "services": map(.service) | unique }) | .[] | .ip + " \"" + (.regions | sort | join (", ")) + "\" \"" + 
(.services | sort | join (", ")) + "\""

^^^^
2 compile errors

I'm on ubuntu, and /usr/bin/join is there. I checked the $PATH for root, and it has /usr/bin on the path. So I'm not sure why it can't find it.

gserafini commented 6 years ago

You need jq >= version 1.5 (1.3 doesn't have the join command in it).

https://stedolan.github.io/jq/download/