# Check if the Docker image exists if [[ "$(docker images -q my_dl:latest 2> /dev/null)" == "" ]]; then echo "Docker image 'my_dl:latest' does not exist. Building the image..." docker build -t my_dl . else echo "Docker image 'my_dl:latest' found." fi # Proceed with Docker run command using the validated paths echo "Running Docker with the specified volume and config path..." docker run --rm \ -v "$(pwd)":/app \ -v "$Config_Path":/app/data/8.config.json \ -v "$usb_mount_point":"$usb_mount_point" \ my_dl python3 4.caller.py "$1" | tee -a "$LOGFILE"