From 19bec5834828a2318ee55e1535f28d03e5f834f9 Mon Sep 17 00:00:00 2001 From: Joey Hafner Date: Wed, 21 Feb 2024 13:39:38 -0800 Subject: [PATCH] Improve error handling for network devices, clean up echos --- fighter/scripts/startup.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/fighter/scripts/startup.sh b/fighter/scripts/startup.sh index ba43b42..c58a366 100644 --- a/fighter/scripts/startup.sh +++ b/fighter/scripts/startup.sh @@ -3,25 +3,32 @@ # Check for network mounted devices # NAS SMB if ! mount -t cifs | grep -q '/mnt/nas'; then - echo "NAS SMB shares not mounted" + echo " ==== NAS SMB shares not mounted" exit 1 fi # NAS iSCSI if ! sudo iscsiadm -m session | grep -q 'iqn.2020-03.net.jafner:fighter'; then - echo "NAS iSCSI share not mounted" - exit 1 + echo " ==== NAS iSCSI session not connected" + if ! mount -t ext4 | grep -q '/mnt/iscsi'; then + echo " ==== /mnt/iscsi not mounted" + exit 1 + fi fi for stack in /home/admin/homelab/fighter/config/*; do cd $stack + if ! docker compose config; then + echo " ==== Invalid compose config: $stack" + fi + echo " ==== Bringing up $stack" docker compose up -d cd /home/admin/homelab/fighter/config/ done # extra thing because my keycloak healthcheck doesn't work properly -echo "Wait 15s, then bring Keycloak forwardauth containers online" +echo " ==== Wait 15s, then bring Keycloak forwardauth containers online" cd /home/admin/homelab/fighter/config/keycloak sleep 15 docker compose up -d \ No newline at end of file