summaryrefslogtreecommitdiff
path: root/verify_minio.sh
blob: affe981c98a30e544439e59abefb0b9d05e4d199 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash

set -euo pipefail

# CONFIG
ZFS_PATH="/assets/"
MINIO_USER="minio-user"
EXPECTED_BUCKETS=(
  "assets_azuracast"
  "assets_archives"
  "assets_genesisassets"
  "assets_genesislibrary"
  "assets_mastodon"
  "assets_teamtalkdata"
)

echo "=== Verifying ZFS MinIO Layout in $ZFS_PATH ==="

for BUCKET in "${EXPECTED_BUCKETS[@]}"; do
  BUCKET_PATH="$ZFS_PATH/$BUCKET"
  echo "- Checking: $BUCKET_PATH"
  
  if [ -d "$BUCKET_PATH" ]; then
    echo "  ✅ Exists"
    OWNER=$(stat -c '%U' "$BUCKET_PATH")
    if [ "$OWNER" == "$MINIO_USER" ]; then
      echo "  ✅ Ownership correct: $OWNER"
    else
      echo "  ❌ Ownership incorrect: $OWNER"
    fi
  else
    echo "  ❌ Missing bucket directory!"
  fi
done

echo ""
echo "If MinIO is already running, run the following to confirm bucket visibility:"
echo "  mc alias set local http://localhost:9000 genesisadmin MutationXv3!"
echo "  mc ls local/"