#!/bin/bash set -e # Configuration file path CONFIG_FILE="${CONFIG_FILE:-/etc/probod/config.yml}" # Check if config file already exists (e.g., mounted from ConfigMap) if [ -f "$CONFIG_FILE" ]; then echo "Using existing configuration file at: $CONFIG_FILE" else echo "Generating configuration file from environment variables at: $CONFIG_FILE" # Create directory if it doesn't exist mkdir -p "$(dirname "$CONFIG_FILE")" cat > "$CONFIG_FILE" <> "$CONFIG_FILE" <