diff --git a/adminscripts/healthchecks.sh b/adminscripts/healthchecks.sh new file mode 100755 index 0000000..a2c4e14 --- /dev/null +++ b/adminscripts/healthchecks.sh @@ -0,0 +1,11 @@ +SCRIPT_DIR=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd) +GLOB_DIR=$SCRIPT_DIR/.. + + +SERVICES=( recipes ) + +for service in "${SERVICES[@]}" +do + cd $GLOB_DIR/$service; ./on-healthcheck-failed.sh; +done + diff --git a/recipes/on-healthcheck-failed.sh b/recipes/on-healthcheck-failed.sh new file mode 100755 index 0000000..ecc87ed --- /dev/null +++ b/recipes/on-healthcheck-failed.sh @@ -0,0 +1,5 @@ +docker ps -f name=mealie --format "{{.Status}}" | grep "unhealthy"; +if [ $? -eq 0 ]; then +docker-compose down; docker-compose up -d --build; +fi +