From d294a11bc9d7e7094870698173e152c32758e63c Mon Sep 17 00:00:00 2001 From: Michael Yang Date: Mon, 25 Sep 2023 16:11:21 -0700 Subject: [PATCH] start service on exit instead of immediately --- scripts/install.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/install.sh b/scripts/install.sh index 82eca656..dbc5ff6a 100644 --- a/scripts/install.sh +++ b/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 }