-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
install_clients.sh
85 lines (74 loc) · 2.14 KB
/
install_clients.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/sh
ORIGINAL_PATH=`pwd`
SOURCE_PATH=~/source
mkdir -p ${SOURCE_PATH}
echo "[Airframes] Installing system dependencies"
apt update
apt install -y build-essential cmake git libglib2.0-dev pkg-config librtlsdr-dev libsqlite3-dev libprotobuf-c-dev libzmq3-dev
echo
echo "[Airframes] Pulling down sources"
cd ${SOURCE_PATH}
git clone --depth 1 --single-branch https://github.com/airframesio/airframes-client.git
git clone --depth 1 --single-branch https://github.com/TLeconte/acarsdec.git
git clone --depth 1 --single-branch https://github.com/szpajder/libacars.git
git clone --depth 1 --single-branch https://github.com/romanbsd/statsd-c-client.git
git clone --depth 1 --single-branch https://github.com/airframesio/dumpvdl2.git
git clone --depth 1 --single-branch https://github.com/TLeconte/vdlm2dec.git
echo
echo "[Airframes] Building libacars"
cd ${SOURCE_PATH}/libacars
mkdir build
cd build
cmake ../
make && make install && ldconfig
echo
echo "[Airframes] Building acarsdec"
cd ${SOURCE_PATH}/acarsdec
mkdir build
cd build
cmake .. -Drtl=ON
make && make install
echo
echo "[Airframes] Building statsd-c-client"
cd ${SOURCE_PATH}/statsd-c-client
make && make install && ldconfig
echo
echo "[Airframes] Building dumpvdl2"
cd ${SOURCE_PATH}/dumpvdl2
mkdir build
cd build
cmake ../
make && make install
echo
echo "[Airframes] Building vdlm2dec"
cd ${SOURCE_PATH}/vdlm2dec
mkdir build
cd build
cmake .. -Drtl=ON
make && make install
echo
echo "[Airframes] Installing airframes-client"
cd ${SOURCE_PATH}/airframes-client
if [ ! -f "/boot/airframes.json" ]; then
cp json/airframes.json /boot/airframes.json
fi
cp debian/adc.service /etc/systemd/system
systemctl enable adc
apt install -y python3 python3-pip python3-venv python3-wheel python3-dev
mkdir -p /usr/local/airframes
cp -rf scripts/adc /usr/local/airframes
cd /usr/local/airframes/adc
python3 -m venv venv
source venv/bin/activate
pip3 install --upgrade pip
pip3 install wheel
pip3 install -r requirements.txt
echo
echo "[Airframes] Done!"
echo
cd $ORIGINAL_PATH
echo "[Airframes] Next steps:"
echo
echo " 1. Customize /boot/airframes.json"
echo " 2. Restart the service: systemctl restart adc"
echo