ASN database, part 2 (#67)

ASN lookup
This commit is contained in:
Niklas
2019-07-05 15:01:45 +02:00
committed by Martin Polden
parent 5a28ed6bf5
commit 7fbc2e1b9f
9 changed files with 86 additions and 11 deletions

View File

@ -23,13 +23,14 @@ lint: check-fmt vet
install: deps
go install ./...
databases := GeoLite2-City GeoLite2-Country
databases := GeoLite2-City GeoLite2-Country GeoLite2-ASN
$(databases):
mkdir -p data
curl -fsSL -m 30 https://geolite.maxmind.com/download/geoip/database/$@.tar.gz | tar $(TAR_OPTS) --strip-components=1 -C $(CURDIR)/data -xzf - '*.mmdb'
test ! -f data/GeoLite2-City.mmdb || mv data/GeoLite2-City.mmdb data/city.mmdb
test ! -f data/GeoLite2-Country.mmdb || mv data/GeoLite2-Country.mmdb data/country.mmdb
test ! -f data/GeoLite2-ASN.mmdb || mv data/GeoLite2-ASN.mmdb data/asn.mmdb
geoip-download: $(databases)