From c90cf8f6684a63f3f87e003ca6cff397c76a7182 Mon Sep 17 00:00:00 2001 From: Joey Hafner Date: Thu, 18 Aug 2022 11:00:41 -0700 Subject: [PATCH] Add list build logic --- server/scripts/nas_down.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/server/scripts/nas_down.sh b/server/scripts/nas_down.sh index 5150d7f..1315bc0 100755 --- a/server/scripts/nas_down.sh +++ b/server/scripts/nas_down.sh @@ -1,4 +1,5 @@ #!/bin/bash +NAS_DEPENDENTS="" for CONTAINER_ID in $(docker ps -aq) # get list of all loaded containers (running and stopped) do @@ -8,8 +9,9 @@ do echo "$CONTAINER_MOUNTS" | grep -q /mnt/nas MATCH=$? if [ $MATCH == 0 ]; then - echo "$CONTAINER_NAME IS NAS DEPENDENT" - else - echo "$CONTAINER_NAME IS NOT NAS DEPENDENT" + echo "$CONTAINER_NAME" + NAS_DEPENDENTS+=$CONTAINER_NAME fi -done \ No newline at end of file +done +echo "NAS_DEPENDENTS=" +echo "$NAS_DEPENDENTS" \ No newline at end of file