Skip to content

Commit e2263eb

Browse files
authored
Update wingbits_installer.sh
1 parent f24b719 commit e2263eb

File tree

1 file changed

+11
-43
lines changed

1 file changed

+11
-43
lines changed

wingbits_installer.sh

+11-43
Original file line numberDiff line numberDiff line change
@@ -38,33 +38,20 @@ wget --timeout=30 -q -O /tmp/master.zip https://github.com/wiedehopf/graphs1090/
3838
unzip -q -o master.zip
3939
cd /tmp/graphs1090-master
4040

41-
CPU_AIR=/run/collectd/localhost/dump1090-localhost/dump1090_cpu-airspy.rrd
42-
if [[ -f "$CPU_AIR" ]]; then
43-
cp "$CPU_AIR" /run/collectd/dump1090_cpu-airspy.rrd
44-
rrdtool tune --maximum value:U /run/collectd/dump1090_cpu-airspy.rrd
45-
cp -f /run/collectd/dump1090_cpu-airspy.rrd "$CPU_AIR"
46-
fi
41+
cp /run/collectd/localhost/dump1090-localhost/dump1090_cpu-airspy.rrd /run/collectd/dump1090_cpu-airspy.rrd
42+
rrdtool tune --maximum value:U /run/collectd/dump1090_cpu-airspy.rrd
43+
cp -f /run/collectd/dump1090_cpu-airspy.rrd /run/collectd/localhost/dump1090-localhost/dump1090_cpu-airspy.rrd
44+
rrdtool tune --maximum value:U /var/lib/collectd/rrd/localhost/dump1090-localhost/dump1090_cpu-airspy.rrd
4745

48-
systemctl stop collectd &>/dev/null || true
46+
cp dump1090.db dump1090.py system_stats.py LICENSE /usr/share/graphs1090
47+
cp *.sh /usr/share/graphs1090
48+
cp malarky.conf /usr/share/graphs1090
49+
chmod u+x /usr/share/graphs1090/*.sh
50+
cp /etc/collectd/collectd.conf /etc/collectd/collectd.conf.graphs1090 &>/dev/null || true
51+
cp collectd.conf /etc/collectd/collectd.conf
4952

50-
if [[ -f /var/lib/collectd/rrd/localhost/dump1090-localhost/dump1090_cpu-airspy.rrd ]]; then
51-
rrdtool tune --maximum value:U /var/lib/collectd/rrd/localhost/dump1090-localhost/dump1090_cpu-airspy.rrd
52-
fi
5353

54-
cp dump1090.db dump1090.py system_stats.py LICENSE $ipath
55-
cp *.sh $ipath
56-
cp malarky.conf $ipath
57-
chmod u+x $ipath/*.sh
58-
if ! grep -e 'system_stats' -qs /etc/collectd/collectd.conf &>/dev/null; then
59-
cp /etc/collectd/collectd.conf /etc/collectd/collectd.conf.graphs1090 &>/dev/null || true
60-
cp collectd.conf /etc/collectd/collectd.conf
61-
echo "------------------"
62-
echo "Overwriting /etc/collectd/collectd.conf, the old file has been moved to /etc/collectd/collectd.conf.graphs1090"
63-
echo "------------------"
64-
fi
65-
if ! grep -qs -e 'RRATimespan 576288000' /etc/collectd/collectd.conf &>/dev/null; then
66-
sed -i -e 's/RRATimespan 96048000/\0\nRRATimespan 576288000/' /etc/collectd/collectd.conf
67-
fi
54+
sed -i -e 's/RRATimespan 96048000/\0\nRRATimespan 576288000/' /etc/collectd/collectd.conf
6855
sed -i -e 's/XFF.*/XFF 0.8/' /etc/collectd/collectd.conf
6956
sed -i -e 's/skyview978/skyaware978/' /etc/collectd/collectd.conf
7057

@@ -194,25 +181,6 @@ if ! [[ -f /usr/share/graphs1090/noMalarky ]]; then
194181
bash $ipath/malarky.sh
195182
fi
196183

197-
systemctl enable graphs1090
198-
systemctl restart graphs1090
199-
200-
#fix readonly remount logic in fr24feed update script
201-
sed -i -e 's?$(mount | grep " on / " | grep rw)?{ mount | grep " on / " | grep rw; }?' /usr/lib/fr24/fr24feed_updater.sh &>/dev/null || true
202-
203-
echo --------------
204-
echo --------------
205-
echo "All done! Graphs available at http://$(ip route get 1.2.3.4 | grep -m1 -o -P 'src \K[0-9,.]*')/graphs1090"
206-
echo "It may take up to 10 minutes until the first data is displayed"
207-
208-
209-
if command -v nginx &>/dev/null
210-
then
211-
echo --------------
212-
echo "To configure nginx for graphs1090, please add the following line(s) in the server {} section:"
213-
echo "include /usr/share/graphs1090/nginx-graphs1090.conf;"
214-
fi
215-
216184
# curl -sL https://github.com/wiedehopf/graphs1090/raw/master/install.sh | bash
217185

218186
# install tar1090

0 commit comments

Comments
 (0)