Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 May 2015 17:19:04 +0000 (UTC)
From:      Adam Weinberger <adamw@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r385802 - in head/net/GeoIP: . files
Message-ID:  <201505081719.t48HJ4np087177@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201505081719.t48HJ4np087177>