mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
Update MMDB download and error handling in update-mmdb.sh
This commit is contained in:
parent
08e4a6709f
commit
28636c0b9b
1 changed files with 12 additions and 0 deletions
|
|
@ -13,6 +13,12 @@ if [ $? -ne 0 ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
content_head="$(head -n 2 asn.mmdb.gz)"
|
||||
if [[ "$content_head" =~ "404 Not Found" ]]; then
|
||||
echo "❌ The ASN database is not available for the current month for the moment."
|
||||
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
|
||||
|
|
@ -20,6 +26,12 @@ if [ $? -ne 0 ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
content_head="$(head -n 2 country.mmdb.gz)"
|
||||
if [[ "$content_head" =~ "404 Not Found" ]]; then
|
||||
echo "❌ The country database is not available for the current month for the moment."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Decompress the downloaded databases
|
||||
|
||||
gunzip -f asn.mmdb.gz
|
||||
|
|
|
|||
Loading…
Reference in a new issue