-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlaunch2.sh
More file actions
36 lines (28 loc) · 813 Bytes
/
launch2.sh
File metadata and controls
36 lines (28 loc) · 813 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
#!/bin/sh
set -eu
# temp exit early code for debugging
# exit 1
SCRIPT_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
PYTHON_BIN="${PYTHON_BIN:-$SCRIPT_DIR/env/bin/python3}"
if [ ! -x "$PYTHON_BIN" ]; then
PYTHON_BIN="python3"
fi
WAIT_SECONDS="${NETWORK_WAIT_SECONDS:-30}"
READY_IP=""
while [ "$WAIT_SECONDS" -gt 0 ]; do
READY_IP="$(ip -4 -o addr show dev eth0 2>/dev/null | awk '{print $4}' | cut -d/ -f1 | head -n1 || true)"
if [ -n "$READY_IP" ]; then
break
fi
sleep 1
WAIT_SECONDS=$((WAIT_SECONDS - 1))
done
export WRECORDER_STREAMER_IP="$READY_IP"
"$PYTHON_BIN" -u "$SCRIPT_DIR/camera_streamer.py" \
--base-port 5555 \
--streamer-name cam-pi-2 \
--auto-find-cameras on \
--target-fps 30 \
--never-give-up on \
--mosaic on \
--only-eth0