Added a background process for updating the DB

This commit is contained in:
2026-01-11 19:46:40 +01:00
parent 41a4a96075
commit 54abb99607
3 changed files with 9 additions and 1 deletions

29
Docker/updateIP2Lbin.sh Executable file
View File

@@ -0,0 +1,29 @@
#!/bin/bash
# -----------------------------
# IP2Location DB1 Updater
# -----------------------------
# Change this URL to your personal download link if needed
DOWNLOAD_URL="https://www.ip2location.com/download/?token="$IP2LOC_TOKEN"&file=DB9LITEBIN"
# Define filenames
ZIP_FILE="IP2LOCATION-LITE-DB9.BIN.ZIP"
BIN_FILE="IP2LOCATION-LITE-DB9.BIN"
echo "Downloading latest IP2Location DB1..."
wget -O "$CHOWNPATH"/"$BIN_FILE"
echo "Unzipping BIN file..."
unzip -o "$ZIP_FILE"
if [ ! -f "$BIN_FILE" ]; then
echo "Unzip failed or $BIN_FILE not found."
exit 1
fi
echo "Cleaning up ZIP..."
rm "$ZIP_FILE"
echo "Update complete. BIN file ready: $BIN_FILE"