소스 검색

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
 }