-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart-server.sh
More file actions
executable file
·51 lines (43 loc) · 1.33 KB
/
start-server.sh
File metadata and controls
executable file
·51 lines (43 loc) · 1.33 KB
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
45
46
47
48
49
50
51
#!/bin/bash
set -e
echo "🚀 Starting Parser Proxy WebSocket Server..."
echo ""
if [ ! -f "config.toml" ]; then
echo "❌ Error: config.toml not found!"
echo "Please create a config.toml file first."
exit 1
fi
echo "🔍 Checking for existing parser-proxy-ws processes..."
EXISTING_PIDS=$(pgrep -f "parser-proxy-ws" || true)
if [ ! -z "$EXISTING_PIDS" ]; then
echo "⚠️ Found existing parser-proxy-ws processes: $EXISTING_PIDS"
echo "🔪 Killing existing processes..."
for pid in $EXISTING_PIDS; do
if sudo -n kill $pid 2>/dev/null; then
echo " ✅ Killed process $pid"
elif kill $pid 2>/dev/null; then
echo " ✅ Killed process $pid"
else
echo " ❌ Failed to kill process $pid (permission denied)"
echo " Please run: sudo kill $pid"
exit 1
fi
done
echo " Waiting 2 seconds for cleanup..."
sleep 2
else
echo " ✅ No existing processes found"
fi
echo ""
echo "📋 Checking configuration..."
echo " Config file: config.toml"
echo ""
echo "🔨 Building project in release mode..."
cargo build --release
echo ""
echo "✅ Starting server..."
echo " Press Ctrl+C to stop"
echo ""
echo "================================================"
echo ""
RUST_LOG=${RUST_LOG:-info} ./target/release/parser-proxy-ws