2024-02-17 12:21:51 -08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Check for network mounted devices
|
|
|
|
# NAS SMB
|
|
|
|
if ! mount -t cifs | grep -q '/mnt/nas'; then
|
2024-02-21 13:39:38 -08:00
|
|
|
echo " ==== NAS SMB shares not mounted"
|
2024-02-17 12:21:51 -08:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# NAS iSCSI
|
|
|
|
if ! sudo iscsiadm -m session | grep -q 'iqn.2020-03.net.jafner:fighter'; then
|
2024-02-21 13:39:38 -08:00
|
|
|
echo " ==== NAS iSCSI session not connected"
|
|
|
|
if ! mount -t ext4 | grep -q '/mnt/iscsi'; then
|
|
|
|
echo " ==== /mnt/iscsi not mounted"
|
|
|
|
exit 1
|
|
|
|
fi
|
2024-02-17 12:21:51 -08:00
|
|
|
fi
|
|
|
|
|
|
|
|
for stack in /home/admin/homelab/fighter/config/*; do
|
|
|
|
cd $stack
|
2024-02-21 13:39:38 -08:00
|
|
|
if ! docker compose config; then
|
|
|
|
echo " ==== Invalid compose config: $stack"
|
|
|
|
fi
|
|
|
|
echo " ==== Bringing up $stack"
|
2024-02-17 12:21:51 -08:00
|
|
|
docker compose up -d
|
|
|
|
cd /home/admin/homelab/fighter/config/
|
|
|
|
done
|
2024-02-20 19:13:01 -08:00
|
|
|
|
|
|
|
# extra thing because my keycloak healthcheck doesn't work properly
|
|
|
|
|
2024-02-21 13:39:38 -08:00
|
|
|
echo " ==== Wait 15s, then bring Keycloak forwardauth containers online"
|
2024-02-20 19:13:01 -08:00
|
|
|
cd /home/admin/homelab/fighter/config/keycloak
|
|
|
|
sleep 15
|
|
|
|
docker compose up -d
|