Giter Club home page Giter Club logo

geoipupdate-legacy's Introduction

GeoIP-update

This is an unofficial script for downloading the MaxMind GeoIP (legacy) database from multiple supported sources.

By default, the script downloads the database from Miyuru's site to /usr/share/GeoIP. You can change the path and source by setting the $GEOIP_DIR and $GEOIP_SOURCE variables. See the documentation below for more details.

Table of Contents

Data Sources

geoipupdate-legacy utilizes two sources for the legacy GeoIP databases. Both sources use MaxMind's GeoLite2 databases as their data source and rely on the sherpya/geolite2legacy project to convert the data from the MaxMind DB File Format to the legacy GeoIP format. For more details, visit their websites:

Miyuru is the default data source, as Mailfud appears to have a stricter rate limit. However, note that Miyuru's service may not support IPv4 all the time. If you encounter any connectivity issues with it, refer to the usage documentation and switch to another data source.

Installation

Download the geoipupdate script to your $PATH, such as /usr/bin/ or /usr/local/bin/, and set the script to be executable. For example:

Using curl:

sudo curl -Lo /usr/local/bin/geoipupdate https://github.com/PeterDaveHello/geoipupdate-legacy/raw/master/geoipupdate
sudo chmod +x /usr/local/bin/geoipupdate

Using wget:

sudo wget -O /usr/local/bin/geoipupdate https://github.com/PeterDaveHello/geoipupdate-legacy/raw/master/geoipupdate
sudo chmod +x /usr/local/bin/geoipupdate

You can also use git to clone the whole repository, and create a symbolic link in your $PATH, allowing you to easily update the script using git pull in the future:

git clone https://github.com/PeterDaveHello/geoipupdate-legacy
sudo ln -s $PWD/geoipupdate-legacy/geoipupdate /usr/local/bin/

Usage

Since /usr/share/GeoIP is typically owned by root, you may need to use sudo for root permission:

sudo geoipupdate

To download the database to a different location, set the GEOIP_DIR variable:

GEOIP_DIR=/dev/shm/GeoIP_temp/ geoipupdate

Use with a specified data source

As mentioned in the Data Sources section, multiple data sources are supported. To specify the desired source, set the $GEOIP_SOURCEvariable with the value of the source name, in lower case. For example:

GEOIP_SOURCE=mailfud sudo -E geoipupdate

Note: sudo requires the -E or --preserve-env=GEOIP_SOURCE flag to preserve the variable for the commands it calls, otherwise geoipupdate won't know which source you'd like to use.

Use without installation

It's possible to directly pipe the latest script to bash, but this can be risky. Use this method only when you understand the implications:

  • Using wget with original URL

    wget -qO- https://github.com/PeterDaveHello/geoipupdate-legacy/raw/master/geoipupdate | sudo bash
  • Using curl with shortened URL, specifying the update source as mailfud:

    curl -sSLo- https://git.io/geoipupdate | GEOIP_SOURCE=mailfud sudo -E bash

License

GPL-2.0 (GNU GENERAL PUBLIC LICENSE Version 2)

geoipupdate-legacy's People

Contributors

peterdavehello avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

geoipupdate-legacy's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.