#!/bin/sh
set -e

echo "Waiting for Vault Agent to render /vault/secrets/minio.env..."
while [ ! -f /vault/secrets/minio.env ]; do
  sleep 0.5
done

echo "Vault secrets ready, starting MinIO..."
exec minio "$@"