From 838a215f67c146829158588baadd784988055094 Mon Sep 17 00:00:00 2001 From: andryyy Date: Fri, 21 Feb 2020 08:52:46 +0100 Subject: [PATCH] [Update] Make sure containers are gone before updating mailcow --- update.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/update.sh b/update.sh index c08d5954..f3b9d191 100755 --- a/update.sh +++ b/update.sh @@ -376,9 +376,15 @@ git diff >> ${DIFF_FILE} echo -e "\e[32mPrefetching images...\e[0m" prefetch_images -echo -e "Stopping mailcow... " +echo -e "\e[32mStopping mailcow...\e[0m" sleep 2 +MAILCOW_CONTAINERS=($(docker-compose ps -q)) docker-compose down +echo -e "\e[32mChecking for remaining containers...\e[0m" +sleep 2 +for container in "${MAILCOW_CONTAINERS[@]}"; do + docker rm -f "$container" 2> /dev/null +done # Silently fixing remote url from andryyy to mailcow git remote set-url origin https://github.com/mailcow/mailcow-dockerized