diff --git a/Dockerfile b/Dockerfile index 92bdcaa..2347d26 100644 --- a/Dockerfile +++ b/Dockerfile @@ -131,4 +131,4 @@ RUN apt-get update && \ rm -rf /var/lib/apt/lists/* # Override the default command to run Tor -CMD ["/app/tor.sh"] +CMD ["/app/entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh index 4287664..545d1b5 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -6,6 +6,13 @@ LOG_FILE=${LOG_DIR}/cwa-bd_entrypoint.log # Cleanup any existing files or folders in the log directory rm -rf $LOG_DIR/* + +( +if [ "$USING_TOR" = "true" ]; then + ./tor.sh +fi +) + exec 3>&1 4>&2 exec > >(tee -a $LOG_FILE) 2>&1 echo "Starting entrypoint script" diff --git a/tor.sh b/tor.sh index 34354fd..7573400 100644 --- a/tor.sh +++ b/tor.sh @@ -11,6 +11,8 @@ echo "Log file: $LOG_FILE" set +x set -e +echo "[*] Running tor script..." + echo "Build version: $BUILD_VERSION" echo "[*] Installing Tor and dependencies..." @@ -116,5 +118,4 @@ else fi # Run the entrypoint script -echo "[*] Running entrypoint script..." -./entrypoint.sh +echo "[*] End of tor script"