readme edit

This commit is contained in:
2024-01-27 20:30:05 +01:00
parent 76fe30e7c3
commit c6bfaabfe3
7 changed files with 102 additions and 70 deletions

22
check_docker_container.sh Normal file
View File

@@ -0,0 +1,22 @@
#!/bin/bash
container_name=$1
# Debugging output
echo "Checking container: $container_name"
state_restarting=$(sudo docker inspect --format="{{.State.Restarting}}" "$container_name")
state_running=$(sudo docker inspect --format="{{.State.Running}}" "$container_name" 2> /dev/null)
# Debugging output
echo "Restarting: $state_restarting"
echo "Running: $state_running"
if [ "$state_restarting" = "false" ] && [ "$state_running" = "true" ]; then
echo "Container is in the expected state. Exiting with status 0."
exit 0
else
echo "Container is not in the expected state. Exiting with status 1."
exit 1
fi