Improve error handling for network devices, clean up echos
This commit is contained in:
parent
544152bdc6
commit
19bec58348
@ -3,25 +3,32 @@
|
|||||||
# Check for network mounted devices
|
# Check for network mounted devices
|
||||||
# NAS SMB
|
# NAS SMB
|
||||||
if ! mount -t cifs | grep -q '/mnt/nas'; then
|
if ! mount -t cifs | grep -q '/mnt/nas'; then
|
||||||
echo "NAS SMB shares not mounted"
|
echo " ==== NAS SMB shares not mounted"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# NAS iSCSI
|
# NAS iSCSI
|
||||||
if ! sudo iscsiadm -m session | grep -q 'iqn.2020-03.net.jafner:fighter'; then
|
if ! sudo iscsiadm -m session | grep -q 'iqn.2020-03.net.jafner:fighter'; then
|
||||||
echo "NAS iSCSI share not mounted"
|
echo " ==== NAS iSCSI session not connected"
|
||||||
exit 1
|
if ! mount -t ext4 | grep -q '/mnt/iscsi'; then
|
||||||
|
echo " ==== /mnt/iscsi not mounted"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for stack in /home/admin/homelab/fighter/config/*; do
|
for stack in /home/admin/homelab/fighter/config/*; do
|
||||||
cd $stack
|
cd $stack
|
||||||
|
if ! docker compose config; then
|
||||||
|
echo " ==== Invalid compose config: $stack"
|
||||||
|
fi
|
||||||
|
echo " ==== Bringing up $stack"
|
||||||
docker compose up -d
|
docker compose up -d
|
||||||
cd /home/admin/homelab/fighter/config/
|
cd /home/admin/homelab/fighter/config/
|
||||||
done
|
done
|
||||||
|
|
||||||
# extra thing because my keycloak healthcheck doesn't work properly
|
# 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
|
cd /home/admin/homelab/fighter/config/keycloak
|
||||||
sleep 15
|
sleep 15
|
||||||
docker compose up -d
|
docker compose up -d
|
Loading…
Reference in New Issue
Block a user