feat: Add --boot flag and auto-start logic to entrypoint

This commit is contained in:
2026-04-16 16:07:02 -04:00
parent 5226c246e5
commit 36d1e0e842
2 changed files with 2 additions and 14 deletions

View File

@@ -48,13 +48,7 @@ if command_exists socat && socat - TCP:$HOST:$PORT,connect-timeout=1 2>/dev/null
fi
# 2. Launch
if [ -f "opencortex.asd" ]; then
if [ -f .env ]; then
# Robustly export variables without triggering shell syntax errors
while IFS= read -r line || [[ -n "$line" ]]; do
if [[ ! "$line" =~ ^# ]] && [[ "$line" =~ = ]]; then
export "$line"
fi
if [ -f "opencortex.asd" ]; then echo -e "${YELLOW}Brain is offline. Starting it now...${NC}"; $0 --boot > brain.log 2>&1 & sleep 10; exec $0 "$@"; fi
done < .env
fi
echo -e "${BLUE}Starting OpenCortex Brain...${NC}"