XtreamUI Auto Update GeoLite2 Every day

A

AtoZNull

Administrator
Staff member
Credits
79
1. Register on https://www.maxmind.com/en/geolite2/signup
2. Sign in on your account and click on the left menu ( My License Key ---> Generate New License) Paste
account ID and License Key on notepad u will need it later.
3. Follow the steps
Code:
sudo add-apt-repository ppa:maxmind/ppa
Code:
sudo apt update
Code:
sudo apt install geoipupdate
4. EDIT the file GeoIP.conf
Code:
nano /etc/GeoIP.conf

PASTE THIS AND REPLACE WHERE YOUR_ACCOUNT_ID_HERE and YOUR_LICENSE_KEY_HERE
WITH YOURS:
Please see https://dev.maxmind.com/geoip/geoipupdate/ for instructions
on setting up geoipupdate, including information on how to download a
pre-filled GeoIP.conf file.
Replace YOUR_ACCOUNT_ID_HERE and YOUR_LICENSE_KEY_HERE with an active account
ID and license key combination associated with your MaxMind account. These
are available from https://www.maxmind.com/en/my_license_key .
AccountID YOUR_ACCOUNT_ID_HERE
iF YOU HAVE ERROR ( Invalid account ID or license key) Use User ID insted AccountID
UserID YOUR_ACCOUNT_ID_HERE
LicenseKey YOUR_LICENSE_KEY_HERE
Enter the edition IDs of the databases you would like to update.
Multiple edition IDs are separated by spaces.
EditionIDs GeoLite2-Country
The remaining settings are OPTIONAL.
The directory to store the database files. Defaults to /usr/share/GeoIP
DatabaseDirectory /home/xtreamcodes/iptv_xtream_codes
The server to use. Defaults to "updates.maxmind.com"
Host updates.maxmind.com
The proxy host name or IP address. You may optionally specify a
port number, e.g., 127.0.0.1:8888. If no port number is specified, 1080
will be used.
Proxy 127.0.0.1:8888
The user name and password to use with your proxy server.
ProxyUserPassword usernameassword
Whether to preserve modification times of files downloaded from the server.
Defaults to "0".
PreserveFileTimes 0

The lock file to use. This ensures only one geoipupdate process can run at a time.
Note: Once created, this lockfile is not removed from the filesystem.
Defaults to ".geoipupdate.lock" under the DatabaseDirectory.
LockFile /usr/share/GeoIP/.geoipupdate.lock

SAVE & EXIT
5. Create Bash (.sh)
PASTE THIS:
Bash:
#!/bin/bash
#UPDATE THE FILE
/usr/bin/geoipupdate
cd /home/xtreamcodes/iptv_xtream_codes/
#RENAME THE FILE
Code:
mv GeoLite2-Country.mmdb GeoLite2.mmdb
#CHANGE GROUP AND OWNER
Code:
chown xtreamcodes GeoLite2.mmdb
chgrp xtreamcodes GeoLite2.mmdb

SAVE where u want ( ie root other folder ) like GeoLite2.sh & EXIT
6. Crontab -e
Code:
36 16 * * * /root/GeoLite2.sh

SAVE & EXIT
 
Top