Forráskód Böngészése

hotfix(install.sh): ask to re-run install script after docker is installed

Nicolas Meienberger 1 éve
szülő
commit
ba3d860176
1 módosított fájl, 6 hozzáadás és 6 törlés
  1. 6 6
      scripts/install.sh

+ 6 - 6
scripts/install.sh

@@ -121,16 +121,12 @@ if ! command -v docker >/dev/null; then
   install_docker "${OS}"
   install_docker "${OS}"
   docker_result=$?
   docker_result=$?
 
 
-  if [[ docker_result -eq 0 ]]; then
-    echo "Docker installed"
-  else
+  if [[ docker_result -ne 0 ]]; then
     echo "Your system ${OS} is not supported trying with sub_os ${SUB_OS}"
     echo "Your system ${OS} is not supported trying with sub_os ${SUB_OS}"
     install_docker "${SUB_OS}"
     install_docker "${SUB_OS}"
     docker_sub_result=$?
     docker_sub_result=$?
 
 
-    if [[ docker_sub_result -eq 0 ]]; then
-      echo "Docker installed"
-    else
+    if [[ docker_sub_result -ne 0 ]]; then
       echo "Your system ${SUB_OS} is not supported please install docker manually"
       echo "Your system ${SUB_OS} is not supported please install docker manually"
       exit 1
       exit 1
     fi
     fi
@@ -138,11 +134,15 @@ if ! command -v docker >/dev/null; then
 
 
   # Make sure user is in docker group
   # Make sure user is in docker group
   if ! groups | grep -q '\bdocker\b'; then
   if ! groups | grep -q '\bdocker\b'; then
+    echo "Adding user to docker group"
     sudo usermod -aG docker "$USER"
     sudo usermod -aG docker "$USER"
+    echo "✓ Docker installed. Please re-run the installation script to continue with the installation. (curl -L https://setup.runtipi.io | bash)"
   fi
   fi
 
 
   # Reload user groups
   # Reload user groups
   newgrp docker
   newgrp docker
+
+  exit 0
 fi
 fi
 
 
 function check_dependency_and_install() {
 function check_dependency_and_install() {