aboutsummaryrefslogtreecommitdiff
path: root/utils/azure_ip_addresses_download.sh
diff options
context:
space:
mode:
authorIvan Nardi <12729895+IvanNardi@users.noreply.github.com>2023-10-26 20:15:44 +0200
committerGitHub <noreply@github.com>2023-10-26 20:15:44 +0200
commit611c3b66f0db3ca113db6fb71534231bb87b4cef (patch)
tree0dc777ffbf5a52e64b248b99b38620680d2a01d8 /utils/azure_ip_addresses_download.sh
parent1832d247b39e24ac7cc1b8417ca076bd61ae9c6e (diff)
ipv6: add support for ipv6 addresses lists (#2113)
Diffstat (limited to 'utils/azure_ip_addresses_download.sh')
-rwxr-xr-xutils/azure_ip_addresses_download.sh9
1 files changed, 6 insertions, 3 deletions
diff --git a/utils/azure_ip_addresses_download.sh b/utils/azure_ip_addresses_download.sh
index 7df5d9cca..4aada03ee 100755
--- a/utils/azure_ip_addresses_download.sh
+++ b/utils/azure_ip_addresses_download.sh
@@ -9,6 +9,7 @@ DEST=../src/lib/inc_generated/ndpi_azure_match.c.inc
LINK_TMP=/tmp/azure_link.txt
TMP=/tmp/azure.json
LIST=/tmp/azure.list
+LIST6=/tmp/azure.list6
# https://www.microsoft.com/en-us/download/confirmation.aspx?id=56519
# Azure links have the format https://download.microsoft.com/download/7/1/D/71D86715-5596-4529-9B13-DA13A5DE5B63/ServiceTags_Public_<date>.json
LINK_ORIGIN="https://www.microsoft.com/en-us/download/confirmation.aspx?id=56519"
@@ -28,12 +29,14 @@ check_http_response "${http_response}"
is_file_empty "${TMP}"
echo "(3) Processing IP addresses..."
-# Note: the last "grep -v :" is used to skip IPv6 addresses
tr -d '\r' < $TMP | grep / | tr -d '"' | tr -d " " | tr -d "," | grep -v : > $LIST
is_file_empty "${LIST}"
-./ipaddr2list.py $LIST NDPI_PROTOCOL_MICROSOFT_AZURE > $DEST
-rm -f $TMP $LIST
+tr -d '\r' < $TMP | grep / | tr -d '"' | tr -d " " | tr -d "," | grep : > $LIST6
+is_file_empty "${LIST6}"
+./ipaddr2list.py $LIST NDPI_PROTOCOL_MICROSOFT_AZURE $LIST6 > $DEST
is_file_empty "${DEST}"
+rm -f $TMP $LIST $LIST6
+
echo "(4) Microsoft Azure IPs are available in $DEST"
exit 0