#!/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天执行一次。

相关文章:

  • 2022-12-23
  • 2021-06-03
  • 2021-12-13
  • 2022-12-23
  • 2021-10-31
  • 2021-09-07
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-05
  • 2021-06-11
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案