riotsecure/steps/step_ollama.sh
cediackermann ef27add5d3 Refactor setup into modular steps; add split-device support
- Extract shared helpers into steps/common.sh (colors, print_*, wait_for_user, ask_confirmation)
- Split each install step into its own sourced script under steps/
- setup.sh now sources step files instead of duplicating logic
- Add setup_ollama.sh: Ollama-only device setup (no Docker)
- Add setup_onyx.sh: Onyx-only device setup with auto-detection of Ollama host via network scan
- setup_ollama.sh prints ready-to-run setup_onyx.sh command with detected IP at completion
- Docker memory recommendation is MAX when machine has <20 GB RAM, 20 GB otherwise
- cleanup.sh and check-status.sh source steps/common.sh with inline curl fallback
- check-status.sh detects device mode (single/ollama/onyx) and skips irrelevant checks
- cleanup.sh reinstall message lists all three setup one-liners
- README updated with split-device one-liner commands
2026-04-24 09:53:33 +02:00

30 lines
918 B
Bash
Executable file

#!/bin/bash
# Step: Install and start Ollama. Source common.sh before sourcing this file.
install_ollama() {
print_step "Installing Ollama"
if command -v ollama &> /dev/null; then
print_success "Ollama is already installed"
ollama --version
else
print_warning "Installing Ollama..."
curl -fsSL https://ollama.com/install.sh | sh
print_success "Ollama installed successfully"
fi
print_warning "Starting Ollama service..."
if ! pgrep -x "ollama" > /dev/null; then
nohup ollama serve > /tmp/ollama.log 2>&1 &
sleep 3
if pgrep -x "ollama" > /dev/null; then
print_success "Ollama service started"
else
print_warning "Ollama service may not have started properly"
echo " Check logs at: /tmp/ollama.log"
fi
else
print_success "Ollama service already running"
fi
}