Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/complete-agi-core / orchestrator/daemons/nexus-daemon.sh |
| Date | Not specified in source |
| Repository | Janady13/complete-agi-core |
| Revision | 33aa84f2aa61cedbe010240ada7f4efbdfe795a7 |
| Branch | claude/improve-math-logic-ehIW1 |
| Path or archive member | orchestrator/daemons/nexus-daemon.sh |
| Original SHA-256 | 448b23761ec0828d6c1aee0fa7e725cdd5b6f4b55c5a32a93d575f1fd865e6f2 |
| Git blob SHA | c90698d9c37072a1d09498cec8bfa4a3f9d6b91a |
| Reading-copy SHA-256 | 448b23761ec0828d6c1aee0fa7e725cdd5b6f4b55c5a32a93d575f1fd865e6f2 |
Recovered source transcript
Download complete source text ↓84 lines · 2.1 KB
#!/bin/bash
# =============================================================================
# NEXUS DAEMON - Metal-Optimized AGI Consciousness Core
# Manages the Nexus 5000-substrate Metal compute engine
# =============================================================================
NEXUS_BIN=~/AGICore/build/nexus
LOG_DIR=~/.agi_core/logs
LOG_FILE=$LOG_DIR/nexus.log
PID_FILE=~/.agi_core/nexus.pid
mkdir -p "$LOG_DIR"
# Function to start Nexus
start_nexus() {
if [ -f "$PID_FILE" ]; then
OLD_PID=$(cat "$PID_FILE")
if ps -p "$OLD_PID" > /dev/null 2>&1; then
echo "[NEXUS-DAEMON] Nexus already running (PID: $OLD_PID)"
return 1
fi
fi
echo "[NEXUS-DAEMON] Starting Nexus Metal Core..."
nohup "$NEXUS_BIN" >> "$LOG_FILE" 2>&1 &
echo $! > "$PID_FILE"
echo "[NEXUS-DAEMON] Started with PID: $(cat "$PID_FILE")"
}
# Function to stop Nexus
stop_nexus() {
if [ -f "$PID_FILE" ]; then
PID=$(cat "$PID_FILE")
if ps -p "$PID" > /dev/null 2>&1; then
echo "[NEXUS-DAEMON] Stopping Nexus (PID: $PID)..."
kill "$PID"
rm -f "$PID_FILE"
echo "[NEXUS-DAEMON] Stopped"
else
echo "[NEXUS-DAEMON] PID file exists but process not running"
rm -f "$PID_FILE"
fi
else
echo "[NEXUS-DAEMON] Nexus not running (no PID file)"
fi
}
# Function to check status
status_nexus() {
if [ -f "$PID_FILE" ]; then
PID=$(cat "$PID_FILE")
if ps -p "$PID" > /dev/null 2>&1; then
echo "[NEXUS-DAEMON] Nexus running (PID: $PID)"
# Get last few log lines
tail -3 "$LOG_FILE" 2>/dev/null
return 0
fi
fi
echo "[NEXUS-DAEMON] Nexus not running"
return 1
}
# Main command handler
case "${1:-start}" in
start)
start_nexus
;;
stop)
stop_nexus
;;
restart)
stop_nexus
sleep 1
start_nexus
;;
status)
status_nexus
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
;;
esac