From ac505db8acf3197dac591e35d6509af007977f8b Mon Sep 17 00:00:00 2001 From: Aaron Shaw Date: Wed, 3 Jul 2024 14:34:42 +0100 Subject: [PATCH] Update wingbits_installer.sh --- wingbits_installer.sh | 51 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 43 insertions(+), 8 deletions(-) diff --git a/wingbits_installer.sh b/wingbits_installer.sh index b61907f..b1cf6ab 100644 --- a/wingbits_installer.sh +++ b/wingbits_installer.sh @@ -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 '//{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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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