From d36d86ee893530be540435f042acb394085f1694 Mon Sep 17 00:00:00 2001 From: Joey Hafner Date: Thu, 18 Aug 2022 10:46:27 -0700 Subject: [PATCH] Debug echo status of last command --- server/scripts/nas_down.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/server/scripts/nas_down.sh b/server/scripts/nas_down.sh index ea5fb95..b9d68e4 100755 --- a/server/scripts/nas_down.sh +++ b/server/scripts/nas_down.sh @@ -5,10 +5,6 @@ do CONTAINER_NAME=$(docker ps -aq --filter "id=$CONTAINER_ID" --format '{{.Names}}') # get the container's name CONTAINER_MOUNTS=$(docker inspect --format '{{range .Mounts}}{{println .Source}}{{end}}' $CONTAINER_ID) # print the container's volume mounts echo "======== CHECKING $CONTAINER_NAME ========" - if grep -q /mnt/nas $(echo "$CONTAINER_MOUNTS") - then - echo "IS NAS DEPENDENT" - else - echo "IS NOT NAS DEPENDENT" - fi + $(echo "CONTAINER_MOUNTS" | grep /mnt/nas) + echo $? done \ No newline at end of file