forked from TanerH/adsbexchange-stats
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
52 lines (38 loc) · 1.24 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
#!/bin/bash
IPATH=/usr/local/share/adsbexchange-stats/
set -e
mkdir -p $IPATH
if ! id -u adsbexchange &>/dev/null
then
adduser --system --home $IPATH --no-create-home --quiet adsbexchange >/dev/null
fi
# requires uuidgen curl jq inotify-tools gzip
apt-get update
apt-get install -y curl uuid-runtime jq inotify-tools gzip dnsutils
mkdir -p /usr/local/bin
cp adsbexchange-showurl /usr/local/bin/adsbexchange-showurl
hash -r
cp json-status $IPATH
cp create-uuid.sh $IPATH
chmod +x $IPATH/json-status
chmod +x $IPATH/create-uuid.sh
cp uninstall.sh $IPATH
if [ -f /boot/adsb-config.txt ] && ! [ -d /run/adsbexchange-feed ] && ! [ -f /etc/default/adsbexchange-stats ]
then
echo "USE_OLD_PATH=1" > /etc/default/adsbexchange-stats
fi
bash $IPATH/create-uuid.sh
#copy the service file
cp adsbexchange-stats.service /etc/systemd/system/adsbexchange-stats.service
#wait (needed?)
sleep 2
#enable service
systemctl enable adsbexchange-stats.service
#start service
systemctl restart adsbexchange-stats.service
#output uuid
echo "#####################################"
cat /boot/adsbx-uuid
echo "#####################################"
sed -e 's$^$https://www.adsbexchange.com/api/feeders/?feed=$' /boot/adsbx-uuid
echo "#####################################"