From e2ac019f512ba94e236694c393ce2e8490d4bd90 Mon Sep 17 00:00:00 2001
From: Giuseppe Speranza <gsperanza204@gmail.com>
Date: Sun, 28 Jan 2024 01:50:12 +0100
Subject: [PATCH] Fixed errors regarding the installation script (#6644)

install.sh: fix bash error

Error 1:
./install.sh: 26: [[: not found

Error 2:
docker: 'compose' is not a docker command.

Signed-off-by: Peppe289 <gsperanza204@protonmail.com>
---
 install.sh | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/install.sh b/install.sh
index 0ee6a87631..6b266ef925 100755
--- a/install.sh
+++ b/install.sh
@@ -23,7 +23,8 @@ download_dot_env_file() {
 }
 
 replace_env_value() {
-  if [[ "$OSTYPE" == "darwin"* ]]; then
+  KERNEL="$(uname -s | tr '[:upper:]' '[:lower:]')"
+  if [ "$KERNEL" = "darwin" ]; then
     sed -i '' "s|$1=.*|$1=$2|" ./.env
   else
     sed -i "s|$1=.*|$1=$2|" ./.env
@@ -39,9 +40,9 @@ populate_upload_location() {
 start_docker_compose() {
   echo "Starting Immich's docker containers"
 
-  if docker compose &>/dev/null; then
+  if docker compose > /dev/null 2>&1; then
     docker_bin="docker compose"
-  elif docker-compose &>/dev/null; then
+  elif docker-compose > /dev/null 2>&1; then
     docker_bin="docker-compose"
   else
     echo 'Cannot find `docker compose` or `docker-compose`.'