-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinstall.sh
executable file
·121 lines (110 loc) · 4.4 KB
/
install.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#!/bin/bash
#set -x
echo "Simple installer script to work on a CLEAN RasPiOS Lite Image."
echo "Tested on RaspberryPi 3b, 3b+ and 4b"
echo "if you e.g. already have dump1090-fa or dump1090-mutability running, you can skip these steps"
read -p "Press return to continue"
sudo timedatectl set-timezone Europe/Berlin
echo
read -t 1 -n 10000 discard # discard input buffer
read -p "Install base dependencies? [y/n]" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo "installing base dependencies"
sudo apt install --yes python3-pip rtl-sdr
git clone https://github.com/wiedehopf/mlat-client.git
cd mlat-client
sudo python3 setup.py build
sudo python3 setup.py install
cd ..
fi
echo
read -t 1 -n 10000 discard
read -p "Install and setup dump1090-fa? [y/n]" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
sudo apt install --yes libncurses-dev librtlsdr-dev libbladerf-dev lighttpd debhelper libhackrf-dev liblimesuite-dev libsoapysdr-dev
mkdir dump1090 && cd dump1090
git clone https://github.com/VirusPilot/dump1090.git
cd dump1090
dpkg-buildpackage -b --no-sign
cd ..
sudo dpkg -i dump1090-fa_*.deb
cd ..
echo "I will now open the dump1090-fa configuration for you in nano."
echo "Please modify as needed, e.g.:"
echo "RECEIVER_SERIAL=1090 (to resolve a potential conflict with the SDR used by OGN)"
echo "RECEIVER_LAT=48.0 and RECEIVER_LON=10.0 (receiver location required to show distance from receiver)"
echo "Then save the file (Crtl+O, Return) and quit nano (Ctrl+X)."
read -p "Press return to continue"
sudo nano /etc/default/dump1090-fa
fi
echo
read -t 1 -n 10000 discard
read -p "Install OGN Client? [y/n]" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo blacklist rtl2832 | sudo tee /etc/modprobe.d/rtl-glidernet-blacklist.conf
echo blacklist r820t | sudo tee -a /etc/modprobe.d/rtl-glidernet-blacklist.conf
echo blacklist rtl2830 | sudo tee -a /etc/modprobe.d/rtl-glidernet-blacklist.conf
echo blacklist dvb_usb_rtl28xxu | sudo tee -a /etc/modprobe.d/rtl-glidernet-blacklist.conf
echo blacklist dvb_usb_v2 | sudo tee -a /etc/modprobe.d/rtl-glidernet-blacklist.conf
echo blacklist rtl8xxxu | sudo tee -a /etc/modprobe.d/rtl-glidernet-blacklist.conf
# download and unpack version 0.3.2
ARCH=$(getconf LONG_BIT)
DIST=$(lsb_release -r -s)
if [ "$ARCH" -eq 64 ] && [ "$DIST" -ge 12 ]; then
wget http://download.glidernet.org/arm64/rtlsdr-ogn-bin-arm64-0.3.2.tgz
else
if [ "$ARCH" -eq 32 ] && [ "$DIST" -ge 11 ]; then
wget http://download.glidernet.org/arm/rtlsdr-ogn-bin-ARM-0.3.2.tgz
else
echo
echo "wrong platform for this script, exiting"
echo
exit
fi
fi
tar xvf *.tgz
rm -f *.tgz
cd rtlsdr-ogn
/bin/bash ./setup-rpi.sh
cd ..
# download for automatic geoid sep
sudo wget http://download.glidernet.org/common/WW15MGH.DAC
echo "I will now open the OGN configuration file in nano. Please make proper adjustments."
echo "Most importantly, check latitude, longitude and altitude."
echo "You might also want to change the Device = 0 to something else to not conflict with dump1090."
echo "If you want to feed to OpenGliderNet aswell, you can change the APRS section "
echo "and give your receiver a Call and remove the Server=localhost.. line"
echo "Then save the file (Crtl+O, Return) and quit nano (Ctrl+X)."
read -t 1 -n 10000 discard
read -p "Press return to continue"
nano ogn_setup.conf
fi
echo
read -t 1 -n 10000 discard
read -p "Install service file/start ogn2dump1090 on boot [y/n]" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
OGN2DUMP1090DIR=$(pwd) envsubst < ogn2dump1090.service.template > ogn2dump1090.service
sudo mv ogn2dump1090.service /etc/systemd/system/
sudo systemctl enable ogn2dump1090
sudo systemctl start ogn2dump1090
fi
# TODO: can't transmit callsign via BEAST format...
#echo
#read -p "Install OGN Device DB for callsign lookup? [y/n]" -n 1 -r
#if [[ $REPLY =~ ^[Yy]$ ]]; then
# wget -O ddb.json http://ddb.glidernet.org/download/?j=1
#fi
echo
read -t 1 -n 10000 discard
read -p "The RaspberryPi now needs to be rebooted to make sure all permissions are set correctly. Afterwards
you should be able to access the dump1090-fa interface on
http://raspberrypi/skyaware.
Reboot now? [y/n]" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
sudo reboot
fi