-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathinstall.sh
43 lines (30 loc) · 871 Bytes
/
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
#!/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
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
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 "#####################################"