diff --git a/Docker/Dockerfile/Dockerfile b/Docker/Dockerfile/Dockerfile index 2e65bbf..49369e5 100644 --- a/Docker/Dockerfile/Dockerfile +++ b/Docker/Dockerfile/Dockerfile @@ -1,7 +1,7 @@ FROM alpine:latest RUN apk update && \ - apk add python3 py3-pip su-exec curl wget && \ + apk add python3 py3-pip su-exec curl wget unzip && \ mkdir -p /netflowParser WORKDIR /netflowParser @@ -10,6 +10,7 @@ WORKDIR /netflowParser COPY ../Code/* /netflowParser/ COPY ./entrypoint.sh /entrypoint.sh +COPY ./updateIP2Lbin.sh /netflowParser/ RUN chmod +x /entrypoint.sh diff --git a/Docker/Dockerfile/updateIP2Lbin.sh b/Docker/Dockerfile/updateIP2Lbin.sh new file mode 100755 index 0000000..d1e74ae --- /dev/null +++ b/Docker/Dockerfile/updateIP2Lbin.sh @@ -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" +