From 03e678b8e3b643a29afcb0432dbe7ab3d4fcd78f Mon Sep 17 00:00:00 2001 From: David Timber Date: Thu, 14 Nov 2024 04:57:20 +0100 Subject: Initial commit --- get-regions | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 get-regions (limited to 'get-regions') diff --git a/get-regions b/get-regions new file mode 100755 index 00000000..bb3fd744 --- /dev/null +++ b/get-regions @@ -0,0 +1,18 @@ +#!/bin/bash +filter_output () { + # drop any lines that doesn't contain a dash + # (to filter out "GLOBAL") + while read l + do + if [[ "$l" == *"-"* ]]; then + echo $l + fi + done +} + +set -o pipefail +curl -sSL 'https://ip-ranges.amazonaws.com/ip-ranges.json' | + jq -r '.prefixes[].region, .ipv6_prefixes[].region' | + sort | + uniq | + filter_output -- cgit