mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-04 08:04:57 +02:00
17 lines
518 B
Plaintext
Executable File
17 lines
518 B
Plaintext
Executable File
#!/usr/bin/with-contenv bashio
|
|
set -euo pipefail
|
|
|
|
MINIO_USER="$(bashio::config 'MINIO_ROOT_USER')"
|
|
MINIO_PASS="$(bashio::config 'MINIO_ROOT_PASSWORD')"
|
|
S3_BUCKET="$(bashio::config 'S3_BUCKET')"
|
|
|
|
bashio::log.info "Waiting for MinIO API…"
|
|
until /usr/local/bin/mc alias set h0 http://localhost:3200 "${MINIO_USER}" "${MINIO_PASS}" 2>/dev/null; do
|
|
sleep 1
|
|
done
|
|
|
|
bashio::log.info "Ensuring bucket ${S3_BUCKET} exists…"
|
|
/usr/local/bin/mc mb -p "h0/${S3_BUCKET}" || true
|
|
bashio::log.info "MinIO bucket ready."
|
|
exit 0
|