mirror of
https://github.com/lord-alfred/ipranges.git
synced 2026-09-07 02:24:33 +00:00
Add DigitalOcean
This commit is contained in:
22
digitalocean/downloader.sh
Executable file
22
digitalocean/downloader.sh
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
# https://docs.digitalocean.com/products/platform/
|
||||
# From: https://github.com/nccgroup/cloud_ip_ranges
|
||||
|
||||
set -euo pipefail
|
||||
set -x
|
||||
|
||||
|
||||
# get from public ranges
|
||||
curl -s https://www.digitalocean.com/geo/google.csv | cut -d, -f1 > /tmp/digitalocean.txt
|
||||
|
||||
# save ipv4
|
||||
grep -v ':' /tmp/digitalocean.txt > /tmp/digitalocean-ipv4.txt
|
||||
|
||||
# save ipv6
|
||||
grep ':' /tmp/digitalocean.txt > /tmp/digitalocean-ipv6.txt
|
||||
|
||||
|
||||
# sort & uniq
|
||||
sort -h /tmp/digitalocean-ipv4.txt | uniq > digitalocean/ipv4.txt
|
||||
sort -h /tmp/digitalocean-ipv6.txt | uniq > digitalocean/ipv6.txt
|
||||
Reference in New Issue
Block a user