-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
54 lines (38 loc) · 1.26 KB
/
run.sh
File metadata and controls
54 lines (38 loc) · 1.26 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
52
#!/bin/bash
# RadarsMonitor startup script
# This script starts both the frontend (Bun) and backend (Python) services
set -e # Exit on error
export DISPLAY=:0
export XAUTHORITY=/home/ideon/.Xauthority
sleep 5
#rotate screen inverted
/usr/bin/xrandr --output DP-1 --rotate inverted
/usr/bin/xinput set-prop 'WaveShare WS170120' "Coordinate Transformation Matrix" -1 0 1 0 -1 1 0 0 1
PROJECT_DIR="/home/ideon/RadarsMonitor"
BUN_PATH="/home/ideon/.bun/bin/bun"
cd "$PROJECT_DIR" || exit 1
# Start Python radars manager
echo "Starting Python backend..."
python src/be/radars/radars_manager.py &> python.log &
# Start Bun frontend in production mode
echo "Starting Bun frontend..."
$BUN_PATH run prod &> bun.log &
# Start MediaMTX for camera streaming (use sudo on Linux only)
echo "Starting MediaMTX..."
DOCKER_CMD="docker"
#if [ "$(uname -s)" = "Linux" ]; then
# DOCKER_CMD="sudo docker"
#fi
# Stop existing mediamtx container if running
$DOCKER_CMD stop mediamtx 2>/dev/null || true
$DOCKER_CMD rm mediamtx 2>/dev/null || true
$DOCKER_CMD run -d --name mediamtx \
-p 8554:8554 \
-p 8889:8889 \
-p 8189:8189/udp \
-p 9997:9997 \
-v "$PWD/mediamtx.yml:/mediamtx.yml" \
bluenviron/mediamtx:latest \
&> mediamtx.log &
# Wait for all background processes
wait