Skip to content

Instantly share code, notes, and snippets.

@theel0ja
Created January 9, 2019 21:00
Show Gist options
  • Select an option

  • Save theel0ja/50ab6ad5e203812caa3a0bb96bb19827 to your computer and use it in GitHub Desktop.

Select an option

Save theel0ja/50ab6ad5e203812caa3a0bb96bb19827 to your computer and use it in GitHub Desktop.

Revisions

  1. theel0ja created this gist Jan 9, 2019.
    19 changes: 19 additions & 0 deletions update-geoip-databases.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    rm -rf dist/ *.tar.gz GeoLite2-*/

    wget https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz
    wget https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.tar.gz
    wget https://geolite.maxmind.com/download/geoip/database/GeoLite2-ASN.tar.gz

    tar -xzvf GeoLite2-City.tar.gz
    tar -xzvf GeoLite2-Country.tar.gz
    tar -xzvf GeoLite2-ASN.tar.gz

    rm *.tar.gz

    mkdir dist
    mv */*.mmdb dist/
    rm -rf GeoLite2-*/

    sudo rm -rf /usr/share/GeoIP/GeoLite2-City.tar.gz /usr/share/GeoIP/GeoLite2-Country.tar.gz /usr/share/GeoIP/GeoLite2-ASN.tar.gz

    sudo find dist/ -type f -name "*.mmdb" -exec mv {} /usr/share/GeoIP/ \;