From 371c56bfd07b4d896c22e6a1d1e7d74b598368e2 Mon Sep 17 00:00:00 2001 From: Luca Beltrame Date: Thu, 12 May 2022 23:05:05 +0200 Subject: [PATCH] Minimal script to allow monit to check Docker containers --- sysadmin/check_docker_service.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 sysadmin/check_docker_service.sh diff --git a/sysadmin/check_docker_service.sh b/sysadmin/check_docker_service.sh new file mode 100755 index 0000000..4ace7cf --- /dev/null +++ b/sysadmin/check_docker_service.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +set -e +set -o pipefail +set -o nounset + +container="$1" + +/usr/bin/docker inspect -f '{{.State.Status}}' $container | grep -q running + +exit $?