-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·44 lines (35 loc) · 944 Bytes
/
Copy pathstart.sh
File metadata and controls
executable file
·44 lines (35 loc) · 944 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
39
40
41
42
43
44
#!/usr/bin/env bash
set -e # exit on error
echo "[INFO] Starting service..."
# Load .env if it exists
if [ -f .env ]; then
echo "[INFO] Loading .env file"
export $(grep -v '^#' .env | xargs)
else
echo "[WARN] No .env file found"
fi
# Function to require env vars
require_env() {
local var_name="$1"
local value="${!var_name}"
if [ -z "$value" ]; then
echo "[ERROR] Missing required environment variable: $var_name"
exit 1
fi
}
# Validate required variables
require_env IRI_BEARER_TOKEN
require_env IRI_MCP_API_KEY
echo "[INFO] Environment OK"
echo "[INFO] IRI_BEARER_TOKEN: ${IRI_BEARER_TOKEN:0:6}..."
echo "[INFO] IRI_MCP_API_KEY: ${IRI_MCP_API_KEY:0:6}..."
# Activate venv
if [ -f ".venv/bin/activate" ]; then
echo "[INFO] Activating virtual environment"
source .venv/bin/activate
else
echo "[WARN] No virtual environment found"
fi
# Start server
echo "[INFO] Launching server..."
exec python3 server.py