Restore docker-compose check in scripts

This commit is contained in:
DerLinkman
2022-06-16 12:49:17 +02:00
parent 36e4ee7738
commit 872fa07213
3 changed files with 9 additions and 95 deletions

View File

@@ -25,29 +25,10 @@ if cp --help 2>&1 | grep -q -i "busybox"; then
exit 1
fi
for bin in openssl curl docker git awk sha1sum; do
for bin in openssl curl docker docker-compose git awk sha1sum; do
if [[ -z $(which ${bin}) ]]; then echo "Cannot find ${bin}, exiting..."; exit 1; fi
done
echo "checking docker compose version...";
if docker compose >/dev/null 2>&1; then
echo -e "\e[32mFound Compose v2!\e[0m"
elif docker-compose version --short | grep -m1 "^2" > /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[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"
sleep 3
else
echo -e "\e[31mCannot find Docker-Compose v1 or v2 on your System. Please install Docker-Compose v2 and re-run the Script.\e[0m"
exit 1
fi
if [ -f mailcow.conf ]; then
read -r -p "A config file exists and will be overwritten, are you sure you want to continue? [y/N] " response
case $response in