#!/bin/bash pfad=/usr/local/bin/geoip geopfad=/usr/share/GeoIP date=`date +%Y\-%m\-%d` websitedate=`sudo w3m -dump http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/ | grep "GeoIP.dat" | tr -s ' ' ' ' | cut -d" " -f4` filedate=`cat $pfad/version` if [ ! "$filedate" = "$websitedate" ] then mv $geopfad/GeoIP.dat $geopfad/GeoIP.dat.$date cd $geopfad /usr/bin/wget -q -O GeoIP.dat.gz http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz && /bin/gunzip GeoIP.dat.gz echo $websitedate > $pfad/version fi