Explorar el Código

start service on exit instead of immediately

Michael Yang hace 1 año
padre
commit
d294a11bc9
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. 3 1
      scripts/install.sh

+ 3 - 1
scripts/install.sh

@@ -92,7 +92,9 @@ EOF
             status "Enabling and starting ollama service..."
             $SUDO systemctl daemon-reload
             $SUDO systemctl enable ollama
-            $SUDO systemctl restart ollama
+
+            start_service() { $SUDO systemctl restart ollama; }
+            trap start_service EXIT
             ;;
     esac
 }