From 013828f47455e3e1f6a986f1ca43439092a2dbf4 Mon Sep 17 00:00:00 2001 From: Cyril Blaecke Date: Sat, 29 Jun 2024 15:21:17 +0000 Subject: [PATCH] Fix setup without Ollama --- script/ollama/setup | 8 ++++---- script/ollama/start | 12 ++++++++++++ script/production/start | 6 +++--- 3 files changed, 19 insertions(+), 7 deletions(-) create mode 100755 script/ollama/start diff --git a/script/ollama/setup b/script/ollama/setup index 4b2d550..4b08851 100755 --- a/script/ollama/setup +++ b/script/ollama/setup @@ -1,12 +1,12 @@ #!/bin/bash -e -if command -v ollama &> /dev/null; then - echo "ollama is already installed" +if [ "$OLLAMA_URL" != "http://localhost:11434" ]; then + echo "OLLAMA_URL is not localhost" exit 0 fi -if [ -z "$OLLAMA_URL" ]; then - echo "OLLAMA_URL is already set" +if command -v ollama &> /dev/null; then + echo "ollama is already installed" exit 0 fi diff --git a/script/ollama/start b/script/ollama/start new file mode 100755 index 0000000..794262b --- /dev/null +++ b/script/ollama/start @@ -0,0 +1,12 @@ +#!/bin/bash -e + +if [ "$OLLAMA_URL" != "http://localhost:11434" ]; then + echo "OLLAMA_URL is not localhost" + exit 0 +fi + +source ./script/concerns/loader + +start_loader "Starting Ollama" +sudo systemctl start ollama.service &>> ./log/production.log +stop_loader diff --git a/script/production/start b/script/production/start index a1d38dc..6729a9e 100755 --- a/script/production/start +++ b/script/production/start @@ -2,9 +2,9 @@ source ./script/concerns/loader -start_loader "Starting Ollama" -sudo systemctl start ollama.service &>> ./log/production.log -stop_loader +if [ "$OLLAMA_URL" == "http://localhost:11434" ]; then + ./script/ollama/start +fi start_loader "Starting Nosia" source .env