From e3e21c0db56c14985d3397249e687637cf1f3849 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 2 Feb 2026 06:42:55 -0700 Subject: [PATCH] change .env import method --- lxc1/p0-infrastructure/02_deploy_minio_buckets.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lxc1/p0-infrastructure/02_deploy_minio_buckets.sh b/lxc1/p0-infrastructure/02_deploy_minio_buckets.sh index 7d929ad..0859ea4 100644 --- a/lxc1/p0-infrastructure/02_deploy_minio_buckets.sh +++ b/lxc1/p0-infrastructure/02_deploy_minio_buckets.sh @@ -4,7 +4,14 @@ ENV_PATH="/docker/minio/.env" if [ -f "$ENV_PATH" ]; then - export $(grep -v '^#' "$ENV_PATH" | xargs) + while read -r line || [ -n "$line" ]; do + # Skip comments and empty lines + [[ "$line" =~ ^#.*$ ]] && continue + [[ -z "$line" ]] && continue + + # Export the variable, removing any literal quotes + export "${line//\"/}" + done < "$ENV_PATH" echo "Successfully loaded variables from $ENV_PATH" else echo "ERROR: Could not find .env at $ENV_PATH"