2 # (C) Ludovico Cavedon <cavedon@debian.org>
4 GEOIP_URL
="http://geolite.maxmind.com/download/geoip/database/"
6 GEOLITE_COUNTRY_PATH
="GeoLiteCountry/"
7 GEOLITE_COUNTRY_FILE
="GeoIP.dat.gz"
9 GEOLITE_COUNTRY_IPV6_PATH
=""
10 GEOLITE_COUNTRY_IPV6_FILE
="GeoIPv6.dat.gz"
13 GEOLITE_CITY_FILE
="GeoLiteCity.dat.gz"
15 GEOLITE_CITY_IPV6_PATH
="GeoLiteCityv6-beta/"
16 GEOLITE_CITY_IPV6_FILE
="GeoLiteCityv6.dat.gz"
18 GEOLITE_ASNUM_PATH
="asnum/"
19 GEOLITE_ASNUM_FILE
="GeoIPASNum.dat.gz"
24 "$GEOIP_URL$GEOLITE_COUNTRY_PATH$GEOLITE_COUNTRY_FILE" \
25 "$GEOIP_URL$GEOLITE_COUNTRY_IPV6_PATH$GEOLITE_COUNTRY_IPV6_FILE" \
26 "$GEOIP_URL$GEOLITE_CITY_PATH$GEOLITE_CITY_FILE" \
27 "$GEOIP_URL$GEOLITE_CITY_IPV6_PATH$GEOLITE_CITY_IPV6_FILE" \
28 "$GEOIP_URL$GEOLITE_ASNUM_PATH$GEOLITE_ASNUM_FILE"
30 echo "Downloading $url"
34 rm -f /usr
/share
/GeoIP
/$FILE
35 /usr
/bin
/wget
-t3 -T15 -P /usr
/share
/GeoIP
/ "$url" && \
36 /bin
/gunzip
-f /usr
/share
/GeoIP
/$FILE
40 echo "Failed to download and decompress $FILE"
44 ln -s /usr
/share
/GeoIP
/GeoLiteCity.dat
/usr
/share
/GeoIP
/GeoIPCity.dat
45 ln -s /usr
/share
/GeoIP
/GeoLiteCityv6.dat
/usr
/share
/GeoIP
/GeoIPCityv6.dat
46 ln -s /usr
/share
/GeoIP
/ /usr
/local
/share
/