feat: Add --boot flag and auto-start logic to entrypoint
This commit is contained in:
@@ -48,13 +48,7 @@ if command_exists socat && socat - TCP:$HOST:$PORT,connect-timeout=1 2>/dev/null
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# 2. Launch
|
# 2. Launch
|
||||||
if [ -f "opencortex.asd" ]; then
|
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
|
||||||
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
|
|
||||||
done < .env
|
done < .env
|
||||||
fi
|
fi
|
||||||
echo -e "${BLUE}Starting OpenCortex Brain...${NC}"
|
echo -e "${BLUE}Starting OpenCortex Brain...${NC}"
|
||||||
|
|||||||
@@ -39,13 +39,7 @@ if command_exists socat && socat - TCP:$HOST:$PORT,connect-timeout=1 2>/dev/null
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# 2. Launch
|
# 2. Launch
|
||||||
if [ -f "opencortex.asd" ]; then
|
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
|
||||||
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
|
|
||||||
done < .env
|
done < .env
|
||||||
fi
|
fi
|
||||||
echo -e "${BLUE}Starting OpenCortex Brain...${NC}"
|
echo -e "${BLUE}Starting OpenCortex Brain...${NC}"
|
||||||
|
|||||||
Reference in New Issue
Block a user