From 9a439caf3f48160ce3d5b3347be85038679ee9b4 Mon Sep 17 00:00:00 2001 From: Joey Hafner Date: Thu, 29 Feb 2024 14:52:32 -0800 Subject: [PATCH] Fix comparison logic for bringing up a stack --- fighter/scripts/startup.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fighter/scripts/startup.sh b/fighter/scripts/startup.sh index f57989c..8a08efa 100644 --- a/fighter/scripts/startup.sh +++ b/fighter/scripts/startup.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -x # Check for network mounted devices # NAS SMB @@ -36,17 +37,17 @@ for stack in /home/admin/homelab/fighter/config/*; do # need the one that must be offline. # If all of those fail, we know the stack is dependent on an offline service # So we just skip the stack. - if (SMB_ONLINE=true && ISCSI_ONLINE=true); then + if $SMB_ONLINE && $ISCSI_ONLINE; then echo " ==== Bringing up $stack" docker compose up -d - elif (! echo $COMPOSE_CONFIG_TEXT | grep -q /mnt/nas && ISCSI_ONLINE=true); then + elif $ISCSI_ONLINE && ! ( echo $COMPOSE_CONFIG_TEXT | grep -q /mnt/nas ); then echo " ==== Bringing up $stack" docker compose up -d - elif (! echo $COMPOSE_CONFIG_TEXT | grep -q /mnt/iscsi && SMB_ONLINE=true); then + elif $SMB_ONLINE && ! ( echo $COMPOSE_CONFIG_TEXT | grep -q /mnt/iscsi ); then echo " ==== Bringing up $stack" docker compose up -d else - echo " ==== Skipping stack $stack" + echo " ==== Skipping stack $stack" fi cd /home/admin/homelab/fighter/config/