Small fixes

This commit is contained in:
2026-04-11 13:06:08 +02:00
parent 5226ad0842
commit defdc60a52
2 changed files with 26 additions and 8 deletions
+19 -6
View File
@@ -55,15 +55,28 @@ if command -v ollama >/dev/null 2>&1; then
else
info "Installing Ollama..."
curl -fsSL https://ollama.com/install.sh | sh
info "Ollama installed and started as systemd service"
fi
# Verify the systemd service is running
if systemctl is-active --quiet ollama 2>/dev/null; then
info "Ollama service running"
# Ensure the Ollama server is running
if [[ "$OS" == "Linux" ]]; then
if systemctl is-active --quiet ollama 2>/dev/null; then
info "Ollama service running"
else
info "Starting Ollama service..."
sudo systemctl enable --now ollama
fi
else
info "Starting Ollama service..."
sudo systemctl enable --now ollama
# macOS — check if server is already answering, otherwise start in background
if curl -sf http://localhost:11434/api/tags >/dev/null 2>&1; then
info "Ollama server already running"
else
info "Starting Ollama server..."
ollama serve >/tmp/ollama.log 2>&1 &
sleep 2
curl -sf http://localhost:11434/api/tags >/dev/null 2>&1 \
&& info "Ollama server started" \
|| echo " Warning: Ollama server didn't respond — start it manually with: ollama serve"
fi
fi
echo ""