Weekly GeoIP update

Ubuntu ships a quite old GeoIP database. So I wrote a small script which updates all files

#!/bin/sh
DEST_DIR=/usr/share/GeoIP
SRV_BASE=http://geolite.maxmind.com/download/geoip/database

cd $DEST_DIR
wget -q $SRV_BASE/GeoLiteCity.dat.gz
gzip -d -f GeoLiteCity.dat.gz
wget -q $SRV_BASE/GeoLiteCountry/GeoIP.dat.gz
gzip -d -f GeoIP.dat.gz
wget -q $SRV_BASE/GeoIPv6.dat.gz
gzip -d -f GeoIPv6.dat.gz
wget -q $SRV_BASE/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz
gzip -d -f GeoLiteCityv6.dat

In order to run it weekly just store it as /etc/cron.weekly/geoip_update and make it executable.