#!/bin/bash

set -e

timestamp=$(date "+%Y-%m")

wget https://download.db-ip.com/free/dbip-country-lite-$timestamp.csv.gz -O- | gzip -cd > dbip-country-lite.csv
wget https://download.db-ip.com/free/dbip-city-lite-$timestamp.csv.gz -O- | gzip -cd > dbip-city-lite.csv
python3 process-geoip.py
rm dbip-country-lite.csv
rm dbip-city-lite.csv
