Skip to content

Commit ac505db

Browse files
authored
Update wingbits_installer.sh
1 parent 8722c59 commit ac505db

File tree

1 file changed

+43
-8
lines changed

1 file changed

+43
-8
lines changed

wingbits_installer.sh

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,22 @@ sed -i -e 's/RRATimespan 96048000/\0\nRRATimespan 576288000/' /etc/collectd/coll
5151
sed -i -e 's/XFF.*/XFF 0.8/' /etc/collectd/collectd.conf
5252
sed -i -e 's/skyview978/skyaware978/' /etc/collectd/collectd.conf
5353

54+
# unlisted interfaces
55+
for path in /sys/class/net/*
56+
do
57+
iface=$(basename $path)
58+
# no action on existing interfaces
59+
fgrep -q 'Interface "'$iface'"' /etc/collectd/collectd.conf && continue
60+
# only add interface starting with et en and wl
61+
case $iface in
62+
et*|en*|wl*)
63+
sed -i -e '/<Plugin "interface">/{a\
64+
Interface "'$iface'"
65+
}' /etc/collectd/collectd.conf
66+
;;
67+
esac
68+
done
69+
5470
rm -f /etc/cron.d/cron-graphs1090
5571
cp -r html /usr/share/graphs1090
5672
cp default /etc/default/graphs1090
@@ -59,6 +75,10 @@ cp collectd.conf /usr/share/graphs1090/default-collectd.conf
5975
cp service.service /lib/systemd/system/graphs1090.service
6076
cp nginx-graphs1090.conf /usr/share/graphs1090
6177

78+
echo "------------------"
79+
echo "TEST 1"
80+
echo "------------------"
81+
6282
if [ -d /etc/lighttpd/conf.d/ ] && ! [ -d /etc/lighttpd/conf-enabled/ ] && ! [ -d /etc/lighttpd/conf-available ] && command -v lighttpd &>/dev/null
6383
then
6484
ln -snf /etc/lighttpd/conf.d /etc/lighttpd/conf-enabled
@@ -69,6 +89,10 @@ then
6989
lighttpd=yes
7090
fi
7191

92+
echo "------------------"
93+
echo "TEST 2"
94+
echo "------------------"
95+
7296
if [[ $lighttpd == yes ]]; then
7397
cp 88-graphs1090.conf /etc/lighttpd/conf-available
7498
ln -snf /etc/lighttpd/conf-available/88-graphs1090.conf /etc/lighttpd/conf-enabled/88-graphs1090.conf
@@ -84,6 +108,10 @@ if [[ $lighttpd == yes ]]; then
84108
fi
85109
fi
86110

111+
echo "------------------"
112+
echo "TEST 3"
113+
echo "------------------"
114+
87115
SYM=/usr/share/graphs1090/data-symlink
88116
mkdir -p $SYM
89117
if [ -f /run/dump1090-fa/stats.json ]; then
@@ -106,6 +134,10 @@ else
106134
sed -i -e 's?URL .*?URL "file:///usr/share/graphs1090/data-symlink"?' /etc/collectd/collectd.conf
107135
fi
108136

137+
echo "------------------"
138+
echo "TEST 4"
139+
echo "------------------"
140+
109141
SYM=/usr/share/graphs1090/978-symlink
110142
mkdir -p $SYM
111143
if [ -f /run/skyaware978/aircraft.json ]; then
@@ -118,19 +150,18 @@ else
118150
sed -i -e 's?.*URL_978 .*?#URL_978 "http://localhost/skyaware978"?' /etc/collectd/collectd.conf
119151
fi
120152

121-
if grep jessie /etc/os-release >/dev/null
122-
then
123-
echo --------------
124-
echo "Some features are not available on jessie!"
125-
echo --------------
126-
sed -i -e 's/ADDNAN/+/' -e 's/TRENDNAN/TREND/' -e 's/MAXNAN/MAX/' -e 's/MINNAN/MIN/' $ipath/graphs1090.sh
127-
sed -i -e '/axis-format/d' $ipath/graphs1090.sh
128-
fi
153+
echo "------------------"
154+
echo "TEST 5"
155+
echo "------------------"
129156

130157
if [[ $lighttpd == yes ]]; then
131158
systemctl restart lighttpd
132159
fi
133160

161+
echo "------------------"
162+
echo "TEST 6"
163+
echo "------------------"
164+
134165
systemctl enable collectd &>/dev/null
135166
systemctl restart collectd &>/dev/null || true
136167

@@ -157,6 +188,10 @@ if ! systemctl status collectd &>/dev/null; then
157188
fi
158189
fi
159190

191+
echo "------------------"
192+
echo "TEST 7"
193+
echo "------------------"
194+
160195
if ! [[ -f /usr/share/graphs1090/noMalarky ]]; then
161196
bash $ipath/malarky.sh
162197
fi

0 commit comments

Comments
 (0)