File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -166,12 +166,22 @@ curl -fsSL https://ollama.com/download/ollama-linux-amd64.tar.zst \
166166 | sudo tar x --zstd -C /usr
167167sudo useradd -r -s /bin/false -U -m -d /usr/share/ollama ollama
168168sudo usermod -a -G ollama " $( whoami) "
169- sudo cp ~ /.dotfiles/ollama/ollama.service /etc/systemd/system/
170- sudo systemctl daemon-reload
171- sudo systemctl enable --now ollama.service
172- # HACK: wait for ollama server to start
173- # on docker build, ollama server needs to be started manually
174- nohup /usr/sbin/ollama serve > /dev/null 2>&1 & sleep 5
169+
170+ if systemctl is-system-running; then
171+ echo " systemd running"
172+ sudo cp ~ /.dotfiles/ollama/ollama.service /etc/systemd/system/
173+ sudo systemctl daemon-reload
174+ sudo systemctl enable --now ollama.service
175+
176+ else
177+ echo " systemd not running"
178+ # HACK: wait for ollama server to start
179+ # on docker build, ollama server needs to be started manually
180+ export PATH=" $PATH :/usr/sbin/ollama"
181+ nohup ollama serve > /dev/null 2>&1 & sleep 5
182+
183+ fi
184+
175185ollama create -f ~ /.dotfiles/ollama/modelfile_gpt-oss-20b-ol gpt-oss-20b-ol
176186ollama rm gpt-oss:20b
177187
You can’t perform that action at this time.
0 commit comments