-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·38 lines (33 loc) · 964 Bytes
/
start.sh
File metadata and controls
executable file
·38 lines (33 loc) · 964 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env bash
# Sovereign — start script
# Usage: ./start.sh
set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
cd "$SCRIPT_DIR/.."
# Load .env if present
ENV_FILE="$SCRIPT_DIR/.env"
if [ -f "$ENV_FILE" ]; then
set -a
source "$ENV_FILE"
set +a
else
echo "⚠️ No .env found. Copy sovereign/.env.example → sovereign/.env and fill it in."
exit 1
fi
# Sanity check
if [ -z "$SOVEREIGN_BOT_TOKEN" ]; then
echo "❌ SOVEREIGN_BOT_TOKEN is empty. Add it to sovereign/.env"
exit 1
fi
# Kill any stale Sovereign processes and free ports
echo "🧹 Cleaning stale processes..."
pkill -f "python.*sovereign\.(daemon|aleph_cli)" 2>/dev/null || true
for port in 8800 3100 3200 3456 8600; do
fuser -k "$port/tcp" 2>/dev/null || true
done
sleep 1
echo "🟢 Sovereign booting..."
echo " Model: ${SOVEREIGN_MODEL}"
echo " Ollama: ${SOVEREIGN_OLLAMA_URL}"
echo ""
"$SCRIPT_DIR/.venv/bin/python" -m sovereign.aleph_cli "$@"