pretendo-docker/scripts/run-in-container/minio-init.sh
Matthew Lopez bedec9d604
Improve handling of repeated commands
This prevents infinite loops during setup.
2024-05-11 17:32:38 -04:00

16 lines
344 B
Bash

#!/bin/sh
set -eu
buckets="pn-cdn pn-boss super-mario-maker"
# Create buckets and allow public access
for bucket in $buckets; do
if ! mc ls "minio/$bucket" >/dev/null 2>&1; then
mc mb "minio/$bucket"
mc anonymous set download "minio/$bucket"
else
echo "Bucket $bucket already exists. Skipping..."
fi
done