about summary refs log tree commit diff stats
path: root/html/matt-chat/server.sh
diff options
context:
space:
mode:
authorelioat <{ID}+{username}@users.noreply.github.com>2025-01-03 11:17:39 -0500
committerelioat <{ID}+{username}@users.noreply.github.com>2025-01-03 11:17:39 -0500
commit91cba4bb79f8c6f4d58504de9b39b94198007068 (patch)
tree0bd32e47ed7aa8a41333887e390aee9901bb2a6b /html/matt-chat/server.sh
parent59d6b869cfd9b8342f9bf623070769dbea7a0105 (diff)
downloadtour-91cba4bb79f8c6f4d58504de9b39b94198007068.tar.gz
*
Diffstat (limited to 'html/matt-chat/server.sh')
-rwxr-xr-xhtml/matt-chat/server.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/html/matt-chat/server.sh b/html/matt-chat/server.sh
new file mode 100755
index 0000000..80a44f2
--- /dev/null
+++ b/html/matt-chat/server.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+# check that the ollama server is running, if it isn't, start it
+if ! pgrep -f ollama; then
+    echo "Ollama server is not running. Starting it now..."
+    ollama start
+fi
+
+# check that port 38478 is free
+if lsof -i :38478; then
+    echo "Port 38478 is already in use. Please choose a different port."
+    exit 1
+fi
+
+# Start a simple HTTP server using Python on port 38478
+python3 -m http.server 38478
+
+
+#   nvim ~/Library/LaunchAgents/com.user.server.plist
+#   launchctl load ~/Library/LaunchAgents/com.user.server.plist
+#   launchctl start com.user.server
+#   launchctl list | grep com.user.server
+#   launchctl unload ~/Library/LaunchAgents/com.user.server.plist