mirror of
https://github.com/mpolden/echoip.git
synced 2025-07-17 06:23:32 +02:00
3
Makefile
3
Makefile
@ -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)
|
||||
|
||||
|
Reference in New Issue
Block a user