public
nobgit
read
NobMail
Based on mailcow: dockerized
Languages
Repository composition by tracked source files.
PHP
49%
JavaScript
35%
HTML
9%
CSS
4%
Shell
2%
Python
1%
Lua
0%
Perl
0%
Ruby
0%
SCSS
0%
Create file
Wiki Documentation
Clone
https://nobgit.com/orgs/nobgit/nobmail.git
ssh://[email protected]:2222/orgs/nobgit/nobmail.git
Commit
core: improved docker compose version check
9a2887cf
_modules/scripts/core.sh | 72 ++++++++++++++++++++++++------------------------
1 file changed, 36 insertions(+), 36 deletions(-)
Diff
diff --git a/_modules/scripts/core.sh b/_modules/scripts/core.sh
index f776c621..576967a4 100644
--- a/_modules/scripts/core.sh
+++ b/_modules/scripts/core.sh
@@ -38,45 +38,45 @@ get_docker_version(){
}
get_compose_type(){
- if docker compose > /dev/null 2>&1; then
- if docker compose version --short | grep -e "^2." -e "^v2." > /dev/null 2>&1; then
- COMPOSE_VERSION=native
- COMPOSE_COMMAND="docker compose"
- if [[ "$caller" == "update.sh" ]]; then
- sed -i 's/^DOCKER_COMPOSE_VERSION=.*/DOCKER_COMPOSE_VERSION=native/' "$SCRIPT_DIR/mailcow.conf"
- fi
- echo -e "\e[33mFound Docker Compose Plugin (native).\e[0m"
- echo -e "\e[33mSetting the DOCKER_COMPOSE_VERSION Variable to native\e[0m"
- sleep 2
- echo -e "\e[33mNotice: You'll have to update this Compose Version via your Package Manager manually!\e[0m"
- else
- echo -e "\e[31mCannot find Docker Compose with a Version Higher than 2.X.X.\e[0m"
- echo -e "\e[31mPlease update/install it manually regarding to this doc site: https://docs.mailcow.email/install/\e[0m"
- exit 1
- fi
- elif docker-compose > /dev/null 2>&1; then
- if ! [[ $(alias docker-compose 2> /dev/null) ]] ; then
- if docker-compose version --short | grep "^2." > /dev/null 2>&1; then
- COMPOSE_VERSION=standalone
- COMPOSE_COMMAND="docker-compose"
- if [[ "$caller" == "update.sh" ]]; then
- sed -i 's/^DOCKER_COMPOSE_VERSION=.*/DOCKER_COMPOSE_VERSION=standalone/' "$SCRIPT_DIR/mailcow.conf"
- fi
- echo -e "\e[33mFound Docker Compose Standalone.\e[0m"
- echo -e "\e[33mSetting the DOCKER_COMPOSE_VERSION Variable to standalone\e[0m"
- sleep 2
- echo -e "\e[33mNotice: For an automatic update of docker-compose please use the update_compose.sh scripts located at the helper-scripts folder.\e[0m"
- else
- echo -e "\e[31mCannot find Docker Compose with a Version Higher than 2.X.X.\e[0m"
- echo -e "\e[31mPlease update/install manually regarding to this doc site: https://docs.mailcow.email/install/\e[0m"
- exit 1
- fi
+ if docker compose > /dev/null 2>&1; then
+ if docker compose version --short | grep -e "^[2-9]\." -e "^v[2-9]\." -e "^[1-9][0-9]\." -e "^v[1-9][0-9]\." > /dev/null 2>&1; then
+ COMPOSE_VERSION=native
+ COMPOSE_COMMAND="docker compose"
+ if [[ "$caller" == "update.sh" ]]; then
+ sed -i 's/^DOCKER_COMPOSE_VERSION=.*/DOCKER_COMPOSE_VERSION=native/' "$SCRIPT_DIR/mailcow.conf"
+ fi
+ echo -e "\e[33mFound Docker Compose Plugin (native).\e[0m"
+ echo -e "\e[33mSetting the DOCKER_COMPOSE_VERSION Variable to native\e[0m"
+ sleep 2
+ echo -e "\e[33mNotice: You'll have to update this Compose Version via your Package Manager manually!\e[0m"
+ else
+ echo -e "\e[31mCannot find Docker Compose with a Version Higher than 2.X.X.\e[0m"
+ echo -e "\e[31mPlease update/install it manually regarding to this doc site: https://docs.mailcow.email/install/\e[0m"
+ exit 1
fi
+ elif docker-compose > /dev/null 2>&1; then
+ if ! [[ $(alias docker-compose 2> /dev/null) ]] ; then
+ if docker-compose version --short | grep -e "^[2-9]\." -e "^[1-9][0-9]\." > /dev/null 2>&1; then
+ COMPOSE_VERSION=standalone
+ COMPOSE_COMMAND="docker-compose"
+ if [[ "$caller" == "update.sh" ]]; then
+ sed -i 's/^DOCKER_COMPOSE_VERSION=.*/DOCKER_COMPOSE_VERSION=standalone/' "$SCRIPT_DIR/mailcow.conf"
+ fi
+ echo -e "\e[33mFound Docker Compose Standalone.\e[0m"
+ echo -e "\e[33mSetting the DOCKER_COMPOSE_VERSION Variable to standalone\e[0m"
+ sleep 2
+ echo -e "\e[33mNotice: For an automatic update of docker-compose please use the update_compose.sh scripts located at the helper-scripts folder.\e[0m"
else
- echo -e "\e[31mCannot find Docker Compose.\e[0m"
- echo -e "\e[31mPlease install it regarding to this doc site: https://docs.mailcow.email/install/\e[0m"
- exit 1
+ echo -e "\e[31mCannot find Docker Compose with a Version Higher than 2.X.X.\e[0m"
+ echo -e "\e[31mPlease update/install manually regarding to this doc site: https://docs.mailcow.email/install/\e[0m"
+ exit 1
fi
+ fi
+ else
+ echo -e "\e[31mCannot find Docker Compose.\e[0m"
+ echo -e "\e[31mPlease install it regarding to this doc site: https://docs.mailcow.email/install/\e[0m"
+ exit 1
+ fi
}
detect_bad_asn() {