From d7a174615c9954728f555ffa7f40a7088b260773 Mon Sep 17 00:00:00 2001 From: Zoey Date: Thu, 23 Feb 2023 18:05:34 +0100 Subject: [PATCH] only remove domaincheck container if it is stopped Signed-off-by: Zoey --- Containers/mastercontainer/cron.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Containers/mastercontainer/cron.sh b/Containers/mastercontainer/cron.sh index f8cedce9..f6250206 100644 --- a/Containers/mastercontainer/cron.sh +++ b/Containers/mastercontainer/cron.sh @@ -48,7 +48,9 @@ while true; do find "/mnt/docker-aio-config/session/" -mindepth 1 -mmin +1440 -delete # Remove nextcloud-aio-domaincheck container - sudo -u www-data docker container remove nextcloud-aio-domaincheck --force + if docker ps --format "{{.Names}}" --filter "status=exited" | grep -qw "^nextcloud-aio-domaincheck$"; then + sudo -u www-data docker container remove nextcloud-aio-domaincheck + fi # Remove dangling images sudo -u www-data docker image prune --force