Optimized if-else arguments and outputs

This commit is contained in:
DerLinkman
2022-06-07 14:45:19 +02:00
parent 958112af6b
commit 74baf20feb
4 changed files with 27 additions and 24 deletions

View File

@@ -46,12 +46,13 @@ done
echo "checking docker compose version...";
if docker --help | grep compose; then
if docker compose >/dev/null 2>&1; then
echo -e "\e[32mFound Compose v2!\e[0m"
COMPOSE_COMMAND="docker compose"
elif docker-compose version --short | grep -m1 "^1" > /dev/null 2>&1; then
echo -e "\e[31mWARN: Your machine is using Docker-Compose v1!\e[0m"
echo -e "\e[31mmailcow will drop the Docker-Compose v1 Support in December 2022\e[0m"
echo -e "\e[31mPlease consider a upgrade to Docker-Compose v2.\e[0m"
echo -e "\e[33mWARN: Your machine is using Docker-Compose v1!\e[0m"
echo -e "\e[33mmailcow will drop the Docker-Compose v1 Support in December 2022\e[0m"
echo -e "\e[33mPlease consider a upgrade to Docker-Compose v2.\e[0m"
echo
echo
echo -e "\e[33mContinuing...\e[0m"
@@ -738,4 +739,4 @@ fi
#echo
#git reflog --color=always | grep "Before update on "
#echo
#echo "Use \"git reset --hard hash-on-the-left\" and run ${COMPOSE_COMMAND} up -d afterwards."
#echo "Use \"git reset --hard hash-on-the-left\" and run ${COMPOSE_COMMAND} up -d afterwards."