浏览代码

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
 }