svn commit: r385802 - in head/net/GeoIP: . files
Adam Weinberger
adamw at FreeBSD.org
Fri May 8 17:19:05 UTC 2015
Author: adamw
Date: Fri May 8 17:19:04 2015
New Revision: 385802
URL: https://svnweb.freebsd.org/changeset/ports/385802
Log:
Support fetching the GeoLite City and GeoLite ASN databases.
Requested by: Scott Loga
Modified:
head/net/GeoIP/Makefile
head/net/GeoIP/files/geoipupdate.sh.in
Modified: head/net/GeoIP/Makefile
==============================================================================
--- head/net/GeoIP/Makefile Fri May 8 17:08:09 2015 (r385801)
+++ head/net/GeoIP/Makefile Fri May 8 17:19:04 2015 (r385802)
@@ -4,7 +4,7 @@
PORTNAME= GeoIP
PORTVERSION= 1.6.5
DISTVERSIONPREFIX= v
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= net geography
MAINTAINER= adamw at FreeBSD.org
Modified: head/net/GeoIP/files/geoipupdate.sh.in
==============================================================================
--- head/net/GeoIP/files/geoipupdate.sh.in Fri May 8 17:08:09 2015 (r385801)
+++ head/net/GeoIP/files/geoipupdate.sh.in Fri May 8 17:19:04 2015 (r385802)
@@ -1,5 +1,15 @@
#!/bin/sh
+# You can set the following environment variables:
+#
+# GEOIP_DB_SERVER: The default download server is geolite.maxmind.com
+# GEOIP_FETCH_CITY: If set (to anything), download the GeoLite City DB
+# GEOIP_FETCH_ASN: If sset, download the GeoIP ASN DB
+
+GEOIP_DB_SERVER=${GEOIP_DB_SERVER:=geolite.maxmind.com}
+GEOIP_FETCH_CITY=${GEOIP_FETCH_CITY:=}
+GEOIP_FETCH_ASN=${GEOIP_FETCH_ASN:=}
+
set -eu
echo Fetching GeoIP.dat and GeoIPv6.dat...
@@ -27,8 +37,14 @@ _fetch() {
return 0
}
-GEOIP_DB_SERVER=${GEOIP_DB_SERVER:=geolite.maxmind.com}
-
_fetch "http://${GEOIP_DB_SERVER}/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz" GeoIP.dat
-
_fetch "http://${GEOIP_DB_SERVER}/download/geoip/database/GeoIPv6.dat.gz" GeoIPv6.dat
+
+if [ -n "$GEOIP_FETCH_CITY" ]; then
+ _fetch "http://${GEOIP_DB_SERVER}/download/geoip/database/GeoLiteCity.dat.gz" GeoLiteCity.dat
+ _fetch "http://${GEOIP_DB_SERVER}/download/geoip/database/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz" GeoLiteCityv6.dat
+fi
+if [ -n "$GEOIP_FETCH_ASN" ]; then
+ _fetch "http://${GEOIP_DB_SERVER}/download/geoip/database/asnum/GeoIPASNum.dat.gz" GeoIPASNum.dat
+ _fetch "http://${GEOIP_DB_SERVER}/download/geoip/database/asnum/GeoIPASNumv6.dat.gz" GeoIPASNumv6.dat
+fi
More information about the svn-ports-all
mailing list