Skip to content

Instantly share code, notes, and snippets.

@p32929
Created March 31, 2026 02:13
Show Gist options
  • Select an option

  • Save p32929/2c5641447a882db6fcbe340230982d32 to your computer and use it in GitHub Desktop.

Select an option

Save p32929/2c5641447a882db6fcbe340230982d32 to your computer and use it in GitHub Desktop.
ocl.bash
#!/bin/bash
# Quick launcher for OpenClaw dashboard
# Ensures all services are running, then opens dashboard
# 1. Ensure Qdrant is running (needed for Mem0)
if ! lsof -i :6333 &>/dev/null; then
echo "Starting Qdrant..."
launchctl bootout gui/$(id -u)/dev.qdrant 2>/dev/null
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/dev.qdrant.plist 2>/dev/null
sleep 2
fi
# 2. Ensure Ollama is running (needed for embeddings)
if ! pgrep -q ollama; then
echo "Starting Ollama..."
brew services start ollama &>/dev/null
sleep 2
fi
# 3. Ensure OpenClaw gateway is running
if ! lsof -i :18789 &>/dev/null; then
echo "Starting OpenClaw gateway..."
# Reinstall if plist is missing
if [ ! -f ~/Library/LaunchAgents/ai.openclaw.gateway.plist ]; then
openclaw gateway install &>/dev/null
fi
launchctl bootout gui/$(id -u)/ai.openclaw.gateway 2>/dev/null
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/ai.openclaw.gateway.plist 2>/dev/null
# Wait up to 5s
for i in {1..10}; do
lsof -i :18789 &>/dev/null && break
sleep 0.5
done
# Fallback
if ! lsof -i :18789 &>/dev/null; then
openclaw gateway start &>/dev/null
sleep 2
fi
if ! lsof -i :18789 &>/dev/null; then
echo "Failed to start gateway. Run: openclaw gateway run"
exit 1
fi
fi
echo "All services running."
openclaw dashboard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment