-
Notifications
You must be signed in to change notification settings - Fork 5
/
install.sh
executable file
·87 lines (69 loc) · 2.58 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
#!/bin/bash
set -e
trap 'echo "[ERROR] Error in line $LINENO when executing: $BASH_COMMAND"' ERR
renice 10 $$
IPATH=/usr/local/share/combine1090
function aptInstall() {
if ! apt install -y --no-install-recommends --no-install-suggests "$@"; then
apt update
apt install -y --no-install-recommends --no-install-suggests "$@"
fi
}
aptInstall wget socat
if [[ -z "$1" ]] || [[ "$1" != "test" ]]; then
cd /tmp
if ! wget -q -O master.zip https://github.com/wiedehopf/combine1090/archive/master.zip || ! unzip -q -o master.zip
then
echo "Unable to download files, exiting!"
exit 1
fi
cd combine1090-master
elif [[ "$1" == "test" ]]; then
tmpdir=/tmp/combine1090-test
mkdir -p $tmpdir
cp -r ./* $tmpdir
cd $tmpdir
fi
if ! id -u combine1090 &>/dev/null
then
adduser --system --home $IPATH --no-create-home --quiet combine1090
fi
# if you are reading this and trying to install using manual commands, use these instead of the block above
# cd /tmp
# wget -q -O master.zip https://github.com/wiedehopf/combine1090/archive/master.zip
# unzip -o master.zip
# cd combine1090-master
# remove old webinterface
rm -f /etc/lighttpd/conf-enabled/89-combine1090.conf
cp -n combine1090.default /etc/default/combine1090
cp combine1090.service /lib/systemd/system
#unmask or get rid of old versions of the service files
rm -f /etc/systemd/system/combine1090-dump.service /etc/systemd/system/combine1090.service
cp combine1090.sh /usr/local/bin
chmod +x /usr/local/bin/combine1090.sh
# compile readsb
bash readsb-nopackage.sh "$IPATH/bin"
systemctl enable combine1090
if [[ $1 == "redirect-only" ]]; then
systemctl restart combine1090
echo --------------
echo "All done, don't forget to configure (sudo nano /etc/default/combine1090)"
echo "After you are done with configuration don't forget"
echo "to apply the new settings (sudo systemctl restart combine1090)"
echo --------------
exit 0
fi
cp combine1090-dump.service /lib/systemd/system
systemctl enable combine1090-dump
systemctl restart combine1090-dump
systemctl restart combine1090
wget -O tar1090-install.sh https://github.com/raw/wiedehopf/tar1090/master/install.sh
bash tar1090-install.sh /run/combine1090 combine1090
echo --------------
echo "All done, don't forget to configure (sudo nano /etc/default/combine1090)"
echo "After you are done with configuration don't forget"
echo "to apply the new settings (sudo systemctl restart combine1090)"
echo "Webinterface available at $(ip route | grep -m1 -o -P 'src \K[0-9,.]*')/combine1090"
echo --------------
cd /tmp
rm -rf /tmp/combine1090-master /tmp/combine1090-test