mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
Add script to update mmdb files + update mmdb files
This commit is contained in:
parent
5af1c63083
commit
113ba8222a
3 changed files with 39 additions and 0 deletions
39
misc/update-mmdb.sh
Executable file
39
misc/update-mmdb.sh
Executable file
|
|
@ -0,0 +1,39 @@
|
|||
#!/bin/bash
|
||||
|
||||
# This script downloads the latest GeoLite2 databases from dbip.com and updates the existing ones.
|
||||
|
||||
cd ../src/bw/misc || cd src/bw/misc || exit 1
|
||||
|
||||
# Download the latest GeoLite2 databases
|
||||
|
||||
curl -o asn.mmdb.gz "https://download.db-ip.com/free/dbip-asn-lite-$(date +%Y-%m).mmdb.gz"
|
||||
# shellcheck disable=SC2181
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "❌ Failed to download the ASN database."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
curl -o country.mmdb.gz "https://download.db-ip.com/free/dbip-country-lite-$(date +%Y-%m).mmdb.gz"
|
||||
# shellcheck disable=SC2181
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "❌ Failed to download the country database."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Decompress the downloaded databases
|
||||
|
||||
gunzip -f asn.mmdb.gz
|
||||
# shellcheck disable=SC2181
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "❌ Failed to decompress the ASN database."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
gunzip -f country.mmdb.gz
|
||||
# shellcheck disable=SC2181
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "❌ Failed to decompress the country database."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✅ Updated the GeoLite2 databases."
|
||||
Binary file not shown.
Binary file not shown.
Loading…
Reference in a new issue