#!/bin/bash

# geoip-lite-update -- update geoip lite database(s).
# (c) 2008,2009 poeml@cmdline.net
# Distribute under GPLv2 if it proves worthy.


set -e

cd /usr/share/GeoIP/

ftp http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
gunzip -c GeoIP.dat.gz > GeoIP.dat.updated.new
mv GeoIP.dat.updated.new GeoIP.dat.updated

ftp http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
gunzip -c GeoLiteCity.dat.gz > GeoLiteCity.dat.updated.new
mv GeoLiteCity.dat.updated.new GeoLiteCity.dat.updated

rcapache2 reload
