ソースを参照

start service on exit instead of immediately

Michael Yang 1 年間 前
コミット
d294a11bc9
1 ファイル変更3 行追加1 行削除
  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
 }