-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathrpi_setup.sh
executable file
·50 lines (40 loc) · 989 Bytes
/
rpi_setup.sh
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
#!/bin/bash
set -e
set -x
apt-get update
apt-get install build-essential libraspberrypi0 libraspberrypi-bin gstreamer1.0-tools gstreamer1.0-plugins-good
make mode=rpi3
cp -a osd fpv_video/{fpv_video,fpv_video.sh} /usr/bin
cat > /etc/systemd/system/osd.service <<EOF
[Unit]
Description=FPV OSD
After=network-online.target
[Service]
ExecStart=/bin/openvt -s -e -- bash -c 'TERM=linux setterm --blank force --clear all --cursor off /dev/tty && exec /usr/bin/osd'
Type=simple
Restart=always
RestartSec=1s
TimeoutStopSec=10s
KillMode=control-group
[Install]
WantedBy=multi-user.target
EOF
cat > /etc/systemd/system/fpv-video.service <<EOF
[Unit]
Description=FPV video
After=network-online.target
[Service]
ExecStart=/usr/bin/fpv_video.sh
Type=simple
Restart=always
RestartSec=1s
TimeoutStopSec=10s
KillMode=control-group
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable fpv-video
systemctl enable osd
systemctl restart fpv-video
systemctl restart osd