diff --git a/README.md b/README.md index 61c32b8..9ae1075 100644 --- a/README.md +++ b/README.md @@ -139,6 +139,9 @@ To leave the container on the console you have to execute 2x `exit`. ## Changelog +### 0.8.1 (17.01.2023) +* (simatec) Docker Compose Check added + ### 0.8.0 (17.01.2023) * (simatec) Config-Menu for Installer added diff --git a/install-piler.sh b/install-piler.sh index 795bc0a..e5f8779 100644 --- a/install-piler.sh +++ b/install-piler.sh @@ -50,6 +50,36 @@ BLA::stop_loading_animation() { ####################################################################################### +# Docker-Compose Check +if docker compose > /dev/null 2>&1; then + if docker compose version --short | grep "^2." > /dev/null 2>&1; then + COMPOSE_VERSION=native + echo -e "${red}Found Docker Compose Plugin (native).${normal}" + echo -e "${red}Setting the DOCKER_COMPOSE_VERSION Variable to native${normal}" + sleep 2 + echo -e "${purple}Notice: You´ll have to update this Compose Version via your Package Manager manually!${normal}" + else + echo -e "${red}Cannot find Docker Compose with a Version Higher than 2.X.X.${normal}" + 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 + echo -e "${red}Found Docker Compose Standalone.${normal}" + echo -e "${red}Setting the DOCKER_COMPOSE_VERSION Variable to standalone${normal}" + sleep 2 + else + echo -e "${red}Cannot find Docker Compose with a Version Higher than 2.X.X.${normal}" + exit 1 + fi + fi + +else + echo -e "${red}Cannot find Docker Compose.${normal}" + exit 1 +fi + # Path-Settings installPth="/opt/piler-docker" configPth="/opt/piler-docker/config" @@ -205,7 +235,12 @@ fi # old docker stop cd $installPth -docker-compose down + +if [ $COMPOSE_VERSION = native ]; then + docker compose down +else + docker-compose down +fi # docker start echo @@ -228,7 +263,12 @@ if [ "$USE_LETSENCRYPT" = "yes" ]; then fi fi -docker-compose up -d +if [ $COMPOSE_VERSION = native ]; then + docker compose up -d +else + docker-compose up -d +fi + echo "${blue}********* Piler started... Please wait... *********" @@ -361,7 +401,13 @@ echo "${blue}${HLINE}${normal}" echo cd $installPth -docker-compose restart piler + +if [ $COMPOSE_VERSION = native ]; then + docker compose restart piler +else + docker-compose restart piler +fi + echo echo "${greenBold}${HLINE}"