Debug echo status of last command

This commit is contained in:
Joey Hafner 2022-08-18 10:46:27 -07:00
parent 511a12333f
commit d36d86ee89

View File

@ -5,10 +5,6 @@ do
CONTAINER_NAME=$(docker ps -aq --filter "id=$CONTAINER_ID" --format '{{.Names}}') # get the container's name 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 CONTAINER_MOUNTS=$(docker inspect --format '{{range .Mounts}}{{println .Source}}{{end}}' $CONTAINER_ID) # print the container's volume mounts
echo "======== CHECKING $CONTAINER_NAME ========" echo "======== CHECKING $CONTAINER_NAME ========"
if grep -q /mnt/nas $(echo "$CONTAINER_MOUNTS") $(echo "CONTAINER_MOUNTS" | grep /mnt/nas)
then echo $?
echo "IS NAS DEPENDENT"
else
echo "IS NOT NAS DEPENDENT"
fi
done done