Skip to content

Commit

Permalink
Update wingbits_installer.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
shawaj authored Jul 3, 2024
1 parent 8722c59 commit ac505db
Showing 1 changed file with 43 additions and 8 deletions.
51 changes: 43 additions & 8 deletions wingbits_installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,22 @@ sed -i -e 's/RRATimespan 96048000/\0\nRRATimespan 576288000/' /etc/collectd/coll
sed -i -e 's/XFF.*/XFF 0.8/' /etc/collectd/collectd.conf
sed -i -e 's/skyview978/skyaware978/' /etc/collectd/collectd.conf

# unlisted interfaces
for path in /sys/class/net/*
do
iface=$(basename $path)
# no action on existing interfaces
fgrep -q 'Interface "'$iface'"' /etc/collectd/collectd.conf && continue
# only add interface starting with et en and wl
case $iface in
et*|en*|wl*)
sed -i -e '/<Plugin "interface">/{a\
Interface "'$iface'"
}' /etc/collectd/collectd.conf
;;
esac
done

rm -f /etc/cron.d/cron-graphs1090
cp -r html /usr/share/graphs1090
cp default /etc/default/graphs1090
Expand All @@ -59,6 +75,10 @@ cp collectd.conf /usr/share/graphs1090/default-collectd.conf
cp service.service /lib/systemd/system/graphs1090.service
cp nginx-graphs1090.conf /usr/share/graphs1090

echo "------------------"
echo "TEST 1"
echo "------------------"

if [ -d /etc/lighttpd/conf.d/ ] && ! [ -d /etc/lighttpd/conf-enabled/ ] && ! [ -d /etc/lighttpd/conf-available ] && command -v lighttpd &>/dev/null
then
ln -snf /etc/lighttpd/conf.d /etc/lighttpd/conf-enabled
Expand All @@ -69,6 +89,10 @@ then
lighttpd=yes
fi

echo "------------------"
echo "TEST 2"
echo "------------------"

if [[ $lighttpd == yes ]]; then
cp 88-graphs1090.conf /etc/lighttpd/conf-available
ln -snf /etc/lighttpd/conf-available/88-graphs1090.conf /etc/lighttpd/conf-enabled/88-graphs1090.conf
Expand All @@ -84,6 +108,10 @@ if [[ $lighttpd == yes ]]; then
fi
fi

echo "------------------"
echo "TEST 3"
echo "------------------"

SYM=/usr/share/graphs1090/data-symlink
mkdir -p $SYM
if [ -f /run/dump1090-fa/stats.json ]; then
Expand All @@ -106,6 +134,10 @@ else
sed -i -e 's?URL .*?URL "file:///usr/share/graphs1090/data-symlink"?' /etc/collectd/collectd.conf
fi

echo "------------------"
echo "TEST 4"
echo "------------------"

SYM=/usr/share/graphs1090/978-symlink
mkdir -p $SYM
if [ -f /run/skyaware978/aircraft.json ]; then
Expand All @@ -118,19 +150,18 @@ else
sed -i -e 's?.*URL_978 .*?#URL_978 "http://localhost/skyaware978"?' /etc/collectd/collectd.conf
fi

if grep jessie /etc/os-release >/dev/null
then
echo --------------
echo "Some features are not available on jessie!"
echo --------------
sed -i -e 's/ADDNAN/+/' -e 's/TRENDNAN/TREND/' -e 's/MAXNAN/MAX/' -e 's/MINNAN/MIN/' $ipath/graphs1090.sh
sed -i -e '/axis-format/d' $ipath/graphs1090.sh
fi
echo "------------------"
echo "TEST 5"
echo "------------------"

if [[ $lighttpd == yes ]]; then
systemctl restart lighttpd
fi

echo "------------------"
echo "TEST 6"
echo "------------------"

systemctl enable collectd &>/dev/null
systemctl restart collectd &>/dev/null || true

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

echo "------------------"
echo "TEST 7"
echo "------------------"

if ! [[ -f /usr/share/graphs1090/noMalarky ]]; then
bash $ipath/malarky.sh
fi
Expand Down

0 comments on commit ac505db

Please sign in to comment.