Skip to content

Instantly share code, notes, and snippets.

@rjaeckel
Created November 7, 2014 09:46
Show Gist options
  • Save rjaeckel/a06986796bea5315d476 to your computer and use it in GitHub Desktop.
Save rjaeckel/a06986796bea5315d476 to your computer and use it in GitHub Desktop.
Maxmind GeoIP Database download
#!/bin/bash
base="http://geolite.maxmind.com/download/geoip/database/"
files="GeoLiteCountry/GeoIP GeoIPv6 GeoLiteCity GeoLiteCityv6-beta/GeoLiteCityv6 asnum/GeoIPASNum asnum/GeoIPASNumv6"
ext="dat.gz"
output="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
#download
waitFor=""
for file in $files ; do
wget -q "$base$file.$ext" &
waitFor="$waitFor $!"
done
wait $waitfor
#unpack
for d in *.dat.gz; do
gzip -df $d &
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment