From 4a52bf6d5f86049d47e7b1003a36fe28078334a5 Mon Sep 17 00:00:00 2001 From: zeus Date: Wed, 24 Nov 2021 13:06:28 +0200 Subject: [PATCH] check status container --- check-services.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 check-services.sh diff --git a/check-services.sh b/check-services.sh new file mode 100755 index 0000000..42f1f84 --- /dev/null +++ b/check-services.sh @@ -0,0 +1,14 @@ +#!/bin/bash + + + +running="$(docker-compose ps --services --filter "status=running")" +services="$(docker-compose ps --services)" +if [ "$running" != "$services" ]; then + # Bash specific + RUN=$(comm -13 <(sort <<<"$running") <(sort <<<"$services")) + echo "Following_services_are_not_running:" + echo "$RUN" + else + echo "All_services_are_running" +fi