fix unique ips & add ipv6 merges

This commit is contained in:
Lord_Alfred
2021-07-29 23:49:00 +03:00
parent e5e503611b
commit 0a843ff842
3 changed files with 9 additions and 4 deletions

View File

@@ -36,8 +36,12 @@ jobs:
- name: Merge IPv4 ranges
run: |
set -euo pipefail
# ipv4
python utils/merge.py --source=google/ipv4.txt | sort -h > google/ipv4_merged.txt
python utils/merge.py --source=amazon/ipv4.txt | sort -h > amazon/ipv4_merged.txt
# ipv6
python utils/merge.py --source=google/ipv6.txt | sort -h > google/ipv6_merged.txt
python utils/merge.py --source=amazon/ipv6.txt | sort -h > amazon/ipv6_merged.txt
- name: Commit files
env:

View File

@@ -18,5 +18,5 @@ jq '.ipv6_prefixes[] | [.ipv6_prefix][] | select(. != null)' -r /tmp/amazon.json
# sort & uniq
sort -hu /tmp/amazon-ipv4.txt > amazon/ipv4.txt
sort -hu /tmp/amazon-ipv6.txt > amazon/ipv6.txt
sort -h /tmp/amazon-ipv4.txt | uniq > amazon/ipv4.txt
sort -h /tmp/amazon-ipv6.txt | uniq > amazon/ipv6.txt

View File

@@ -10,6 +10,7 @@ set -euo pipefail
set -x
# get from public ranges
curl -s https://www.gstatic.com/ipranges/goog.txt > /tmp/goog.txt
curl -s https://www.gstatic.com/ipranges/cloud.json > /tmp/cloud.json
@@ -52,5 +53,5 @@ grep ':' /tmp/netblocks.txt >> /tmp/google-ipv6.txt
# sort & uniq
sort -hu /tmp/google-ipv4.txt > google/ipv4.txt
sort -hu /tmp/google-ipv6.txt > google/ipv6.txt
sort -h /tmp/google-ipv4.txt | uniq > google/ipv4.txt
sort -h /tmp/google-ipv6.txt | uniq > google/ipv6.txt