Skip to content

Commit 0714c87

Browse files
committed
fix(mc): fix create_bucket error
1 parent d140c7e commit 0714c87

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

rootfs/bin/create_bucket

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,16 @@ set -e
44

55
# shellcheck disable=SC1091
66
source /bin/normalize_storage
7-
has_bucket=$(mc ls minio -json|jq -r '.key'|grep -w "${MINIO_BUCKET}")
8-
if [ -z "$has_bucket" ] ;then
7+
8+
has_bucket(){
9+
mc ls minio -json|jq -r '.key'|grep -w "${MINIO_BUCKET}"
10+
}
11+
12+
if [ -z "$(has_bucket)" ] ;then
913
mc mb minio/"${MINIO_BUCKET}"
14+
if [ -z "$(has_bucket)" ] ;then
15+
echo "create bucket ${MINIO_BUCKET} error"
16+
exit 1
17+
fi
1018
fi
19+
echo "create bucket ${MINIO_BUCKET} success"

0 commit comments

Comments
 (0)