#!/bin/sh


###
## ATTENTION: this is an example. It is left here for educational purposes.
## A better example can be found in debian/cron.d/*
##
## (This file might go away in the future)
###


# How often should this run? 
#  Once a week max

# crontab entry for this (proposal):
# # m h  dom mon dow   command
# 02  01 *   *   1     ( cd /tmp; /my/path/to/this/script )
# 

#export http_proxy=http://proxy.cert.at:8080/

path=/usr/local/bin
export PATH=$PATH:$path

cd /tmp
mkdir -p maxmind
cd maxmind

wget -O GeoLite2-City.mmdb.gz "http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz"
gunzip -f GeoLite2-City.mmdb.gz

mv GeoLite2-City.mmdb /opt/intelmq/var/lib/bots/maxmind_geoip/GeoLite2-City.mmdb
chown intelmq:intelmq /opt/intelmq/var/lib/bots/maxmind_geoip/GeoLite2-City.mmdb




