#!/bin/bash if [ ! -d /usr/local/share/GeoIP ];then mkdir /usr/local/share/GeoIP fi if [ ! -d /usr/local/share/qqIP ];then mkdir /usr/local/share/qqIP fi wget -t 5 -O /tmp/GeoIP.dat.gz http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz wget -t 5 -O /tmp/GeoLiteCity.dat.gz http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz wget -t 5 -O /tmp/GeoIPASNum.dat.gz http://geolite.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz gzip -df /tmp/GeoIP.dat.gz gzip -df /tmp/GeoLiteCity.dat.gz gzip -df /tmp/GeoIPASNum.dat.gz mv -f /tmp/Geo*.dat /usr/local/share/GeoIP/
脚本名可任意取,比如update_geoip.sh,然后添加定时任务,每隔5天执行一次。