diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5afe70ee..9ef4d4eb 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,33 @@
The following is a history of the changes made to this project.
+## v2.8.0 *(June 24th, 2024)*
+
+### Installers
+
+* The dump1090-fa and piaware_builder install process has been updated to support the latest versions.
+* The dump978 script has been rewritten in order to use FlightAwares version of dump978.
+* The Beast Splitter script has been updated to work with the current version of Beast Splitter.
+* The Flightradar24 script has been updated to work with the current install script.
+* The Plane Finder script has been updated to work with current client releases.
+* The ADS-B Exchange script has been updated to work with the current install script.
+* The ADSB Exchange script has been updated to work with the current install script.
+* The OpenSky Feeder script has been updated to work with the current install script.
+* Version check for dump1090-fa has been fixed.
+* Fix bug where PiAware was installed every run even if already installed.
+* Removed the unattended install option for the time being.
+* Removed the option to install dump1090-mutability.
+* Removed the option to install dump1090 HPTOA.
+* Removed the option to install AboveTustin.
+* Removed the option to install ADSBHub support due to the fact it was incomplete.
+* Removed incomplete RTL-SDR OGN setup scripting.
+
+### Portal
+
+* The portal install scripts have been updated to work on current operation systems.
+* All portal related Python scripts have been updated to work with Python 3.
+* TinyMCE has been replace by CKeditor in the portal.
+
## v2.7.2 *(prerelease)*
* Updated current PiAware and dump1090-fa versions to 3.9.3.
diff --git a/CREDITS.md b/CREDITS.md
index 3ea9660d..727fc20e 100644
--- a/CREDITS.md
+++ b/CREDITS.md
@@ -43,14 +43,12 @@ is being used to develop the portal portion of this project. https://www.jetbrai
I would also like to thank the developers and contributors to the following projects. Without their
hard work and dedication this project would not have been possible.
-* Dump1090 (mutability): https://github.com/mutability/dump1090
* Dump1090 (fa): https://github.com/flightaware/dump1090
-* Dump978: https://github.com/mutability/dump978
+* Dump978 (fa): https://github.com/flightaware/dump978
* FlightAware's PiAware: http://flightaware.com
* Plane Finder ADS-B Client: https://planefinder.net
* Flightradar24 Client: https://www.flightradar24.com
* Dump1090-Tools: https://github.com/mutability/dump1090-tools
-* AboveTustin https://github.com/kevinbrandon/abovetustin
* Beast-Splitter https://github.com/flightaware/beast-splitter
* bootpag http://botmonster.com/jquery-bootpag
* Bootstrap: http://getbootstrap.com/
diff --git a/README.md b/README.md
index e5ef3996..79e98766 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,3 @@
-
-
# The ADS-B Receiver Project :airplane:
This repository contains a set of scripts and files which can be used to setup an ADS-B receiver on a clean installation of a Debian derived operating system. The scripts are executed in order by the main install script depending on the installation options chosen by the user.
@@ -16,23 +14,10 @@ This repository contains a set of scripts and files which can be used to setup a
* Informs visitors when specific flights are being tracked by dump1090.
* Easily customize the look of your portal using the template system.
-**Web Portal Screenshots**
-
-![dump1090 GIF](http://assets-jacobwall.netdna-ssl.com/adsbreceiver_readme.gif)
-
-
-
-
-
-**Please note:** As of February 2016, the scripts do not work when run on an SD card where the current PiAware image was installed. The scripts require a clean installation of a Debian derived operating system.
-
The ADS-B Receiver Project website is located at https://www.adsbreceiver.net.
### Obtaining And Using This Software
-Download the latest ADS-B Receiver Raspbian Stretch Lite image for Raspberry Pi devices.
-https://github.com/jprochazka/adsb-receiver/releases/latest
-
When setting up the portal you will have to choose between a lite or advanced installation. Advanced features adds flight logging and plotting and should only be chosen on devices running a more sturdy data storage solution.
*It is recommended that anyone using a SD card as they storage medium not attempt to use the advanced features.*
@@ -67,33 +52,34 @@ The following software can be installed using these scripts.
**Decoders**
-* Dump1090 (mutability): https://github.com/mutability/dump1090
* Dump1090 (FlightAware): https://github.com/flightaware/dump1090
-* Dump978: https://github.com/mutability/dump978
+* Dump978 (FlightAware): https://github.com/mutability/dump978
**Site Feeders**
-* FlightAware's PiAware: http://flightaware.com
-* Flightradar24 Feeder Client: http://flightradar24.com
+* ADS-B Exchange: https://adsbexchange.com
+* FlightAware's PiAware: https://flightaware.com
+* Flightradar24 Feeder Client: https://flightradar24.com
+* OpenSky Feeder: https://opensky-network.org
* Plane Finder ADS-B Client: https://planefinder.net
-* ADS-B Exchange: http://adsbexchange.com
**Extras**
* ADS-B Receiver Project Portal: https://www.adsbreceiver.net
-* AboveTustin: https://github.com/kevinabrandon/AboveTustin
* Beast-Splitter: https://github.com/flightaware/beast-splitter
-* DuckDNS.org Support: http://www.duckdns.org/
+* DuckDNS.org Support: https://www.duckdns.org/
### Supported Operating Systems
-The scripts and packages have been tested on most Debian Jessie and Stretch based operating systems.
+The project currently supports the following Linux distributions.
-The scripts are NOT supported on existing PiAware *image based* installations. The PiAware image is still based on Raspbian Wheezey version which is missing some required libraries for dump1090-mutability installation.
+* Debian Bookworm
+* Debian Bullseye
+* Rasbperry PI OS (Bookworm)
+* Rasbperry PI OS Legacy (Bullseye)
### Useful Links
-- Website - https://www.adsbreceiver.net/
-- Forum - https://adsb.discourse.group/
-- Wiki - https://github.com/jprochazka/adsb-receiver/wiki
+- GitHub Repository - https://github.com/jprochazka/adsb-receiver
+- GitHub Wiki - https://github.com/jprochazka/adsb-receiver/wiki
- Changelog - https://github.com/jprochazka/adsb-receiver/blob/master/CHANGELOG.md
diff --git a/bash/decoders/dump1090-fa.sh b/bash/decoders/dump1090-fa.sh
index e60f42d4..2c61c911 100755
--- a/bash/decoders/dump1090-fa.sh
+++ b/bash/decoders/dump1090-fa.sh
@@ -9,7 +9,7 @@
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
-# Copyright (c) 2015-2016 Joseph A. Prochazka #
+# Copyright (c) 2015-2024 Joseph A. Prochazka #
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy #
# of this software and associated documentation files (the "Software"), to deal #
@@ -31,66 +31,49 @@
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-### VARIABLES
-
-RECEIVER_ROOT_DIRECTORY="${PWD}"
-RECEIVER_BASH_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/bash"
-RECEIVER_BUILD_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/build"
-
### INCLUDE EXTERNAL SCRIPTS
source ${RECEIVER_BASH_DIRECTORY}/variables.sh
source ${RECEIVER_BASH_DIRECTORY}/functions.sh
-## SET INSTALLATION VARIABLES
-
-# Source the automated install configuration file if this is an automated installation.
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] && [[ -s "${RECEIVER_CONFIGURATION_FILE}" ]] ; then
- source ${RECEIVER_CONFIGURATION_FILE}
-else
- DUMP1090_BING_MAPS_KEY=`GetConfig "BingMapsAPIKey" "/usr/share/dump1090-mutability/html/config.js"`
-fi
-
### BEGIN SETUP
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- clear
- echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
-fi
+clear
+echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
echo ""
echo -e "\e[92m Setting up dump1090-fa..."
echo ""
echo -e "\e[93m ------------------------------------------------------------------------------\e[96m"
echo ""
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Dump1090-fa Setup" --yesno "Dump 1090 is a Mode-S decoder specifically designed for RTL-SDR devices. Dump1090-fa is a fork of the dump1090-mutability version of dump1090 that is specifically designed for FlightAware's PiAware software.\n\nIn order to use this version of dump1090 FlightAware's PiAware software must be installed as well.\n\n https://github.com/flightaware/dump1090\n\nContinue setup by installing dump1090-fa?" 14 78
- if [[ $? -eq 1 ]] ; then
- # Setup has been halted by the user.
- echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
- echo -e " Setup has been halted at the request of the user."
- echo ""
- echo -e "\e[93m ------------------------------------------------------------------------------"
- echo -e "\e[92m Dump1090-fa setup halted.\e[39m"
- echo ""
- read -p "Press enter to continue..." CONTINUE
- exit 1
- fi
+whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Dump1090-fa Setup" --yesno "Dump 1090 is a Mode-S decoder specifically designed for RTL-SDR devices. Dump1090-fa is a fork of the dump1090-mutability version of dump1090 that is specifically designed for FlightAware's PiAware software.\n\nIn order to use this version of dump1090 FlightAware's PiAware software must be installed as well.\n\n https://github.com/flightaware/dump1090\n\nContinue setup by installing dump1090-fa?" 14 78
+if [[ $? -eq 1 ]] ; then
+ # Setup has been halted by the user.
+ echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
+ echo -e " Setup has been halted at the request of the user."
+ echo ""
+ echo -e "\e[93m ------------------------------------------------------------------------------"
+ echo -e "\e[92m Dump1090-fa setup halted.\e[39m"
+ echo ""
+ read -p "Press enter to continue..." CONTINUE
+ exit 1
fi
## CHECK FOR PREREQUISITE PACKAGES
echo -e "\e[95m Installing packages needed to build and fulfill dependencies...\e[97m"
echo ""
+CheckPackage build-essential
+CheckPackage fakeroot
CheckPackage debhelper
CheckPackage librtlsdr-dev
-CheckPackage libusb-1.0-0-dev
CheckPackage pkg-config
-CheckPackage dh-systemd
-CheckPackage libncurses5-dev
-CheckPackage libbladerf1
+CheckPackage libncurses-dev
CheckPackage libbladerf-dev
-CheckPackage adduser
+CheckPackage libhackrf-dev
+CheckPackage liblimesuite-dev
+CheckPackage libsoapysdr-dev
CheckPackage lighttpd
+echo ""
## DOWNLOAD OR UPDATE THE DUMP1090-FA SOURCE
@@ -121,10 +104,8 @@ fi
echo ""
echo -e "\e[95m Building and installing the dump1090-fa package...\e[97m"
echo ""
-if [[ ! "${PWD}" = "${RECEIVER_BUILD_DIRECTORY}/dump1090-fa/dump1090" ]] ; then
- echo -e "\e[94m Entering the dump1090-fa git repository directory...\e[97m"
- cd ${RECEIVER_BUILD_DIRECTORY}/dump1090-fa/dump1090 2>&1
-fi
+echo -e "\e[94m Entering the dump1090-fa git repository directory...\e[97m"
+cd ${RECEIVER_BUILD_DIRECTORY}/dump1090-fa/dump1090 2>&1
echo -e "\e[94m Building the dump1090-fa package...\e[97m"
echo ""
dpkg-buildpackage -b
@@ -133,6 +114,7 @@ echo -e "\e[94m Entering the dump1090-fa build directory...\e[97m"
cd ${RECEIVER_BUILD_DIRECTORY}/dump1090-fa 2>&1
echo -e "\e[94m Installing the dump1090-fa package...\e[97m"
echo ""
+echo "dump1090-fa_${DUMP1090_FA_VERSION}_*.deb"
sudo dpkg -i dump1090-fa_${DUMP1090_FA_VERSION}_*.deb
# Check that the package was installed.
@@ -166,14 +148,12 @@ fi
echo -e "\e[94m Moving the dump1090-mutability binary package into the archive directory...\e[97m"
echo ""
cp -vf ${RECEIVER_BUILD_DIRECTORY}/dump1090-fa/*.deb ${RECEIVER_BUILD_DIRECTORY}/package-archive/ 2>&1
-
+echo ""
## DUMP1090-FA POST INSTALLATION CONFIGURATION
# Ask for a Bing Maps API key.
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- DUMP1090_BING_MAPS_KEY=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Bing Maps API Key" --nocancel --inputbox "\nProvide a Bing Maps API key here to enable the Bing imagery layer.\nYou can obtain a free key at https://www.bingmapsportal.com/\n\nProviding a Bing Maps API key is not required to continue." 11 78 "${DUMP1090_BING_MAPS_KEY}" 3>&1 1>&2 2>&3)
-fi
+DUMP1090_BING_MAPS_KEY=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Bing Maps API Key" --nocancel --inputbox "\nProvide a Bing Maps API key here to enable the Bing imagery layer.\nYou can obtain a free key at https://www.bingmapsportal.com/\n\nProviding a Bing Maps API key is not required to continue." 11 78 "${DUMP1090_BING_MAPS_KEY}" 3>&1 1>&2 2>&3)
if [[ -n "${DUMP1090_BING_MAPS_KEY}" ]] ; then
echo -e "\e[94m Setting the Bing Maps API Key to ${DUMP1090_BING_MAPS_KEY}...\e[97m"
ChangeConfig "BingMapsAPIKey" "${DUMP1090_BING_MAPS_KEY}" "/usr/share/dump1090-fa/html/config.js"
@@ -181,42 +161,43 @@ fi
# Download Heywhatsthat.com maximum range rings.
if [[ ! -f "/usr/share/dump1090-fa/html/upintheair.json" ]] ; then
- if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- if (whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Heywhaststhat.com Maximum Range Rings" --yesno "Maximum range rings can be added to dump1090-fa usings data obtained from Heywhatsthat.com. In order to add these rings to your dump1090-fa map you will first need to visit http://www.heywhatsthat.com and generate a new panorama centered on the location of your receiver. Once your panorama has been generated a link to the panorama will be displayed in the top left hand portion of the page. You will need the view id which is the series of letters and/or numbers after \"?view=\" in this URL.\n\nWould you like to add heywhatsthat.com maximum range rings to your map?" 16 78); then
- # Set the DUMP1090_HEYWHATSTHAT_INSTALL variable to true.
- DUMP1090_HEYWHATSTHAT_INSTALL="true"
- # Ask the user for the Heywhatsthat.com panorama ID.
- DUMP1090_HEYWHATSTHAT_ID_TITLE="Heywhatsthat.com Panorama ID"
- while [[ -z "${DUMP1090_HEYWHATSTHAT_ID}" ]] ; do
- DUMP1090_HEYWHATSTHAT_ID=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${DUMP1090_HEYWHATSTHAT_ID_TITLE}" --nocancel --inputbox "\nEnter your Heywhatsthat.com panorama ID." 8 78 3>&1 1>&2 2>&3)
- DUMP1090_HEYWHATSTHAT_ID_TITLE="Heywhatsthat.com Panorama ID (REQUIRED)"
- done
- # Ask the user what altitude in meters to set the first range ring.
- DUMP1090_HEYWHATSTHAT_RING_ONE_TITLE="Heywhatsthat.com First Ring Altitude"
- while [[ -z "${DUMP1090_HEYWHATSTHAT_RING_ONE}" ]] ; do
- DUMP1090_HEYWHATSTHAT_RING_ONE=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${DUMP1090_HEYWHATSTHAT_RING_ONE_TITLE}" --nocancel --inputbox "\nEnter the first ring's altitude in meters.\n(default 3048 meters or 10000 feet)" 8 78 "3048" 3>&1 1>&2 2>&3)
- DUMP1090_HEYWHATSTHAT_RING_ONE_TITLE="Heywhatsthat.com First Ring Altitude (REQUIRED)"
- done
- # Ask the user what altitude in meters to set the second range ring.
- DUMP1090_HEYWHATSTHAT_RING_TWO_TITLE="Heywhatsthat.com Second Ring Altitude"
- while [[ -z "${DUMP1090_HEYWHATSTHAT_RING_TWO}" ]] ; do
- DUMP1090_HEYWHATSTHAT_RING_TWO=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${DUMP1090_HEYWHATSTHAT_RING_TWO_TITLE}" --nocancel --inputbox "\nEnter the second ring's altitude in meters.\n(default 12192 meters or 40000 feet)" 8 78 "12192" 3>&1 1>&2 2>&3)
- DUMP1090_HEYWHATSTHAT_RING_TWO_TITLE="Heywhatsthat.com Second Ring Altitude (REQUIRED)"
- done
- fi
+ if (whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Heywhaststhat.com Maximum Range Rings" --yesno "Maximum range rings can be added to dump1090-fa usings data obtained from Heywhatsthat.com. In order to add these rings to your dump1090-fa map you will first need to visit http://www.heywhatsthat.com and generate a new panorama centered on the location of your receiver. Once your panorama has been generated a link to the panorama will be displayed in the top left hand portion of the page. You will need the view id which is the series of letters and/or numbers after \"?view=\" in this URL.\n\nWould you like to add heywhatsthat.com maximum range rings to your map?" 16 78); then
+ # Set the DUMP1090_HEYWHATSTHAT_INSTALL variable to true.
+ DUMP1090_HEYWHATSTHAT_INSTALL="true"
+
+ # Ask the user for the Heywhatsthat.com panorama ID.
+ DUMP1090_HEYWHATSTHAT_ID_TITLE="Heywhatsthat.com Panorama ID"
+ while [[ -z "${DUMP1090_HEYWHATSTHAT_ID}" ]] ; do
+ DUMP1090_HEYWHATSTHAT_ID=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${DUMP1090_HEYWHATSTHAT_ID_TITLE}" --nocancel --inputbox "\nEnter your Heywhatsthat.com panorama ID." 8 78 3>&1 1>&2 2>&3)
+ DUMP1090_HEYWHATSTHAT_ID_TITLE="Heywhatsthat.com Panorama ID (REQUIRED)"
+ done
+
+ # Ask the user what altitude in meters to set the first range ring.
+ DUMP1090_HEYWHATSTHAT_RING_ONE_TITLE="Heywhatsthat.com First Ring Altitude"
+ while [[ -z "${DUMP1090_HEYWHATSTHAT_RING_ONE}" ]] ; do
+ DUMP1090_HEYWHATSTHAT_RING_ONE=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${DUMP1090_HEYWHATSTHAT_RING_ONE_TITLE}" --nocancel --inputbox "\nEnter the first ring's altitude in meters.\n(default 3048 meters or 10000 feet)" 8 78 "3048" 3>&1 1>&2 2>&3)
+ DUMP1090_HEYWHATSTHAT_RING_ONE_TITLE="Heywhatsthat.com First Ring Altitude (REQUIRED)"
+ done
+
+ # Ask the user what altitude in meters to set the second range ring.
+ DUMP1090_HEYWHATSTHAT_RING_TWO_TITLE="Heywhatsthat.com Second Ring Altitude"
+ while [[ -z "${DUMP1090_HEYWHATSTHAT_RING_TWO}" ]] ; do
+ DUMP1090_HEYWHATSTHAT_RING_TWO=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${DUMP1090_HEYWHATSTHAT_RING_TWO_TITLE}" --nocancel --inputbox "\nEnter the second ring's altitude in meters.\n(default 12192 meters or 40000 feet)" 8 78 "12192" 3>&1 1>&2 2>&3)
+ DUMP1090_HEYWHATSTHAT_RING_TWO_TITLE="Heywhatsthat.com Second Ring Altitude (REQUIRED)"
+ done
fi
# If the Heywhatsthat.com maximum range rings are to be added download them now.
if [[ "${DUMP1090_HEYWHATSTHAT_INSTALL}" = "true" ]] ; then
echo -e "\e[94m Downloading JSON data pertaining to the supplied panorama ID...\e[97m"
echo ""
sudo wget -O /usr/share/dump1090-fa/html/upintheair.json "http://www.heywhatsthat.com/api/upintheair.json?id=${DUMP1090_HEYWHATSTHAT_ID}&refraction=0.25&alts=${DUMP1090_HEYWHATSTHAT_RING_ONE},${DUMP1090_HEYWHATSTHAT_RING_TWO}"
+ echo ""
fi
fi
### SETUP COMPLETE
# Return to the project root directory.
-echo ""
echo -e "\e[94m Entering the ADS-B Receiver Project root directory...\e[97m"
cd ${RECEIVER_ROOT_DIRECTORY} 2>&1
@@ -224,8 +205,6 @@ echo ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m Dump1090-fa setup is complete.\e[39m"
echo ""
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- read -p "Press enter to continue..." CONTINUE
-fi
+read -p "Press enter to continue..." CONTINUE
exit 0
diff --git a/bash/decoders/dump1090-hptoa.sh b/bash/decoders/dump1090-hptoa.sh
deleted file mode 100755
index b6e21fe3..00000000
--- a/bash/decoders/dump1090-hptoa.sh
+++ /dev/null
@@ -1,348 +0,0 @@
-#!/bin/bash
-
-#####################################################################################
-# ADS-B RECEIVER #
-#####################################################################################
-# #
-# This script is not meant to be executed directly. #
-# Instead execute install.sh to begin the installation process. #
-# #
-# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-# #
-# Copyright (c) 2015-2018, Joseph A. Prochazka #
-# #
-# Permission is hereby granted, free of charge, to any person obtaining a copy #
-# of this software and associated documentation files (the "Software"), to deal #
-# in the Software without restriction, including without limitation the rights #
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell #
-# copies of the Software, and to permit persons to whom the Software is #
-# furnished to do so, subject to the following conditions: #
-# #
-# The above copyright notice and this permission notice shall be included in all #
-# copies or substantial portions of the Software. #
-# #
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE #
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, #
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE #
-# SOFTWARE. #
-# #
-# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-
-### VARIABLES
-
-RECEIVER_ROOT_DIRECTORY="${PWD}"
-RECEIVER_BASH_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/bash"
-RECEIVER_BUILD_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/build"
-
-### INCLUDE EXTERNAL SCRIPTS
-
-source ${RECEIVER_BASH_DIRECTORY}/variables.sh
-source ${RECEIVER_BASH_DIRECTORY}/functions.sh
-
-## SET INSTALLATION VARIABLES
-
-# Source the automated install configuration file if this is an automated installation.
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] && [[ -s "${RECEIVER_CONFIGURATION_FILE}" ]] ; then
- source ${RECEIVER_CONFIGURATION_FILE}
-fi
-
-### BEGIN SETUP
-
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- clear
- echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
-fi
-echo -e ""
-echo -e "\e[92m Setting up dump1090-hptoa..."
-echo -e ""
-echo -e "\e[93m ------------------------------------------------------------------------------\e[96m"
-echo -e ""
-
-# Confirm that the installation process should continue.
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- # Interactive install.
- CONTINUE_SETUP=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Dump1090-hptoa Setup" --yesno "This is a fork of Mutability's version of dump1090 that adds a novel method to compute high-precision Time-of-Arrival (ToA) timestamps of the Mode S / ADS-B packets. The actual precision is in the order of a few nanoseconds, depending on the packet strength.\n\n https://github.com/openskynetwork/dump1090-hptoa \n\nContinue setup by installing dump1090-hptoa?" 15 78 3>&1 1>&2 2>&3)
- if [[ ${CONTINUE_SETUP} -eq 1 ]] ; then
- # Setup has been halted by the user.
- echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
- echo -e " Setup has been halted at the request of the user."
- echo -e ""
- echo -e "\e[93m ------------------------------------------------------------------------------"
- echo -e "\e[92m Dump1090-hptoa setup halted.\e[39m"
- echo -e ""
- read -p "Press enter to continue..." CONTINUE
- exit 1
- fi
-else
- # Warn that automated installation is not supported.
- echo -e "\e[92m Automated installation of this script is not yet supported...\e[39m"
- echo -e ""
- exit 1
-fi
-
-### CHECK FOR PREREQUISITE PACKAGES
-
-echo -e "\e[95m Installing packages needed to fulfill dependencies for dump1090-hptoa...\e[97m"
-echo -e ""
-
-# Required by install script.
-CheckPackage git
-CheckPackage cmake
-CheckPackage build-essential
-CheckPackage pkg-config
-CheckPackage autotools-dev
-CheckPackage automake
-# Required for USB SDR devices.
-CheckPackage librtlsdr-dev
-CheckPackage libusb-1.0-0-dev
-CheckPackage rtl-sdr
-# Required by component.
-CheckPackage lighttpd
-
-### START INSTALLATION
-
-echo -e ""
-echo -e "\e[95m Begining the dump1090-hptoa installation process...\e[97m"
-echo -e ""
-
-## SETUP UDEV RTL-SDR RULES
-
-# Download the file rtl-sdr.rules from the osmocon rtl-sdr repository if it does not already exist.
-if [[ ! -f "/etc/udev/rules.d/rtl-sdr.rules" ]] ; then
- echo -e "\e[94m Downloading the file rtl-sdr.rules from the rtl-sdr repository...\e[97m"
- echo ""
- sudo wget -O /etc/udev/rules.d/rtl-sdr.rules https://raw.githubusercontent.com/osmocom/rtl-sdr/master/rtl-sdr.rules
- echo -e "\e[94m Restarting udev...\e[97m"
- sudo service udev restart
-fi
-
-# Create an RTL-SDR blacklist file so the device does not claim SDR's for other purposes.
-BlacklistModules
-
-## CREATE THE DUMP1090-HPTOA BUILD DIRECTORY IF IT DOES NOT EXIST
-
-if [[ ! -d "${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa" ]] ; then
- echo -e "\e[94m Creating the dump1090-hptoa build directory...\e[97m"
- echo ""
- mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa
- echo ""
-fi
-
-## ATTEMPT TO DOWNLOAD OR UPDATE THE LIQUID-DSP SOURCE CODE FROM GITHUB
-
-if [[ -d "${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa/liquid-dsp" ]] && [[ -d "${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa/liquid-dsp/.git" ]] ; then
- # A directory with a git repository containing the source code already exists.
- echo -e "\e[94m Entering the liquid-dsp git repository directory...\e[97m"
- cd ${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa/liquid-dsp 2>&1
- echo -e "\e[94m Updating the local liquid-dsp git repository...\e[97m"
- echo -e ""
- git pull 2>&1
-else
- # A directory containing the source code does not exist in the build directory.
- echo -e "\e[94m Entering to dump1090-hptoa build directory...\e[97m"
- cd ${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa 2>&1
- echo -e "\e[94m Cloning the liquid-dsp git repository locally...\e[97m"
- echo -e ""
- git clone https://github.com/jgaeddert/liquid-dsp.git 2>&1
- echo ""
-fi
-
-## ATTEMPT TO DOWNLOAD OR UPDATE THE DUMP1090-HPTOA SOURCE CODE FROM GITHUB
-
-if [[ -d "${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa/dump1090-hptoa" ]] && [[ -d "${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa/dump1090-hptoa/.git" ]] ; then
- # A directory with a git repository containing the source code already exists.
- echo -e "\e[94m Entering the dump1090-hptoa git repository directory...\e[97m"
- cd ${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa/dump1090-hptoa 2>&1
- echo -e "\e[94m Updating the local dump1090-hptoa git repository...\e[97m"
- echo -e ""
- git pull 2>&1
-else
- # A directory containing the source code does not exist in the build directory.
- echo -e "\e[94m Entering dump1090-hptoa build directory...\e[97m"
- cd ${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa 2>&1
- echo -e "\e[94m Cloning the dump1090-hptoa git repository locally...\e[97m"
- echo -e ""
- git clone https://github.com/openskynetwork/dump1090-hptoa.git 2>&1
-fi
-
-## BUILD AND INSTALL THE LIQUID-DSP LIBRARY.
-
-echo -e ""
-echo -e "\e[95m Building the liquid-dsp library...\e[97m"
-echo -e ""
-
-# Change directory to the liquid-dsp build directory.
-if [[ ! "${PWD}" = "${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa/liquid-dsp" ]] ; then
- echo -e "\e[94m Entering the liquid-dsp build directory...\e[97m"
- cd ${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa/liquid-dsp 2>&1
-fi
-
-echo -e "\e[94m Executing bootstrap.sh...\e[97m"
-./bootstrap.sh
-echo -e "\e[94m Executing configure...\e[97m"
-echo -e ""
-./configure
-echo -e ""
-echo -e "\e[94m Building the liquid-sdr library...\e[97m"
-echo -e ""
-make
-echo -e ""
-echo -e "\e[94m Installing the liquid-sdr library...\e[97m"
-echo -e ""
-sudo make install
-echo -e ""
-echo -e "\e[94m Updating the shared library cache...\e[97m"
-sudo ldconfig
-
-## BUILD THE DUMP1090-HPTOA BINARIES
-
-echo -e ""
-echo -e "\e[95m Building the dump1090-hptoa binaries...\e[97m"
-echo -e ""
-
-# Change to the dump1090-hptoa build directory.
-if [[ ! "${PWD}" = "${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa/dump1090-hptoa" ]] ; then
- echo -e "\e[94m Entering the dump1090-hptoa build directory...\e[97m"
- cd ${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa/dump1090-hptoa 2>&1
-fi
-
-# Build the binaries.
-echo -e "\e[94m Creating the directory ${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa/dump1090-hptoa/build...\e[97m"
-echo ""
-mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa/dump1090-hptoa/build
-echo ""
-echo -e "\e[94m Entering the directory ${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa/dump1090-hptoa/build...\e[97m"
-cd ${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa/dump1090-hptoa/build 2>&1
-echo -e "\e[94m Executing cmake...\e[97m"
-echo ""
-cmake ../
-echo ""
-echo -e "\e[94m Now executing make...\e[97m"
-echo ""
-make
-echo ""
-
-# Checking that the binaries were in fact built.
-if [ ! -f ${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa/dump1090-hptoa/build/dump1090 ] || [ ! -f ${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa/dump1090-hptoa/build/faup1090 ] || [ ! -f ${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa/dump1090-hptoa/build/view1090 ] ; then
- # If any of the binaries were not installed halt the setup process..
- echo -e ""
- echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
- echo -e " FAILED TO BUILD A REQUIRED BINARY."
- echo -e " SETUP HAS BEEN TERMINATED!"
- echo -e ""
- echo -e "\e[93mOne or more of the dump1090-hptoa binaries failed to be built.\e[39m"
- echo -e ""
- echo -e "\e[93m ------------------------------------------------------------------------------"
- echo -e "\e[92m Dump1090-hptoa setup halted.\e[39m"
- echo -e ""
- if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- read -p "Press enter to continue..." CONTINUE
- fi
- exit 1
-fi
-
-## POST INSTALL ACTIONS
-
-# Create the dump190 init script.
-echo -e "\e[94m Creating the dump1090 init script...\e[97m"
-sudo tee /etc/init.d/dump1090 > /dev/null <&2
- exit 1
- else
- ## Change from /dev/null to something like /var/log/\$PROG if you want to save output.
- cd \$PROG_PATH
- ./\$PROG \$PROG_ARGS 2>&1 >/dev/null &
- echo "\$PROG started"
- touch \$PIDFILE
- fi
-}
-
-stop() {
- if [ -e \$PIDFILE ]; then
- ## Program is running, so stop it
- echo "\$PROG is running"
- killall \$PROG
- rm -f \$PIDFILE
- echo "\$PROG stopped"
- else
- ## Program is not running, exit with error.
- echo "Error! \$PROG not started!" 1>&2
- exit 1
- fi
-}
-
-## Check to see if we are running as root first.
-## Found at http://www.cyberciti.biz/tips/shell-root-user-check-script.html
-if [ "\$(id -u)" != "0" ]; then
- echo "This script must be run as root" 1>&2
- exit 1
-fi
-
-case "\$1" in
- start)
- start
- exit 0
- ;;
- stop)
- stop
- exit 0
- ;;
- reload|restart|force-reload)
- stop
- start
- exit 0
- ;;
- **)
- echo "Usage: \$0 {start|stop|reload}" 1>&2
- exit 1
- ;;
-esac
-exit 0
-EOF
-
-echo -e "\e[94m Setting permissions for the dump1090 init script...\e[97m"
-sudo chmod +x /etc/init.d/dump1090
-echo -e "\e[94m Executing update-rc.d to add the init script link for dump1090...\e[97m"
-sudo update-rc.d dump1090 defaults
-echo -e "\e[94m Starting dump1090-hptoa...\e[97m"
-sudo /etc/init.d/dump1090 start
-
-### SETUP COMPLETE
-
-# Return to the project root directory.
-echo -e "\e[94m Returning to ${RECEIVER_PROJECT_TITLE} root directory...\e[97m"
-cd ${RECEIVER_ROOT_DIRECTORY} 2>&1
-
-echo -e ""
-echo -e "\e[93m ------------------------------------------------------------------------------"
-echo -e "\e[92m Dump1090-hptoa setup is complete.\e[39m"
-echo -e ""
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- read -p "Press enter to continue..." CONTINUE
-fi
-
-exit 0
diff --git a/bash/decoders/dump1090-mutability.sh b/bash/decoders/dump1090-mutability.sh
deleted file mode 100755
index 25ed9e0a..00000000
--- a/bash/decoders/dump1090-mutability.sh
+++ /dev/null
@@ -1,394 +0,0 @@
-#!/bin/bash
-
-#####################################################################################
-# ADS-B RECEIVER #
-#####################################################################################
-# #
-# This script is not meant to be executed directly. #
-# Instead execute install.sh to begin the installation process. #
-# #
-# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-# #
-# Copyright (c) 2015-2018, Joseph A. Prochazka #
-# #
-# Permission is hereby granted, free of charge, to any person obtaining a copy #
-# of this software and associated documentation files (the "Software"), to deal #
-# in the Software without restriction, including without limitation the rights #
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell #
-# copies of the Software, and to permit persons to whom the Software is #
-# furnished to do so, subject to the following conditions: #
-# #
-# The above copyright notice and this permission notice shall be included in all #
-# copies or substantial portions of the Software. #
-# #
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE #
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, #
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE #
-# SOFTWARE. #
-# #
-# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-
-### VARIABLES
-
-RECEIVER_ROOT_DIRECTORY="${PWD}"
-RECEIVER_BASH_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/bash"
-RECEIVER_BUILD_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/build"
-
-### INCLUDE EXTERNAL SCRIPTS
-
-source ${RECEIVER_BASH_DIRECTORY}/variables.sh
-source ${RECEIVER_BASH_DIRECTORY}/functions.sh
-
-## SET INSTALLATION VARIABLES
-
-# Source the automated install configuration file if this is an automated installation.
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] && [[ -s "${RECEIVER_CONFIGURATION_FILE}" ]] ; then
- source ${RECEIVER_CONFIGURATION_FILE}
-else
- RECEIVER_LATITUDE=`GetConfig "LAT" "/etc/default/dump1090-mutability"`
- RECEIVER_LONGITUDE=`GetConfig "LON" "/etc/default/dump1090-mutability"`
- DUMP1090_BING_MAPS_KEY=`GetConfig "BingMapsAPIKey" "/usr/share/dump1090-mutability/html/config.js"`
-fi
-
-### BEGIN SETUP
-
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- clear
- echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
-fi
-echo -e ""
-echo -e "\e[92m Setting up dump1090-mutability..."
-echo -e ""
-echo -e "\e[93m ------------------------------------------------------------------------------\e[96m"
-echo -e ""
-
-# Check for existing component install.
-
-# Confirm component installation.
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- # Interactive install.
- CONTINUE_SETUP=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Dump1090-mutability Setup" --yesno "Dump1090 is a Mode-S decoder specifically designed for RTL-SDR devices.\n\nDump1090-mutability is a fork of MalcolmRobb's version of Dump1090 that adds new functionality and is designed to be built as a Debian/Raspbian package.\n\n https://github.com/mutability/dump1090 \n\nContinue setup by installing dump1090-mutability?" 15 78 3>&1 1>&2 2>&3)
- if [[ ${CONTINUE_SETUP} -eq 1 ]] ; then
- # Setup has been halted by the user.
- echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
- echo -e " Setup has been halted at the request of the user."
- echo -e ""
- echo -e "\e[93m ------------------------------------------------------------------------------"
- echo -e "\e[92m Dump1090-mutability setup halted.\e[39m"
- echo -e ""
- read -p "Press enter to continue..." CONTINUE
- exit 1
- fi
-else
- # Warn that automated installation is not supported.
- echo -e "\e[92m Automated installation of this script is not yet supported...\e[39m"
- echo -e ""
- exit 1
-fi
-
-### CHECK FOR PREREQUISITE PACKAGES
-
-echo -e "\e[95m Installing packages needed to fulfill dependencies for dump1090-mutability...\e[97m"
-echo -e ""
-
-# Required by install script.
-CheckPackage git
-CheckPackage curl
-CheckPackage build-essential
-CheckPackage debhelper
-CheckPackage cron
-# Required for USB SDR devices.
-CheckPackage librtlsdr-dev
-CheckPackage libusb-1.0-0-dev
-CheckPackage rtl-sdr
-# Required by component.
-CheckPackage pkg-config
-CheckPackage lighttpd
-CheckPackage fakeroot
-
-### START INSTALLATION
-
-echo -e ""
-echo -e "\e[95m Begining the dump1090-mutability installation process...\e[97m"
-echo -e ""
-
-## SETUP UDEV RTL-SDR RULES
-
-# Download the file rtl-sdr.rules from the osmocon rtl-sdr repository if it does not already exist.
-if [[ ! -f "/etc/udev/rules.d/rtl-sdr.rules" ]] ; then
- echo -e "\e[94m Downloading the file rtl-sdr.rules from the rtl-sdr repository...\e[97m"
- echo ""
- sudo wget -O /etc/udev/rules.d/rtl-sdr.rules https://raw.githubusercontent.com/osmocom/rtl-sdr/master/rtl-sdr.rules
- echo -e "\e[94m Restarting udev...\e[97m"
- sudo service udev restart
-fi
-
-# Create an RTL-SDR blacklist file so the device does not claim SDR's for other purposes.
-BlacklistModules
-
-## ATTEMPT TO DOWNLOAD OR UPDATE THE COMPONENT FROM GITHUB
-
-if [[ -d "${RECEIVER_BUILD_DIRECTORY}/dump1090-mutability/dump1090" ]] && [[ -d "${RECEIVER_BUILD_DIRECTORY}/dump1090-mutability/dump1090/.git" ]] ; then
- # A directory with a git repository containing the source code already exists.
- echo -e "\e[94m Entering the dump1090-mutability git repository directory...\e[97m"
- cd ${RECEIVER_BUILD_DIRECTORY}/dump1090-mutability/dump1090 2>&1
- echo -e "\e[94m Updating the local dump1090-mutability git repository...\e[97m"
- echo -e ""
- git pull 2>&1
-else
- # A directory containing the source code does not exist in the build directory.
- echo -e "\e[94m Creating the dump1090-mutability build directory...\e[97m"
- echo ""
- mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/dump1090-mutability
- echo ""
- echo -e "\e[94m Entering ${RECEIVER_PROJECT_TITLE} build directory...\e[97m"
- cd ${RECEIVER_BUILD_DIRECTORY}/dump1090-mutability 2>&1
- echo -e "\e[94m Cloning the dump1090-mutability git repository locally...\e[97m"
- echo -e ""
- git clone https://github.com/mutability/dump1090.git 2>&1
-fi
-
-## BUILD AND INSTALL THE COMPONENT PACKAGE
-
-echo -e ""
-echo -e "\e[95m Building and installing the dump1090-mutability package...\e[97m"
-echo -e ""
-
-# Change to the component build directory.
-if [[ ! "${PWD}" = "${RECEIVER_BUILD_DIRECTORY}/dump1090-mutability/dump1090" ]] ; then
- echo -e "\e[94m Entering the dump1090-mutability build directory...\e[97m"
- cd ${RECEIVER_BUILD_DIRECTORY}/dump1090-mutability/dump1090 2>&1
-fi
-
-# Dummy test for consistency with other feeder install scripts.
-if [[ -n "${CPU_ARCHITECTURE}" ]] ; then
-
- # Build binary package.
- echo -e "\e[94m Building the dump1090-mutability package...\e[97m"
- echo -e ""
- dpkg-buildpackage -b 2>&1
- echo -e ""
-
- # Prempt the dpkg question asking if the user would like dump1090 to start automatically.
- if [[ ! "`sudo debconf-get-selections 2>/dev/null | grep "dump1090-mutability/auto-start" | awk '{print $4}'`" = "true" ]] ; then
- echo -e "\e[94m Configuring dump1090-mutability to start automatically....\e[97m"
- ACTION=$(echo 'dump1090-mutability dump1090-mutability/auto-start boolean true' | sudo debconf-set-selections -v 2>&1)
- fi
-
- # Install binary package.
- echo -e "\e[94m Installing the dump1090-mutability package...\e[97m"
- echo -e ""
- sudo dpkg -i ${RECEIVER_BUILD_DIRECTORY}/dump1090-mutability/dump1090-mutability_1.15~dev_*.deb 2>&1
- echo -e ""
-
- # Check that the component package was installed successfully.
- echo -e "\e[94m Checking that the dump1090-mutability package was installed properly...\e[97m"
-
- if [[ $(dpkg-query -W -f='${STATUS}' dump1090-mutability 2>/dev/null | grep -c "ok installed") -eq 0 ]] ; then
- # If the component package could not be installed halt setup.
- echo -e ""
- echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
- echo -e " UNABLE TO INSTALL A REQUIRED PACKAGE."
- echo -e " SETUP HAS BEEN TERMINATED!"
- echo -e ""
- echo -e "\e[93mThe package \"$dump1090-mutability\" could not be installed.\e[39m"
- echo -e ""
- echo -e "\e[93m ------------------------------------------------------------------------------"
- echo -e "\e[92m Dump1090-mutability setup halted.\e[39m"
- echo -e ""
- if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- read -p "Press enter to continue..." CONTINUE
- fi
- exit 1
- else
- # Create binary package archive directory.
- if [[ ! -d "${RECEIVER_BUILD_DIRECTORY}/dump1090-mutability/package-archive" ]] ; then
- echo -e "\e[94m Creating package archive directory...\e[97m"
- echo -e ""
- mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/dump1090-mutability/package-archive 2>&1
- echo -e ""
- fi
-
- # Archive binary package.
- echo -e "\e[94m Moving the dump1090-mutability binary package into the archive directory...\e[97m"
- echo -e ""
- cp -vf ${RECEIVER_BUILD_DIRECTORY}/dump1090-mutability/*.deb ${RECEIVER_BUILD_DIRECTORY}/dump1090-mutability/package-archive/ 2>&1
- fi
-fi
-
-## COMPONENT POST INSTALL ACTIONS
-
-# Confirm the receiver's latitude and longitude if it is not already set in the component configuration file.
-echo -e ""
-echo -e "\e[95m Begining post installation configuration...\e[97m"
-echo -e ""
-
-# Ask for the receivers latitude and longitude.
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- # Explain to the user that the receiver's latitude and longitude is required.
- RECEIVER_LATLON_DIALOG=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Receiver Latitude and Longitude" --msgbox "Your receivers latitude and longitude are required for distance calculations, you will now be asked to supply these values for your receiver.\n\nIf you do not have this information you can obtain it using the web based \"Geocode by Address\" utility hosted on another of the lead developers websites:\n\n https://www.adsbreceiver.net/tools/geocode.php" 15 78 3>&1 1>&2 2>&3)
-
- # Ask the user for the receiver's latitude.
- RECEIVER_LATITUDE_TITLE="Receiver Latitude"
- RECEIVER_LATITUDE=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${RECEIVER_LATITUDE_TITLE}" --nocancel --inputbox "\nEnter your receiver's latitude.\n(Example: XX.XXXXXXX)" 9 78 -- "${RECEIVER_LATITUDE}" 3>&1 1>&2 2>&3)
- while [[ -z "${RECEIVER_LATITUDE}" ]] || [[ `echo -n "${RECEIVER_LATITUDE}" | sed -e 's/[0-9]//g' -e 's/\.//g' -e 's/-//g' | wc -c` -gt 0 ]] ; do
- RECEIVER_LATITUDE_TITLE="Receiver Latitude (REQUIRED)"
- RECEIVER_LATITUDE=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${RECEIVER_LATITUDE_TITLE}" --nocancel --inputbox "\nEnter your receiver's latitude.\n(Example: XX.XXXXXXX)" 9 78 -- "${RECEIVER_LATITUDE}" 3>&1 1>&2 2>&3)
- done
-
- # Ask the user for the receiver's longitude.
- RECEIVER_LONGITUDE_TITLE="Receiver Longitude"
- RECEIVER_LONGITUDE=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${RECEIVER_LONGITUDE_TITLE}" --nocancel --inputbox "\nEnter your receeiver's longitude.\n(Example: XX.XXXXXXX)" 9 78 -- "${RECEIVER_LONGITUDE}" 3>&1 1>&2 2>&3)
- while [[ -z "${RECEIVER_LONGITUDE}" ]] || [[ `echo -n "${RECEIVER_LONGITUDE}" | sed -e 's/[0-9]//g' -e 's/\.//g' -e 's/-//g' | wc -c` -gt 0 ]] ; do
- RECEIVER_LONGITUDE_TITLE="Receiver Longitude (REQUIRED)"
- RECEIVER_LONGITUDE=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${RECEIVER_LONGITUDE_TITLE}" --nocancel --inputbox "\nEnter your receeiver's longitude.\n(Example: XX.XXXXXXX)" 9 78 -- "${RECEIVER_LONGITUDE}" 3>&1 1>&2 2>&3)
- done
-fi
-
-# Save the receiver's latitude and longitude values to dump1090 configuration file.
-RECEIVER_LATITUDE_CONFIGURED=`GetConfig "LAT" "/etc/default/dump1090-mutability"`
-if [[ ! "${RECEIVER_LATITUDE}" = "${RECEIVER_LATITUDE_CONFIGURED}" ]] ; then
- echo -e "\e[94m Setting the receiver's latitude to ${RECEIVER_LATITUDE}...\e[97m"
- ChangeConfig "LAT" "${RECEIVER_LATITUDE}" "/etc/default/dump1090-mutability"
-fi
-RECEIVER_LONGITUDE_CONFIGURED=`GetConfig "LON" "/etc/default/dump1090-mutability"`
-if [[ ! "${RECEIVER_LONGITUDE}" = "${RECEIVER_LONGITUDE_CONFIGURED}" ]] ; then
- echo -e "\e[94m Setting the receiver's longitude to ${RECEIVER_LONGITUDE}...\e[97m"
- ChangeConfig "LON" "${RECEIVER_LONGITUDE}" "/etc/default/dump1090-mutability"
-fi
-
-# Save the receiver's latitude and longitude values to the dump1090-mutability config.js file.
-JS_LATITUDE_CONFIGURED=`GetConfig "DefaultCenterLat" "/usr/share/dump1090-mutability/html/config.js"`
-if [[ ! "${RECEIVER_LATITUDE}" = "${JS_LATITUDE_CONFIGURED}" ]] ; then
- echo -e "\e[94m Setting the receiver's latitude in config.js to ${RECEIVER_LATITUDE}...\e[97m"
- ChangeConfig "DefaultCenterLat" "${RECEIVER_LATITUDE}" "/usr/share/dump1090-mutability/html/config.js"
-fi
-if [[ ! "${RECEIVER_LONGITUDE}" = "${JS_LONGITUDE_CONFIGURED}" ]] ; then
-JS_LONGITUDE_CONFIGURED=`GetConfig "DefaultCenterLon" "/usr/share/dump1090-mutability/html/config.js"`
-
- echo -e "\e[94m Setting the receiver's longitude in config.js to ${RECEIVER_LONGITUDE}...\e[97m"
- ChangeConfig "DefaultCenterLon" "${RECEIVER_LONGITUDE}" "/usr/share/dump1090-mutability/html/config.js"
-fi
-
-# Ask for a Bing Maps API key.
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- DUMP1090_BING_MAPS_KEY=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Bing Maps API Key" --nocancel --inputbox "\nProvide a Bing Maps API key here to enable the Bing imagery layer within the dump1090-mutability map, you can obtain a free key at the following website:\n\n https://www.bingmapsportal.com/\n\nProviding a Bing Maps API key is not required to continue." 15 78 -- "${DUMP1090_BING_MAPS_KEY}" 3>&1 1>&2 2>&3)
-fi
-if [[ -n "${DUMP1090_BING_MAPS_KEY}" ]] ; then
- echo -e "\e[94m Setting the Bing Maps API Key to ${DUMP1090_BING_MAPS_KEY}...\e[97m"
- ChangeConfig "BingMapsAPIKey" "${DUMP1090_BING_MAPS_KEY}" "/usr/share/dump1090-mutability/html/config.js"
-fi
-
-# Ask if the component should bind on all IP addresses.
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Bind dump1090-mutability To All IP Addresses" --yesno "By default dump1090-mutability is bound only to the local loopback IP address(s) for security reasons. However some people wish to make dump1090-mutability's data accessable externally by other devices. To allow this dump1090-mutability can be configured to listen on all IP addresses bound to this device. It is recommended that unless you plan to access this device from an external source that dump1090-mutability remain bound only to the local loopback IP address(s).\n\nWould you like dump1090-mutability to listen on all IP addesses?" 15 78
- case $? in
- 0)
- DUMP1090_BIND_TO_ALL_IPS="true"
- ;;
- 1)
- DUMP1090_BIND_TO_ALL_IPS="false"
- ;;
- esac
-fi
-if [[ ! "${DUMP1090_BIND_TO_ALL_IPS}" = "false" ]] ; then
- echo -e "\e[94m Binding dump1090-mutability to all available IP addresses...\e[97m"
- CommentConfig "NET_BIND_ADDRESS" "/etc/default/dump1090-mutability"
-else
- echo -e "\e[94m Binding dump1090-mutability to the localhost IP addresses...\e[97m"
- UncommentConfig "NET_BIND_ADDRESS" "/etc/default/dump1090-mutability"
- ChangeConfig "NET_BIND_ADDRESS" "127.0.0.1" "/etc/default/dump1090-mutability"
-fi
-
-# In future ask the user if they would like to specify the maximum range manually, if not set to 360 nmi / ~667 km to match dump1090-fa.
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- DUMP1090_MAX_RANGE_DIALOG=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Dump1090-mutability Maximum Range" --msgbox "The dump1090-mutability default maximum range value of 300 nmi (~550km) has been reported to be below what is possible under the right conditions, so this value will be increased to 360 nmi (~660 km) to match the value used by the dump1090-fa fork." 10 78 3>&1 1>&2 2>&3)
-fi
-if [[ -z "${DUMP1090_MAX_RANGE}" ]] ; then
- DUMP1090_MAX_RANGE="360"
-fi
-if [[ `grep "MAX_RANGE" "/etc/default/dump1090-mutability" | awk -F \" '{print $2}'` = "${DUMP1090_MAX_RANGE}" ]] ; then
- ChangeConfig "MAX_RANGE" "${DUMP1090_MAX_RANGE}" "/etc/default/dump1090-mutability"
-fi
-
-# Ask if measurements should be displayed using imperial or metric.
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Unit of Measurement" --yes-button "Imperial" --no-button "Metric" --yesno "\nPlease select the unit of measurement to be used by dump1090-mutability." 8 78
- case $? in
- 0)
- DUMP1090_UNIT_OF_MEASUREMENT="imperial"
- ;;
- 1)
- DUMP1090_UNIT_OF_MEASUREMENT="metric"
- ;;
- esac
-fi
-if [[ "${DUMP1090_UNIT_OF_MEASUREMENT}" = "metric" ]] ; then
- echo -e "\e[94m Setting dump1090-mutability unit of measurement to Metric...\e[97m"
- ChangeConfig "Metric" "true;" "/usr/share/dump1090-mutability/html/config.js"
-else
- echo -e "\e[94m Setting dump1090-mutability unit of measurement to Imperial...\e[97m"
- ChangeConfig "Metric" "false;" "/usr/share/dump1090-mutability/html/config.js"
-fi
-
-# Download Heywhatsthat.com maximum range rings.
-if [[ ! -f "/usr/share/dump1090-mutability/html/upintheair.json" ]] ; then
- if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- if (whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Heywhaststhat.com Maximum Range Rings" --yesno "Maximum range rings can be added to dump1090-mutability using data obtained from Heywhatsthat.com. In order to add these rings to your dump1090-mutability map you will first need to visit http://www.heywhatsthat.com and generate a new panorama centered on the location of your receiver. Once your panorama has been generated a link to the panorama will be displayed in the top left hand portion of the page. You will need the view id which is the series of letters and/or numbers after \"?view=\" in this URL.\n\nWould you like to add heywhatsthat.com maximum range rings to your map?" 16 78) ; then
- # Set the DUMP1090_HEYWHATSTHAT_INSTALL variable to true.
- DUMP1090_HEYWHATSTHAT_INSTALL="true"
- # Ask the user for the Heywhatsthat.com panorama ID.
- DUMP1090_HEYWHATSTHAT_ID_TITLE="Heywhatsthat.com Panorama ID"
- while [[ -z "${DUMP1090_HEYWHATSTHAT_ID}" ]] ; do
- DUMP1090_HEYWHATSTHAT_ID=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${DUMP1090_HEYWHATSTHAT_ID_TITLE}" --nocancel --inputbox "\nEnter your Heywhatsthat.com panorama ID." 8 78 3>&1 1>&2 2>&3)
- DUMP1090_HEYWHATSTHAT_ID_TITLE="Heywhatsthat.com Panorama ID (REQUIRED)"
- done
- # Ask the user what altitude in meters to set the first range ring.
- DUMP1090_HEYWHATSTHAT_RING_ONE_TITLE="Heywhatsthat.com First Ring Altitude"
- while [[ -z "${DUMP1090_HEYWHATSTHAT_RING_ONE}" ]] ; do
- DUMP1090_HEYWHATSTHAT_RING_ONE=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${DUMP1090_HEYWHATSTHAT_RING_ONE_TITLE}" --nocancel --inputbox "\nEnter the first ring's altitude in meters.\n(default 3048 meters or 10000 feet)" 8 78 "3048" 3>&1 1>&2 2>&3)
- DUMP1090_HEYWHATSTHAT_RING_ONE_TITLE="Heywhatsthat.com First Ring Altitude (REQUIRED)"
- done
- # Ask the user what altitude in meters to set the second range ring.
- DUMP1090_HEYWHATSTHAT_RING_TWO_TITLE="Heywhatsthat.com Second Ring Altitude"
- while [[ -z "${DUMP1090_HEYWHATSTHAT_RING_TWO}" ]] ; do
- DUMP1090_HEYWHATSTHAT_RING_TWO=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${DUMP1090_HEYWHATSTHAT_RING_TWO_TITLE}" --nocancel --inputbox "\nEnter the second ring's altitude in meters.\n(default 12192 meters or 40000 feet)" 8 78 "12192" 3>&1 1>&2 2>&3)
- DUMP1090_HEYWHATSTHAT_RING_TWO_TITLE="Heywhatsthat.com Second Ring Altitude (REQUIRED)"
- done
- fi
- fi
- # If the Heywhatsthat.com maximum range rings are to be added download them now.
- if [[ "${DUMP1090_HEYWHATSTHAT_INSTALL}" = "true" ]] ; then
- echo -e "\e[94m Downloading JSON data pertaining to the supplied panorama ID...\e[97m"
- echo -e ""
- sudo wget -O /usr/share/dump1090-mutability/html/upintheair.json "http://www.heywhatsthat.com/api/upintheair.json?id=${DUMP1090_HEYWHATSTHAT_ID}&refraction=0.25&alts=${DUMP1090_HEYWHATSTHAT_RING_ONE},${DUMP1090_HEYWHATSTHAT_RING_TWO}"
- fi
-fi
-
-# (re)start dump1090-mutability.
-if [[ "`sudo systemctl status dump1090-mutability 2>&1 | egrep -c "Active: active (running)"`" -gt 0 ]] ; then
- echo -e "\e[94m Restarting the dump1090-mutability service...\e[97m"
- sudo systemctl restart dump1090-mutability 2>&1
-else
- echo -e "\e[94m Starting the dump1090-mutability service...\e[97m"
- sudo systemctl start dump1090-mutability 2>&1
-fi
-
-### SETUP COMPLETE
-
-# Return to the project root directory.
-echo -e "\e[94m Returning to ${RECEIVER_PROJECT_TITLE} root directory...\e[97m"
-cd ${RECEIVER_ROOT_DIRECTORY} 2>&1
-
-echo -e ""
-echo -e "\e[93m ------------------------------------------------------------------------------"
-echo -e "\e[92m Dump1090-mutability setup is complete.\e[39m"
-echo -e ""
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- read -p "Press enter to continue..." CONTINUE
-fi
-
-exit 0
diff --git a/bash/decoders/dump978-fa.sh b/bash/decoders/dump978-fa.sh
new file mode 100755
index 00000000..9480854e
--- /dev/null
+++ b/bash/decoders/dump978-fa.sh
@@ -0,0 +1,203 @@
+#!/bin/bash
+
+#####################################################################################
+# ADS-B RECEIVER #
+#####################################################################################
+# #
+# This script is not meant to be executed directly. #
+# Instead execute install.sh to begin the installation process. #
+# #
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+# #
+# Copyright (c) 2015-2024 Joseph A. Prochazka #
+# #
+# Permission is hereby granted, free of charge, to any person obtaining a copy #
+# of this software and associated documentation files (the "Software"), to deal #
+# in the Software without restriction, including without limitation the rights #
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell #
+# copies of the Software, and to permit persons to whom the Software is #
+# furnished to do so, subject to the following conditions: #
+# #
+# The above copyright notice and this permission notice shall be included in all #
+# copies or substantial portions of the Software. #
+# #
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE #
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, #
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE #
+# SOFTWARE. #
+# #
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+
+### INCLUDE EXTERNAL SCRIPTS
+
+source ${RECEIVER_BASH_DIRECTORY}/variables.sh
+source ${RECEIVER_BASH_DIRECTORY}/functions.sh
+
+### BEGIN SETUP
+
+clear
+echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
+echo ""
+echo -e "\e[92m Setting up dump978-fa..."
+echo ""
+echo -e "\e[93m ------------------------------------------------------------------------------\e[96m"
+echo ""
+whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Dump978-fa Setup" --yesno "This is the FlightAware 978MHz UAT decoder. It is a reimplementation in C++, loosely based on the demodulator from https://github.com/mutability/dump978.\n\n https://github.com/flightaware/dump978\n\nContinue setup by installing dump978-fa?" 14 78
+if [[ $? -eq 1 ]] ; then
+ # Setup has been halted by the user.
+ echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
+ echo -e " Setup has been halted at the request of the user."
+ echo ""
+ echo -e "\e[93m ------------------------------------------------------------------------------"
+ echo -e "\e[92m Dump978-fa setup halted.\e[39m"
+ echo ""
+ read -p "Press enter to continue..." CONTINUE
+ exit 1
+fi
+
+## CHECK FOR PREREQUISITE PACKAGES
+
+echo -e "\e[95m Installing packages needed to build and fulfill dependencies...\e[97m"
+echo ""
+CheckPackage build-essential
+CheckPackage debhelper
+CheckPackage libboost-system-dev
+CheckPackage libboost-program-options-dev
+CheckPackage libboost-regex-dev
+CheckPackage libboost-filesystem-dev
+CheckPackage libsoapysdr-dev
+CheckPackage soapysdr-module-rtlsdr
+echo ""
+
+## DOWNLOAD OR UPDATE THE DUMP978-FA SOURCE
+
+echo -e "\e[95m Preparing the dump978-fa Git repository...\e[97m"
+echo ""
+if [[ -d "${RECEIVER_BUILD_DIRECTORY}/dump978-fa/dump978" ]] && [[ -d "${RECEIVER_BUILD_DIRECTORY}/dump978-fa/dump978/.git" ]] ; then
+ # A directory with a git repository containing the source code already exists.
+ echo -e "\e[94m Entering the dump978-fa git repository directory...\e[97m"
+ cd ${RECEIVER_BUILD_DIRECTORY}/dump978-fa/dump978 2>&1
+ echo -e "\e[94m Updating the local dump978-fa git repository...\e[97m"
+ echo ""
+ git pull
+else
+ # A directory containing the source code does not exist in the build directory.
+ echo -e "\e[94m Creating the ADS-B Receiver Project build directory...\e[97m"
+ echo ""
+ mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/dump978-fa
+ echo ""
+ echo -e "\e[94m Entering the dump978-fa build directory...\e[97m"
+ cd ${RECEIVER_BUILD_DIRECTORY}/dump978-fa 2>&1
+ echo -e "\e[94m Cloning the dump978-fa git repository locally...\e[97m"
+ echo ""
+ git clone https://github.com/flightaware/dump978.git
+fi
+echo ""
+
+## BUILD AND INSTALL THE DUMP978-FA PACKAGE
+
+echo -e "\e[95m Building and installing the dump978-fa package...\e[97m"
+echo ""
+echo -e "\e[94m Entering the dump978-fa git repository directory...\e[97m"
+cd ${RECEIVER_BUILD_DIRECTORY}/dump978-fa/dump978 2>&1
+echo -e "\e[94m Building the dump978-fa package...\e[97m"
+echo ""
+dpkg-buildpackage -b
+echo ""
+echo -e "\e[94m Entering the dump978-fa build directory...\e[97m"
+cd ${RECEIVER_BUILD_DIRECTORY}/dump978-fa 2>&1
+echo -e "\e[94m Installing the dump978-fa package...\e[97m"
+echo ""
+sudo dpkg -i ${RECEIVER_BUILD_DIRECTORY}/dump978-fa/dump978-fa_${DUMP978_FA_VERSION}_*.deb
+echo ""
+echo -e "\e[94m Installing the skyaware978 package...\e[97m"
+echo ""
+sudo dpkg -i ${RECEIVER_BUILD_DIRECTORY}/dump978-fa/skyaware978_${DUMP978_FA_VERSION}_*.deb
+
+# Check that the package was installed.
+echo ""
+echo -e "\e[94m Checking that the dump978-fa package was installed properly...\e[97m"
+if [[ $(dpkg-query -W -f='${STATUS}' dump978-fa 2>/dev/null | grep -c "ok installed") -eq 0 ]] ; then
+ # If the dump978-fa package could not be installed halt setup.
+ echo ""
+ echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
+ echo -e " UNABLE TO INSTALL A REQUIRED PACKAGE."
+ echo -e " SETUP HAS BEEN TERMINATED!"
+ echo ""
+ echo -e "\e[93mThe package \"dump978-fa\" could not be installed.\e[39m"
+ echo ""
+ echo -e "\e[93m ------------------------------------------------------------------------------"
+ echo -e "\e[92m Dump978-fa setup halted.\e[39m"
+ echo ""
+ read -p "Press enter to continue..." CONTINUE
+ exit 1
+fi
+
+# Create binary package archive directory.
+if [[ ! -d "${RECEIVER_BUILD_DIRECTORY}/package-archive" ]] ; then
+ echo -e "\e[94m Creating package archive directory...\e[97m"
+ echo -e ""
+ mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/package-archive 2>&1
+ echo -e ""
+fi
+
+# Archive binary package.
+echo -e "\e[94m Moving the dump978-fa binary package into the archive directory...\e[97m"
+echo ""
+cp -vf ${RECEIVER_BUILD_DIRECTORY}/dump978-fa/*.deb ${RECEIVER_BUILD_DIRECTORY}/package-archive/ 2>&1
+echo ""
+
+### CONFIGURATION
+
+# Check if the dump1090-fa package is installed.
+echo -e "\e[94m Checking if the dump1090-fa package is installed...\e[97m"
+if [[ $(dpkg-query -W -f='${STATUS}' dump1090-fa 2>/dev/null | grep -c "ok installed") -eq 1 ]]; then
+ # Check if dump978-fa has already been configured.
+ echo -e "\e[94m Checking if the dump978-fa package has been configured...\e[97m"
+ if grep -wq "driver=rtlsdr,serial=" /etc/default/dump978-fa; then
+ echo -e "\e[94m This dump978-fa installation appears to have been configured...\e[97m"
+ else
+ whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "RTL-SDR Dongle Assignments" --msgbox "It appears one of the dump1090 packages has been installed on this device. In order to run dump978 in tandem with dump1090 you will need to specifiy which RTL-SDR dongle each decoder is to use.\n\nKeep in mind in order to run both decoders on a single device you will need to have two separate RTL-SDR devices connected to your device." 12 78
+ # Ask the user which USB device is to be used for dump1090.
+ DUMP1090_DEVICE_SERIAL=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Dump1090 RTL-SDR Dongle" --nocancel --inputbox "\nEnter the serial number for your dump1090 RTL-SDR dongle." 8 78 3>&1 1>&2 2>&3)
+ while [[ -z "${DUMP1090_DEVICE_SERIAL}" ]] ; do
+ DUMP1090_DEVICE_SERIAL=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Dump1090 RTL-SDR Dongle (REQUIRED)" --nocancel --inputbox "\nEnter the serial number for your dump1090 RTL-SDR dongle." 8 78 3>&1 1>&2 2>&3)
+ done
+ # Ask the user which USB device is to be use for dump978.
+ DUMP978_DEVICE_SERIAL=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Dump978 RTL-SDR Dongle" --nocancel --inputbox "\nEnter the serial number for your dump978 RTL-SDR dongle." 8 78 3>&1 1>&2 2>&3)
+ while [[ -z "${DUMP978_DEVICE_SERIAL}" ]] ; do
+ DUMP978_DEVICE_SERIAL=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Dump978 RTL-SDR Dongle (REQUIRED)" --nocancel --inputbox "\nEnter the serial number for your dump978 RTL-SDR dongle." 8 78 3>&1 1>&2 2>&3)
+ done
+
+ # Assign the specified RTL-SDR dongle to dump978-fa.
+ echo -e "\e[94m Assigning RTL-SDR dongle \"${DUMP978_DEVICE_SERIAL}\" to dump978-fa...\e[97m"
+ sudo sed -i -e "s/driver=rtlsdr/driver=rtlsdr,serial=${DUMP978_DEVICE_SERIAL}/g" /etc/default/dump978-fa
+ echo -e "\e[94m Restarting dump978-fa...\e[97m"
+ sudo service dump978-fa force-reload
+
+ # Assign the specified RTL-SDR dongle to dump1090-fa.
+ if [[ $(dpkg-query -W -f='${STATUS}' dump1090-fa 2>/dev/null | grep -c "ok installed") -eq 1 ]] ; then
+ echo -e "\e[94m Assigning RTL-SDR dongle \"${DUMP1090_DEVICE_SERIAL}\" to dump1090-fa...\e[97m"
+ ChangeConfig "RECEIVER_SERIAL" ${DUMP1090_DEVICE_SERIAL} "/etc/default/dump1090-fa"
+ echo -e "\e[94m Restarting dump1090-fa...\e[97m"
+ sudo service dump1090-fa force-reload
+ fi
+ fi
+fi
+
+### SETUP COMPLETE
+
+# Return to the project root directory.
+echo -e "\e[94m Entering the ADS-B Receiver Project root directory...\e[97m"
+cd ${RECEIVER_ROOT_DIRECTORY} 2>&1
+
+echo ""
+echo -e "\e[93m ------------------------------------------------------------------------------"
+echo -e "\e[92m Dump978-fa setup is complete.\e[39m"
+echo ""
+read -p "Press enter to continue..." CONTINUE
+
+exit 0
diff --git a/bash/decoders/dump978.sh b/bash/decoders/dump978.sh
deleted file mode 100755
index 90c2ca43..00000000
--- a/bash/decoders/dump978.sh
+++ /dev/null
@@ -1,342 +0,0 @@
-#!/bin/bash
-
-#####################################################################################
-# ADS-B RECEIVER #
-#####################################################################################
-# #
-# This script is not meant to be executed directly. #
-# Instead execute install.sh to begin the installation process. #
-# #
-# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-# #
-# Copyright (c) 2015-2019 Joseph A. Prochazka #
-# #
-# Permission is hereby granted, free of charge, to any person obtaining a copy #
-# of this software and associated documentation files (the "Software"), to deal #
-# in the Software without restriction, including without limitation the rights #
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell #
-# copies of the Software, and to permit persons to whom the Software is #
-# furnished to do so, subject to the following conditions: #
-# #
-# The above copyright notice and this permission notice shall be included in all #
-# copies or substantial portions of the Software. #
-# #
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE #
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, #
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE #
-# SOFTWARE. #
-# #
-# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-
-### VARIABLES
-
-RECEIVER_ROOT_DIRECTORY="${PWD}"
-RECEIVER_BASH_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/bash"
-RECEIVER_BUILD_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/build"
-
-### INCLUDE EXTERNAL SCRIPTS
-
-source ${RECEIVER_BASH_DIRECTORY}/variables.sh
-source ${RECEIVER_BASH_DIRECTORY}/functions.sh
-
-## SET INSTALLATION VARIABLES
-
-# Source the automated install configuration file if this is an automated installation.
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] && [[ -s "${RECEIVER_CONFIGURATION_FILE}" ]] ; then
- source ${RECEIVER_CONFIGURATION_FILE}
-fi
-
-### BEGIN SETUP
-
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- clear
- echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
-fi
-echo -e ""
-echo -e "\e[92m Setting up dump978..."
-echo -e ""
-echo -e "\e[93m ------------------------------------------------------------------------------\e[96m"
-echo -e ""
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Dump1090-mutability Setup" --yesno "Dump978 is an experimental demodulator/decoder for 978MHz UAT signals.\n\n https://github.com/mutability/dump978\n\nWould you like to continue setup by installing dump978?" 9 78
- if [[ $? -eq 1 ]] ; then
- # Setup has been halted by the user.
- echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
- echo -e " Setup has been halted at the request of the user."
- echo -e ""
- echo -e "\e[93m ------------------------------------------------------------------------------"
- echo -e "\e[92m Dump978 setup halted.\e[39m"
- echo -e ""
- read -p "Press enter to continue..." CONTINUE
- exit 1
- fi
-fi
-
-## CHECK FOR PREREQUISITE PACKAGES
-
-echo -e "\e[95m Installing packages needed to build and fulfill dependencies...\e[97m"
-echo -e ""
-CheckPackage git
-CheckPackage make
-CheckPackage rtl-sdr
-CheckPackage librtlsdr-dev
-CheckPackage libusb-1.0-0-dev
-CheckPackage gcc
-CheckPackage netcat
-CheckPackage lighttpd
-
-## ENABLE THE USE OF /ETC/RC.LOCAL IF THE FILE DOES NOT EXIST
-
-if [ ! -f /etc/rc.local ]; then
- echo ""
- echo -e "\e[95m Enabling the use of the /etc/rc.local file...\e[97m"
- echo ""
-
- # In Debian Stretch /etc/rc.local has been removed.
- # However at this time we can bring this file back into play.
- # As to if in future releases this will work remains to be seen...
-
- echo -e "\e[94m Creating the file /etc/rc.local...\e[97m"
- sudo tee /etc/rc.local > /dev/null <&1
-echo -e "\e[94m Cloning the dump978 Git repository locally...\e[97m"
-echo -e ""
-git clone https://github.com/mutability/dump978.git
-
-## BUILD THE DUMP978 BINARIES
-
-echo -e ""
-echo -e "\e[95m Building the dump978 binaries...\e[97m"
-echo -e ""
-# Enter the dump978 repository if we are not already in it.
-if [[ ! "${PWD}" = "${RECEIVER_BUILD_DIRECTORY}/dump978/dump978" ]] ; then
- echo -e "\e[94m Entering the dump978 Git repository directory...\e[97m"
- cd ${RECEIVER_BUILD_DIRECTORY}/dump978/dump978 2>&1
-fi
-# Build the dump978 binaries from source.
-echo -e "\e[94m Building the dump978 binaries...\e[97m"
-echo -e ""
-make all
-echo -e ""
-
-# Check that the dump978 binaries were built.
-echo -e "\e[94m Checking that the dump978 binaries were built...\e[97m"
-if [[ ! -f "${RECEIVER_BUILD_DIRECTORY}/dump978/dump978/dump978" ]] || [[ ! -f "${RECEIVER_BUILD_DIRECTORY}/dump978/dump978/uat2esnt" ]] || [[ ! -f "${RECEIVER_BUILD_DIRECTORY}/dump978/dump978/uat2json" ]] || [[ ! -f "${RECEIVER_BUILD_DIRECTORY}/dump978/dump978/uat2text" ]] ; then
- # If the dump978 binaries could not be found halt setup.
- echo -e ""
- echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
- echo -e " UNABLE TO LOCATE THE DUMP978 BINARIES."
- echo -e " SETUP HAS BEEN TERMINATED!"
- echo -e ""
- echo -e "\e[93mThe dump978 binaries appear to have not been built successfully..\e[39m"
- echo -e ""
- echo -e "\e[93m ------------------------------------------------------------------------------"
- echo -e "\e[92m Dump978 setup halted.\e[39m"
- echo -e ""
- read -p "Press enter to continue..." CONTINUE
- exit 1
-fi
-
-## SETUP AND CONFIGURE THE DEVICE TO UTILIZE THE DDUMP978 BINARIES
-
-echo -e ""
-echo -e "\e[95m Configuring the device to utilize the dump978 binaries...\e[97m"
-echo -e ""
-
-### BLACKLIST UNWANTED RTL-SDR MODULES
-
-# Create an RTL-SDR blacklist file so the device does not claim SDR's for other purposes.
-BlacklistModules
-
-# Remove the dvb_usb_rtl28xxu kernel module.
-echo -e "\e[94m Checking if the kernel module dvb_usb_rtl28xxu is loaded...\e[97m"
-if lsmod | grep "dvb_usb_rtl28xxu" &> /dev/null ; then
- echo -e "\e[94m Removing the kernel module dvb_usb_rtl28xxu...\e[97m"
- echo ""
- sudo rmmod dvb_usb_rtl28xxu
- echo ""
-fi
-
-# Check if the dump1090-mutability package is installed.
-echo -e "\e[94m Checking if the dump1090-mutability package is installed...\e[97m"
-if [[ $(dpkg-query -W -f='${STATUS}' dump1090-mutability 2>/dev/null | grep -c "ok installed") -eq 1 ]] || [[ $(dpkg-query -W -f='${STATUS}' dump1090-fa 2>/dev/null | grep -c "ok installed") -eq 1 ]]; then
- # The dump1090-mutability package appear to be installed.
- if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "RTL-SDR Dongle Assignments" --msgbox "It appears one of the dump1090 packages has been installed on this device. In order to run dump978 in tandem with dump1090 you will need to specifiy which RTL-SDR dongle each decoder is to use.\n\nKeep in mind in order to run both decoders on a single device you will need to have two separate RTL-SDR devices connected to your device." 12 78
- # Ask the user which USB device is to be used for dump1090.
- DUMP1090_DEVICE_ID=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Dump1090 RTL-SDR Dongle" --nocancel --inputbox "\nEnter the ID for your dump1090 RTL-SDR dongle." 8 78 3>&1 1>&2 2>&3)
- while [[ -z "${DUMP1090_DEVICE_ID}" ]] ; do
- DUMP1090_DEVICE_ID=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Dump1090 RTL-SDR Dongle (REQUIRED)" --nocancel --inputbox "\nEnter the ID for your dump1090 RTL-SDR dongle." 8 78 3>&1 1>&2 2>&3)
- done
- # Ask the user which USB device is to be use for dump978.
- DUMP978_DEVICE_ID=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Dump978 RTL-SDR Dongle" --nocancel --inputbox "\nEnter the ID for your dump978 RTL-SDR dongle." 8 78 3>&1 1>&2 2>&3)
- while [[ -z "${DUMP978_DEVICE_ID}" ]] ; do
- DUMP978_DEVICE_ID=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Dump978 RTL-SDR Dongle (REQUIRED)" --nocancel --inputbox "\nEnter the ID for your dump978 RTL-SDR dongle." 8 78 3>&1 1>&2 2>&3)
- done
- fi
-
- # Assign the specified RTL-SDR dongle to dump1090-mutability.
- if [[ $(dpkg-query -W -f='${STATUS}' dump1090-mutability 2>/dev/null | grep -c "ok installed") -eq 1 ]] ; then
- echo -e "\e[94m Assigning RTL-SDR dongle \"${DUMP1090_DEVICE_ID}\" to dump1090-mutability...\e[97m"
- ChangeConfig "DEVICE" ${DUMP1090_DEVICE_ID} "/etc/default/dump1090-mutability"
- echo -e "\e[94m Restarting dump1090-mutability...\e[97m"
- echo -e ""
- sudo service dump1090-mutability force-reload
- echo -e ""
- fi
-
- # Assign the specified RTL-SDR dongle to dump1090-fa.
- if [[ $(dpkg-query -W -f='${STATUS}' dump1090-fa 2>/dev/null | grep -c "ok installed") -eq 1 ]] ; then
- echo -e "\e[94m Assigning RTL-SDR dongle \"${DUMP1090_DEVICE_ID}\" to dump1090-fa...\e[97m"
- ChangeSwitch "--device-index" "${DUMP1090_DEVICE_ID}" "/etc/default/dump1090-fa"
- echo -e "\e[94m Restarting dump1090-fa...\e[97m"
- echo -e ""
- sudo service dump1090-fa force-reload
- echo -e ""
- fi
-
- # Get the latitude and longitude set in the dump1090-mutability configuration file to be used later.
- echo -e "\e[94m Retrieving the receiver's latitude from /etc/default/dump1090-mutability...\e[97m"
- RECEIVER_LATITUDE=`GetConfig "LAT" "/etc/default/dump1090-mutability"`
- echo -e "\e[94m Retrieving the receiver's longitude from /etc/default/dump1090-mutability...\e[97m"
- RECEIVER_LONGITUDE=`GetConfig "LON" "/etc/default/dump1090-mutability"`
-fi
-
-# If a device has not yet been assigned to dump978 assign the first available.
-if [[ -z "${DUMP978_DEVICE_ID}" ]] ; then
- echo -e "\e[94m Assigning RTL-SDR dongle \"0\" to dump978...\e[97m"
- DUMP978_DEVICE_ID="0"
-fi
-
-# Declare the LIGHTTPD_DOCUMENT_ROOT_DIRECTORY variable.
-echo -e "\e[94m Getting the path to Lighttpd's document root...\e[97m"
-LIGHTTPD_DOCUMENT_ROOT_SETTING=`/usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf -p | grep server.document-root`
-LIGHTTPD_DOCUMENT_ROOT_DIRECTORY=`sed 's/.*"\(.*\)"[^"]*$/\1/' <<< ${LIGHTTPD_DOCUMENT_ROOT_SETTING}`
-
-# Set the receivers latitude and longitude.
-if [[ -z "${RECEIVER_LATITUDE}" ]] && [[ -z "${RECEIVER_LONGITUDE}" ]] && [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- # If the receiver's' latitude has not yet been set ask for it.
- RECEIVER_LATITUDE_TITLE="Receiver Latitude"
- while [[ -z "${RECEIVER_LATITUDE}" ]] ; do
- RECEIVER_LATITUDE=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${RECEIVER_LATITUDE_TITLE}" --nocancel --inputbox "\nEnter your receiver's latitude.\n(Example: XX.XXXXXXX)" 9 78 3>&1 1>&2 2>&3)
- RECEIVER_LATITUDE_TITLE="Receiver Latitude (REQUIRED)"
- done
- # If the receiver's' longitude has not yet been set ask for it.
- RECEIVER_LONGITUDE_TITLE="Receiver Longitude"
- while [[ -z "${RECEIVER_LONGITUDE}" ]] ; do
- RECEIVER_LONGITUDE=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${RECEIVER_LONGITUDE_TITLE}" --nocancel --inputbox "\nEnter your receiver's longitude.\n(Example: XX.XXXXXXX)" 9 78 3>&1 1>&2 2>&3)
- RECEIVER_LONGITUDE_TITLE="Receiver Latitude (REQUIRED)"
- done
-fi
-# Finally set the reciver's latitude and longitude if these variables were supplied.
-if [[ -n "${RECEIVER_LATITUDE}" ]] && [[ -n "${RECEIVER_LONGITUDE}" ]] ; then
- if [ -f ${LIGHTTPD_DOCUMENT_ROOT_DIRECTORY}/dump978/config.js ]; then
- echo -e "\e[94m Setting the receiver's latitude in ${LIGHTTPD_DOCUMENT_ROOT_DIRECTORY}/dump978/config.js to ${RECEIVER_LATITUDE}...\e[97m"
- ChangeConfig "SiteLat" "${RECEIVER_LATITUDE}" "${LIGHTTPD_DOCUMENT_ROOT_DIRECTORY}/dump978/config.js"
- echo -e "\e[94m Setting the receiver's longitude in ${LIGHTTPD_DOCUMENT_ROOT_DIRECTORY}/dump978/config.js to ${RECEIVER_LONGITUDE}...\e[97m"
- ChangeConfig "SiteLon" "${RECEIVER_LONGITUDE}" "${LIGHTTPD_DOCUMENT_ROOT_DIRECTORY}/dump978/config.js"
- fi
- echo -e "\e[94m Setting the receiver's latitude in ${RECEIVER_BUILD_DIRECTORY}/portal/html/dump978/config.js to ${RECEIVER_LATITUDE}...\e[97m"
- ChangeConfig "SiteLat" "${RECEIVER_LATITUDE}" "${RECEIVER_BUILD_DIRECTORY}/portal/html/dump978/config.js"
- echo -e "\e[94m Setting the receiver's longitude in ${RECEIVER_BUILD_DIRECTORY}/portal/html/dump978/config.js to ${RECEIVER_LONGITUDE}...\e[97m"
- ChangeConfig "SiteLon" "${RECEIVER_LONGITUDE}" "${RECEIVER_BUILD_DIRECTORY}/portal/html/dump978/config.js"
-fi
-
-# Create the dump978 JSON directory in Lighttpd's document root.
-if [[ ! -d ${LIGHTTPD_DOCUMENT_ROOT_DIRECTORY}/dump978/data ]]; then
- echo -e "\e[94m Creating the dump978 JSON data directory within Lighttpd's document root...\e[97m"
- echo ""
- sudo mkdir -vp ${LIGHTTPD_DOCUMENT_ROOT_DIRECTORY}/dump978/data
- echo ""
- echo -e "\e[94m Setting permissions for the dump978 JSON data directory within Lighttpd's document root...\e[97m"
- sudo chmod +w ${LIGHTTPD_DOCUMENT_ROOT_DIRECTORY}/dump978/data
-fi
-
-# Create the dump978 maintenance script.
-echo -e "\e[94m Creating the dump978 maintenance script...\e[97m"
-tee ${RECEIVER_BUILD_DIRECTORY}/dump978/dump978-maint.sh > /dev/null <(${RECEIVER_BUILD_DIRECTORY}/dump978/dump978/uat2json ${LIGHTTPD_DOCUMENT_ROOT_DIRECTORY}/dump978/data) | ${RECEIVER_BUILD_DIRECTORY}/dump978/dump978/uat2esnt | /bin/nc -q1 127.0.0.1 30001
- sleep 15
-done
-EOF
-echo -e "\e[94m Setting permissions on the dump978 maintenance script...\e[97m"
-chmod +x ${RECEIVER_BUILD_DIRECTORY}/dump978/dump978-maint.sh
-
-# Add the dump978 maintenance script to /etc/rc.local.
-echo -e "\e[94m Checking if the file /etc/rc.local is already set to execute the dump978 maintenance script...\e[97m"
-if [[ `grep -cFx "${RECEIVER_BUILD_DIRECTORY}/dump978/dump978-maint.sh &" /etc/rc.local` -eq 0 ]] ; then
- echo -e "\e[94m Adding a line to execute the dump978 maintenance script to the file /etc/rc.local...\e[97m"
- LINENUMBER=($(sed -n '/exit 0/=' /etc/rc.local))
- ((LINENUMBER>0)) && sudo sed -i "${LINENUMBER[$((${#LINENUMBER[@]}-1))]}i ${RECEIVER_BUILD_DIRECTORY}/dump978/dump978-maint.sh &\n" /etc/rc.local
-fi
-
-## EXECUTE THE MAINTAINANCE SCRIPT TO START DUMP978
-
-echo -e ""
-echo -e "\e[95m Starting dump978...\e[97m"
-echo -e ""
-echo -e "\e[94m Starting dump978 by executing the dump978 maintenance script...\e[97m"
-sudo nohup ${RECEIVER_BUILD_DIRECTORY}/dump978/dump978-maint.sh > /dev/null 2>&1 &
-
-### SETUP COMPLETE
-
-# Return to the project root directory.
-echo -e "\e[94m Entering the ADS-B Receiver Project root directory...\e[97m"
-cd ${RECEIVER_ROOT_DIRECTORY} 2>&1
-
-echo -e ""
-echo -e "\e[93m ------------------------------------------------------------------------------"
-echo -e "\e[92m Dump978 setup is complete.\e[39m"
-echo -e ""
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- read -p "Press enter to continue..." CONTINUE
-fi
-
-exit 0
diff --git a/bash/decoders/rtlsdr-ogn.sh b/bash/decoders/rtlsdr-ogn.sh
deleted file mode 100755
index a3ad2387..00000000
--- a/bash/decoders/rtlsdr-ogn.sh
+++ /dev/null
@@ -1,424 +0,0 @@
-#!/bin/bash
-
-#####################################################################################
-# ADS-B RECEIVER #
-#####################################################################################
-# #
-# This script is not meant to be executed directly. #
-# Instead execute install.sh to begin the installation process. #
-# #
-# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-# #
-# Copyright (c) 2016-2017, Joseph A. Prochazka & Romeo Golf #
-# #
-# Permission is hereby granted, free of charge, to any person obtaining a copy #
-# of this software and associated documentation files (the "Software"), to deal #
-# in the Software without restriction, including without limitation the rights #
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell #
-# copies of the Software, and to permit persons to whom the Software is #
-# furnished to do so, subject to the following conditions: #
-# #
-# The above copyright notice and this permission notice shall be included in all #
-# copies or substantial portions of the Software. #
-# #
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE #
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, #
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE #
-# SOFTWARE. #
-# #
-# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-
-### VARIABLES
-
-RECEIVER_ROOT_DIRECTORY="${PWD}"
-RECEIVER_BASH_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/bash"
-RECEIVER_BUILD_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/build"
-
-# Component specific variables.
-
-# Component service script variables.
-
-### INCLUDE EXTERNAL SCRIPTS
-
-source ${RECEIVER_BASH_DIRECTORY}/variables.sh
-source ${RECEIVER_BASH_DIRECTORY}/functions.sh
-
-# To be moved to functions.sh...
-
-#################################################################################
-# Blacklist DVB-T drivers for RTL-SDR devices.
-
-function BlacklistModules () {
- RECEIVER_KERNEL_MODULE_BLACKLIST="/etc/modprobe.d/rtlsdr-blacklist.conf"
- if [[ ! -f "${RECEIVER_KERNEL_MODULE_BLACKLIST}" ]] || [[ `cat ${RECEIVER_KERNEL_MODULE_BLACKLIST} | wc -l` -lt 9 ]] ; then
- echo -en "\e[94m Installing blacklist to prevent unwanted kernel modules from being loaded...\e[97m"
- sudo tee ${RECEIVER_KERNEL_MODULE_BLACKLIST} > /dev/null </dev/null | grep -c "ok installed") -eq 1 ]] ; then
- DUMP1090_IS_INSTALLED="true"
-# Check if the dump1090-fa package is installed.
-elif [[ $(dpkg-query -W -f='${STATUS}' dump1090-fa 2>/dev/null | grep -c "ok installed") -eq 1 ]] ; then
- DUMP1090_IS_INSTALLED="true"
-else
- DUMP1090_IS_INSTALLED="false"
-fi
-
-# Check if the dump978 binaries exist.
-echo -e "\e[94m Checking if the dump978 binaries exist on this device...\e[97m"
-if [[ -f "${RECEIVER_BUILD_DIRECTORY}/dump978/dump978" ]] && [[ -f "${RECEIVER_BUILD_DIRECTORY}/dump978/uat2text" ]] && [[ -f "${RECEIVER_BUILD_DIRECTORY}/dump978/uat2esnt" ]] && [[ -f "${RECEIVER_BUILD_DIRECTORY}/dump978/uat2json" ]] ; then
- DUMP978_IS_INSTALLED="true"
-else
- DUMP978_IS_INSTALLED="false"
-fi
-
-# If either dump1090 or dump978 is installed we must assign RTL-SDR dongles for each of these decoders.
-if [[ "${DUMP1090_IS_INSTALLED}" = "true" ]] || [[ "${DUMP978_IS_INSTALLED}" = "true" ]] ; then
- # Check if Dump1090 is installed.
- if [[ "${DUMP1090_IS_INSTALLED}" = "true" ]] ; then
- # The dump1090-mutability package appear to be installed.
- if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- # Ask the user which USB device is to be used for dump1090.
- DUMP1090_DEVICE_ID=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Dump1090 RTL-SDR Dongle" --nocancel --inputbox "\nEnter the ID for your dump1090 RTL-SDR dongle." 8 78 3>&1 1>&2 2>&3)
- while [[ -z "${DUMP1090_DEVICE_ID}" ]] ; do
- DUMP1090_DEVICE_ID=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Dump1090 RTL-SDR Dongle (REQUIRED)" --nocancel --inputbox "\nEnter the ID for your dump1090 RTL-SDR dongle." 8 78 3>&1 1>&2 2>&3)
- done
- else
- ### GET DONGLE ID FROM THE INSTALLATION CONFIGURATION FILE...
- true
- fi
- fi
- # Check if Dump978 is installed.
- if [[ "${DUMP978_IS_INSTALLED}" = "true" ]] ; then
- # The dump978 binaries appear to exist on this device.
- if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- # Ask the user which USB device is to be use for dump978.
- DUMP978_DEVICE_ID=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Dump978 RTL-SDR Dongle" --nocancel --inputbox "\nEnter the ID for your dump978 RTL-SDR dongle." 8 78 3>&1 1>&2 2>&3)
- while [[ -z "${DUMP978_DEVICE_ID}" ]] ; do
- DUMP978_DEVICE_ID=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Dump978 RTL-SDR Dongle (REQUIRED)" --nocancel --inputbox "\nEnter the ID for your dump978 RTL-SDR dongle." 8 78 3>&1 1>&2 2>&3)
- done
- else
- ### GET DONGLE ID FROM THE INSTALLATION CONFIGURATION FILE...
- true
- fi
- fi
- #
- if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- # Ask the user which USB device is to be use for RTL-SDR OGN.
- RTLSDROGN_DEVICE_ID=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "RTL-SDR OGN RTL-SDR Dongle" --nocancel --inputbox "\nEnter the ID for your RTL-SDR OGN RTL-SDR dongle." 8 78 3>&1 1>&2 2>&3)
- while [[ -z "${DUMP978_DEVICE_ID}" ]] ; do
- RTLSDROGN_DEVICE_ID=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "RTL-SDR OGN RTL-SDR Dongle (REQUIRED)" --nocancel --inputbox "\nEnter the ID for your RTL-SDR OGN RTL-SDR dongle." 8 78 3>&1 1>&2 2>&3)
- done
- else
- ### GET DONGLE ID FROM THE INSTALLATION CONFIGURATION FILE...
- true
- fi
- # Assign the specified RTL-SDR dongle to dump1090.
- if [[ "${DUMP1090_IS_INSTALLED}" = "true" ]] && [[ -n "${DUMP1090_DEVICE_ID}" ]] ; then
- echo -e "\e[94m Assigning RTL-SDR dongle \"${DUMP1090_DEVICE_ID}\" to dump1090-mutability...\e[97m"
- ChangeConfig "DEVICE" ${DUMP1090_DEVICE_ID} "/etc/default/dump1090-mutability"
- echo -e "\e[94m Reloading dump1090-mutability...\e[97m"
- echo -e ""
- sudo /etc/init.d/dump1090-mutability force-reload
- echo -e ""
- fi
- # Assign the specified RTL-SDR dongle to dump978
- if [[ "${DUMP978_IS_INSTALLED}" = "true" ]] && [[ -n "${DUMP978_DEVICE_ID}" ]] ; then
- echo -e "\e[94m Assigning RTL-SDR dongle \"${DUMP978_DEVICE_ID}\" to dump978...\e[97m"
- ### ADD DEVICE TO MAINTENANCE SCRIPT...
- echo -e "\e[94m Reloading dump978...\e[97m"
- ### KILL EXISTING DUMP978 PROCESSES...
- echo -e ""
- ### RESTART DUMP978...
- echo -e ""
- fi
-fi
-
-### ASSIGN RTL-SDR DONGLE FOR RTL-SDR OGN...
-
-### DOWNLOAD AND SET UP THE BINARIES
-
-# Create build directory if not already present.
-if [[ ! -d "${RECEIVER_BUILD_DIRECTORY}/rtlsdr-ogn" ]] ; then
- echo -e "\e[94m Creating the directory (${RECEIVER_BUILD_DIRECTORY}/rtlsdr-ogn)...\e[97m"
- mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/rtlsdr-ogn
-fi
-
-# Enter the build directory.
-if [[ ! "${PWD}" = "${RECEIVER_BUILD_DIRECTORY}/rtlsdr-ogn" ]] ; then
- echo -e "\e[94m Entering the directory (${RECEIVER_BUILD_DIRECTORY}/rtlsdr-ogn)...\e[97m"
- cd ${RECEIVER_BUILD_DIRECTORY}/rtlsdr-ogn 2>&1
-fi
-
-# Use function to detect cpu architecture.
-if [[ -z "${CPU_ARCHITECTURE}" ]] ; then
- Check_CPU
- echo -e ""
-fi
-
-# Identify the correct binaries to download.
-case ${CPU_ARCHITECTURE} in
- "armv6l")
- # Raspberry Pi 1.
- COMPONENT_BINARY_URL="http://download.glidernet.org/rpi-gpu/rtlsdr-ogn-bin-RPI-GPU-latest.tgz"
- echo -e "\e[94m Downloading the latest RTL-SDR OGN RPI-GPU binaries...\e[97m"
- echo -e ""
- wget "${COMPONENT_BINARY_URL}" -O "${RECEIVER_BUILD_DIRECTORY}/rtlsdr-ogn/rtlsdr-ogn-bin-RPI-GPU-latest.tgz"
- echo -e ""
- echo -e "\e[94m Extracting the latest RTL-SDR OGN RPI-GPU binaries from the archive...\e[97m"
- echo -e ""
- tar xvzf rtlsdr-ogn-bin-RPI-GPU-latest.tgz -C ${RECEIVER_BUILD_DIRECTORY}/rtlsdr-ogn
- ;;
- "armv7l")
- # Raspberry Pi 2 onwards.
- COMPONENT_BINARY_URL="http://download.glidernet.org/arm/rtlsdr-ogn-bin-ARM-latest.tgz"
- echo -e "\e[94m Downloading the latest RTL-SDR OGN ARM binaries...\e[97m"
- echo -e ""
- wget "${COMPONENT_BINARY_URL}" -O "${RECEIVER_BUILD_DIRECTORY}/rtlsdr-ogn/rtlsdr-ogn-bin-ARM-latest.tgz"
- echo -e ""
- echo -e "\e[94m Extracting the latest RTL-SDR OGN ARM binaries from the archive...\e[97m"
- echo -e ""
- tar xvzf rtlsdr-ogn-bin-ARM-latest.tgz -C ${RECEIVER_BUILD_DIRECTORY}/rtlsdr-ogn
- ;;
- "x86_64")
- # 64 Bit.
- COMPONENT_BINARY_URL="http://download.glidernet.org/x64/rtlsdr-ogn-bin-x64-latest.tgz"
- echo -e "\e[94m Downloading the latest RTL-SDR OGN x64 binaries...\e[97m"
- echo -e ""
- wget "${COMPONENT_BINARY_URL}" -O "${RECEIVER_BUILD_DIRECTORY}/rtlsdr-ogn/rtlsdr-ogn-bin-x64-latest.tgz"
- echo -e ""
- echo -e "\e[94m Extracting the latest RTL-SDR OGN x64 binaries from the archive...\e[97m"
- echo -e ""
- tar xvzf rtlsdr-ogn-bin-x64-latest.tgz -C ${RECEIVER_BUILD_DIRECTORY}/rtlsdr-ogn
- ;;
- *)
- # 32 Bit (default install if no others matched).
- COMPONENT_BINARY_URL="http://download.glidernet.org/x86/rtlsdr-ogn-bin-x86-latest.tgz"
- echo -e "\e[94m Downloading the latest RTL-SDR OGN x86 binaries...\e[97m"
- echo -e ""
- wget "${COMPONENT_BINARY_URL}" -O "${RECEIVER_BUILD_DIRECTORY}/rtlsdr-ogn/rtlsdr-ogn-bin-x86-latest.tgz"
- echo -e ""
- echo -e "\e[94m Extracting the latest RTL-SDR OGN x86 binaries from the archive...\e[97m"
- echo -e ""
- tar xvzf rtlsdr-ogn-bin-x86-latest.tgz -C ${RECEIVER_BUILD_DIRECTORY}/rtlsdr-ogn
- ;;
-esac
-
-# Change to component work directory for post-build actions.
-echo -e ""
-echo -e "\e[94m Entering the directory containing the RTL-SDR binaries...\e[97m"
-cd ${RECEIVER_BUILD_DIRECTORY}/rtlsdr-ogn/rtlsdr-ogn 2>&1
-
-# Create named pipe if required.
-if [[ ! -p "ogn-rf.fifo" ]] ; then
- echo -e "\e[94m Creating named pipe...\e[97m"
- sudo mkfifo ogn-rf.fifo
-fi
-
-# Set file permissions.
-echo -e "\e[94m Setting proper file permissions...\e[97m"
-sudo chown root gsm_scan
-sudo chmod a+s gsm_scan
-sudo chown root ogn-rf
-sudo chmod a+s ogn-rf
-sudo chown root rtlsdr-ogn
-sudo chmod a+s rtlsdr-ogn
-# And check that the file permissions have been applied.
-
-# Creat GPU device if required.
-if [[ ! -c "gpu_dev" ]] ; then
- # The mknod major_version number varies with kernel version.
- echo -e "\e[94m Getting the version of the kernel currently running...\e[97m"
- KERNEL=`uname -r`
- RECEIVER_KERNEL_VERSION=`echo ${KERNEL} | cut -d \. -f 1`.`echo ${KERNEL} | cut -d \. -f 2`
- # Check if the currently running kernel is version 4.1 or higher.
- if [[ "${RECEIVER_KERNEL_VERSION}" < 4.1 ]] ; then
- # Kernel is older than version 4.1.
- echo -e "\e[94m Executing mknod for older kernels...\e[97m"
- sudo mknod gpu_dev c 100 0
- else
- # Kernel is version 4.1 or newer.
- echo -e "\e[94m Executing mknod for newer kernels...\e[97m"
- sudo mknod gpu_dev c 249 0
- fi
-fi
-
-## GATHER INFORMATION FROM USER
-
-
-# Latitude.
-
-# Longitude.
-
-# Altitude.
-
-# Check for component specific variables, otherwise populate with dummy values to ensure valid config generation.
-
-# Ask if user would like to calibrate the tuner.
-
-### CREATE THE CONFIGURATION FILE
-
-# Update existing or create new config file.
-#########################################################
-# #
-# CREATE THE CONFIGURATION FILE #
-# #
-# http://wiki.glidernet.org/wiki:receiver-config-file #
-# #
-#########################################################
-
-# Update ownership of new config file.
-
-### INSTALL AS A SERVICE
-
-# Install service script.
-echo -e "\e[94m Downloading and setting permissions on the init script...\e[97m"
-echo -e ""
-sudo wget http://download.glidernet.org/common/service/rtlsdr-ogn -O /etc/init.d/rtlsdr-ogn
-sudo chmod +x /etc/init.d/rtlsdr-ogn
-
-# Generate and install service script configuration file.
-echo -e "\e[94m Creating the file /etc/rtlsdr-ogn.conf...\e[97m"
-echo -e ""
-sudo tee /etc/rtlsdr-ogn.conf > /dev/null <
-#Syntax:
-#port user directory command args
-50000 pi ${RECEIVER_BUILD_DIRECTORY}/rtlsdr-ogn/rtlsdr-ogn ./ogn-rf rtlsdr-ogn.conf
-50001 pi ${RECEIVER_BUILD_DIRECTORY}/rtlsdr-ogn/rtlsdr-ogn ./ogn-decode rtlsdr-ogn.conf
-EOF
-
-# Configure component as a service.
-echo -e "\e[94m Setting up rtlsdr-ogn as a service...\e[97m"
-echo -e ""
-sudo update-rc.d rtlsdr-ogn defaults
-
-# (re)start the component service.
-echo -e "\e[94m Starting the rtlsdr-ogn service...\e[97m"
-echo -e ""
-sudo service rtlsdr-ogn start
-
-### SETUP COMPLETE
-
-# Return to the project root directory.
-echo -e "\e[94m Entering the ADS-B Receiver Project root directory...\e[97m"
-cd ${RECEIVER_ROOT_DIRECTORY} 2>&1
-
-echo -e "\e[93m ------------------------------------------------------------------------------\n"
-echo -e "\e[92m RTL-SDR OGN setup is complete.\e[39m"
-echo -e ""
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- read -p "Press enter to continue..." CONTINUE
-fi
-
-exit 0
diff --git a/bash/extras/abovetustin.sh b/bash/extras/abovetustin.sh
deleted file mode 100755
index d88a7147..00000000
--- a/bash/extras/abovetustin.sh
+++ /dev/null
@@ -1,710 +0,0 @@
-#!/bin/bash
-
-#####################################################################################
-# ADS-B RECEIVER #
-#####################################################################################
-# #
-# This script is not meant to be executed directly. #
-# Instead execute install.sh to begin the installation process. #
-# #
-# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-# #
-# Copyright (c) 2015-2018 Joseph A. Prochazka #
-# #
-# Permission is hereby granted, free of charge, to any person obtaining a copy #
-# of this software and associated documentation files (the "Software"), to deal #
-# in the Software without restriction, including without limitation the rights #
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell #
-# copies of the Software, and to permit persons to whom the Software is #
-# furnished to do so, subject to the following conditions: #
-# #
-# The above copyright notice and this permission notice shall be included in all #
-# copies or substantial portions of the Software. #
-# #
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE #
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, #
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE #
-# SOFTWARE. #
-# #
-# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-
-## SET INSTALLATION VARIABLES
-
-RECEIVER_ROOT_DIRECTORY="${PWD}"
-RECEIVER_BASH_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/bash"
-RECEIVER_BUILD_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/build"
-
-## INCLUDE EXTERNAL SCRIPTS
-
-source ${RECEIVER_BASH_DIRECTORY}/variables.sh
-source ${RECEIVER_BASH_DIRECTORY}/functions.sh
-
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] && [[ -s "${RECEIVER_CONFIGURATION_FILE}" ]] ; then
- source ${RECEIVER_CONFIGURATION_FILE}
-fi
-
-## BEGIN SETUP
-
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- clear
- echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
-fi
-echo -e ""
-echo -e "\e[92m Setting up AboveTustin..."
-echo -e "\e[93m ------------------------------------------------------------------------------\e[96m"
-echo -e ""
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "AboveTustin Setup" --yesno "AboveTustin is an ADS-B Twitter Bot. Uses dump1090-mutability to track airplanes and then tweets whenever an airplane flies overhead.\n\n https://github.com/kevinabrandon/AboveTustin\n\nContinue setting up AboveTustin?" 12 78
- if [[ $? -eq 1 ]] ; then
- # Setup has been halted by the user.
- echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
- echo -e " Setup has been halted at the request of the user."
- echo -e ""
- echo -e "\e[93m ------------------------------------------------------------------------------\e[96m"
- echo -e "\e[92m AboveTustin setup halted.\e[39m"
- echo -e ""
- read -p "Press enter to continue..." CONTINUE
- exit 1
- fi
-fi
-
-echo -e "\e[95m Setting up AboveTustin on this device...\e[97m"
-echo -e ""
-
-## ENABLE THE USE OF /ETC/RC.LOCAL IF THE FILE DOES NOT EXIST
-
-if [ ! -f /etc/rc.local ]; then
- echo ""
- echo -e "\e[95m Enabling the use of the /etc/rc.local file...\e[97m"
- echo ""
-
- # In Debian Stretch /etc/rc.local has been removed.
- # However at this time we can bring this file back into play.
- # As to if in future releases this will work remains to be seen...
-
- echo -e "\e[94m Creating the file /etc/rc.local...\e[97m"
- sudo tee /etc/rc.local > /dev/null <&1
- echo -e "\e[94m Updating the repository package lists...\e[97m"
- echo ""
- sudo apt-get update 2>&1
- echo ""
-fi
-
-# Detect the OS distribution and version.
-DISTRO_ID=`. /etc/os-release; echo ${ID/*, /}`
-DISTRO_RELEASE=`. /etc/os-release; echo ${VERSION_ID/*, /}`
-
-# Check that the required packages are installed.
-CheckPackage ttf-mscorefonts-installer
-CheckPackage python3-pip
-CheckPackage libstdc++6
-CheckPackage flex
-CheckPackage bison
-CheckPackage gperf
-CheckPackage ruby
-CheckPackage perl
-CheckPackage libsqlite3-dev
-CheckPackage libfontconfig1
-CheckPackage libfontconfig1-dev
-CheckPackage libicu-dev
-CheckPackage libfreetype6
-CheckPackage libssl-dev
-CheckPackage libjpeg-dev
-CheckPackage python
-CheckPackage libx11-dev
-CheckPackage libxext-dev
-CheckPackage libc6
-CheckPackage curl
-
-# Depending on the version of Debian, Raspbian, or Ubuntu the correct libpng-dev package needs to be installed.
-# This is currently kind of sloppy and rushed and should definatly be refactored later.
-case $DISTRO_ID in
- debian|raspbian)
- if [[ $DISTRO_RELEASE -ge "9" ]]; then
- CheckPackage libpng-dev
- else
- CheckPackage libpng12-dev
- fi
- ;;
- ubuntu)
- if [[ $DISTRO_RELEASE -ge "16.04" ]]; then
- CheckPackage libpng-dev
- else
- CheckPackage libpng12-dev
- fi
- ;;
- *)
- CheckPackage libpng12-dev
- ;;
-esac
-
-if [[ "${PHANTOMJS_BINARY_AVAILABLE}" = "false" ]] ; then
- # These packages are only needed if the user decided to build PhantomJS.
- CheckPackage build-essential
- CheckPackage g++
-else
- # Package needed if the prebuilt PhantomJS binary is to be downloaded.
- CheckPackage bzip2
-fi
-
-## CONFIRM SETTINGS
-
-# GATHER TWITTER API INFORMATION FROM THE USER
-
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Twiter Keys and Tokens" --yesno "In order to send Tweets to Twitter using AboveTustin you will need to obtain the proper keys and tokens from Twitter. You will need to sign up for a Twitter developer account at https://apps.twitter.com and create an application there in order to obtain this information.\n\nMore information on obtaining Twitter keys and access tokens can be found in the projects wiki page.\n\n https://github.com/jprochazka/adsb-receiver/wiki/Setting-Up-AboveTustin\n\nProceed with the AboveTustin setup?" 18 78
- if [[ $? -eq 1 ]] ; then
- # Setup has been halted by the user.
- echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
- echo -e " Setup has been halted at the request of the user."
- echo -e ""
- echo -e "\e[93m ------------------------------------------------------------------------------\e[96m"
- echo -e "\e[92m AboveTustin setup halted.\e[39m"
- echo -e ""
- read -p "Press enter to continue..." CONTINUE
- exit 1
- fi
-fi
-
-# If any exist assign the current Twitter keys and access tokens to variables.
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- TWITTER_ACCESS_TOKEN_TITLE="Twitter Access Token"
- while [[ -z "${TWITTER_ACCESS_TOKEN}" ]]; do
- if [[ -f ${RECEIVER_BUILD_DIRECTORY}/abovetustin/AboveTustin/config.ini ]]; then
- if [[ `grep -c "^access_token =" ${RECEIVER_BUILD_DIRECTORY}/abovetustin/AboveTustin/config.ini` -gt 0 ]]; then
- TWITTER_ACCESS_TOKEN=$(grep "^access_token =" "${RECEIVER_BUILD_DIRECTORY}/abovetustin/AboveTustin/config.ini" | awk '{print $3}')
- fi
- fi
- TWITTER_ACCESS_TOKEN=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${TWITTER_ACCESS_TOKEN_TITLE}" --nocancel --inputbox "\nEnter your Twitter Access Token." 8 78 "${TWITTER_ACCESS_TOKEN}" 3>&1 1>&2 2>&3)
- TWITTER_ACCESS_TOKEN_TITLE="Twitter Access Token (REQUIRED)"
- done
- #
- TWITTER_ACCESS_TOKEN_SECRET_TITLE="Twitter Access Token Secret"
- while [[ -z "${TWITTER_ACCESS_TOKEN_SECRET}" ]] ; do
- if [[ -f ${RECEIVER_BUILD_DIRECTORY}/abovetustin/AboveTustin/config.ini ]]; then
- if [[ `grep -c "^access_token_secret =" ${RECEIVER_BUILD_DIRECTORY}/abovetustin/AboveTustin/config.ini` -gt 0 ]] ; then
- TWITTER_ACCESS_TOKEN_SECRET=$(grep "^access_token_secret =" "${RECEIVER_BUILD_DIRECTORY}/abovetustin/AboveTustin/config.ini" | awk '{print $3}')
- fi
- fi
- TWITTER_ACCESS_TOKEN_SECRET=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${TWITTER_ACCESS_TOKEN_SECRET_TITLE}" --nocancel --inputbox "\nEnter your Twitter Access Token Secret." 8 78 "${TWITTER_ACCESS_TOKEN_SECRET}" 3>&1 1>&2 2>&3)
- TWITTER_ACCESS_TOKEN_SECRET_TITLE="Twitter Access Token Secret (REQUIRED)"
- done
- #
- TWITTER_CONSUMER_KEY_TITLE="Twitter Consumer Key"
- while [[ -z "${TWITTER_CONSUMER_KEY}" ]] ; do
- if [[ -f ${RECEIVER_BUILD_DIRECTORY}/abovetustin/AboveTustin/config.ini ]]; then
- if [[ `grep -c "^consumer_key =" ${RECEIVER_BUILD_DIRECTORY}/abovetustin/AboveTustin/config.ini` -gt 0 ]] ; then
- TWITTER_CONSUMER_KEY=$(grep "^consumer_key =" "${RECEIVER_BUILD_DIRECTORY}/abovetustin/AboveTustin/config.ini" | awk '{print $3}')
- fi
- fi
- TWITTER_CONSUMER_KEY=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${TWITTER_CONSUMER_KEY_TITLE}" --nocancel --inputbox "\nEnter your Twitter Consumer Key." 8 78 "${TWITTER_CONSUMER_KEY}" 3>&1 1>&2 2>&3)
- TWITTER_CONSUMER_KEY_TITLE="Twitter Consumer Key (REQUIRED)"
- done
- #
- TWITTER_CONSUMER_SECRET_TITLE="Twitter Consumer Secret"
- while [[ -z "${TWITTER_CONSUMER_SECRET}" ]] ; do
- if [[ -f ${RECEIVER_BUILD_DIRECTORY}/abovetustin/AboveTustin/config.ini ]]; then
- if [[ `grep -c "^consumer_secret =" ${RECEIVER_BUILD_DIRECTORY}/abovetustin/AboveTustin/config.ini` -gt 0 ]] ; then
- TWITTER_CONSUMER_SECRET=$(grep "^consumer_secret =" "${RECEIVER_BUILD_DIRECTORY}/abovetustin/AboveTustin/config.ini" | awk '{print $3}')
- fi
- fi
- TWITTER_CONSUMER_SECRET=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${TWITTER_CONSUMER_SECRET_TITLE}" --nocancel --inputbox "\nEnter your Twitter Consumer Secret." 8 78 "${TWITTER_CONSUMER_SECRET}" 3>&1 1>&2 2>&3)
- TWITTER_CONSUMER_SECRET_TITLE="Twitter Consumer Secret (REQUIRED)"
- done
-fi
-
-# Ask for the receivers latitude and longitude.
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- # Explain to the user that the receiver's latitude and longitude is required.
- RECEIVER_LATLON_DIALOG=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Receiver Latitude and Longitude" --msgbox "Your receivers latitude and longitude are required for distance calculations, you will now be asked to supply these values for your receiver.\n\nIf you do not have this information you can obtain it using the web based \"Geocode by Address\" utility hosted on another of the lead developers websites:\n\n https://www.swiftbyte.com/toolbox/geocode" 15 78 3>&1 1>&2 2>&3)
-
- # Ask the user to confirm the receivers latitude, this will be prepopulated by the latitude assigned dump1090-mutability.
- RECEIVER_LATITUDE_TITLE="Receiver Latitude"
- while [[ -z "${RECEIVER_LATITUDE}" ]] ; do
- if [[ -f ${RECEIVER_BUILD_DIRECTORY}/abovetustin/AboveTustin/config.ini ]]; then
- if [[ `grep "^latitude = " ${RECEIVER_BUILD_DIRECTORY}/abovetustin/AboveTustin/config.ini | awk '{print $3}' | wc -c` -gt 1 ]] ; then
- RECEIVER_LATITUDE=$(grep "^latitude =" "${RECEIVER_BUILD_DIRECTORY}/abovetustin/AboveTustin/config.ini" | awk '{print $3}')
- RECEIVER_LATITUDE_SOURCE=", the value below is configured in AboveTustin"
- fi
- elif [[ -f /etc/default/dump1090-mutability ]]; then
- RECEIVER_LATITUDE=$(GetConfig "LAT" "/etc/default/dump1090-mutability")
- RECEIVER_LATITUDE_SOURCE=", the value below is configured in Dump1090"
- fi
- RECEIVER_LATITUDE=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${RECEIVER_LATITUDE_TITLE}" --nocancel --inputbox "\nPlease confirm your receiver's latitude${RECEIVER_LATITUDE_SOURCE}:\n" 10 78 -- "${RECEIVER_LATITUDE}" 3>&1 1>&2 2>&3)
- RECEIVER_LATITUDE_TITLE="Receiver Latitude (REQUIRED)"
- done
-
- # Ask the user to confirm the receivers longitude, this will be prepopulated by the longitude assigned dump1090-mutability.
- RECEIVER_LONGITUDE_TITLE="Receiver Longitude"
- while [[ -z "${RECEIVER_LONGITUDE}" ]] ; do
- if [[ -f ${RECEIVER_BUILD_DIRECTORY}/abovetustin/AboveTustin/config.ini ]]; then
- if [[ `grep "^longitude = " ${RECEIVER_BUILD_DIRECTORY}/abovetustin/AboveTustin/config.ini | awk '{print $3}' | wc -c` -gt 1 ]] ; then
- RECEIVER_LONGITUDE=$(grep "^longitude =" ${RECEIVER_BUILD_DIRECTORY}/abovetustin/AboveTustin/config.ini | awk '{print $3}')
- RECEIVER_LONGITUDE_SOURCE=", the value below is configured in AboveTustin"
- fi
- elif [[ -f /etc/default/dump1090-mutability ]]; then
- RECEIVER_LONGITUDE=$(GetConfig "LON" "/etc/default/dump1090-mutability")
- RECEIVER_LONGITUDE_SOURCE=", the value below is configured in Dump1090"
- fi
- RECEIVER_LONGITUDE=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${RECEIVER_LONGITUDE_TITLE}" --nocancel --inputbox "\nEnter your receiver's longitude${RECEIVER_LONGITUDE_SOURCE}:\n" 10 78 -- "${RECEIVER_LONGITUDE}" 3>&1 1>&2 2>&3)
- RECEIVER_LONGITUDE_TITLE="Receiver Longitude (REQUIRED)"
- done
-fi
-
-## START INSTALLATION
-
-echo -e ""
-echo -e "\e[95m Commencing installation...\e[97m"
-echo -e ""
-
-# Confirm timezone.
-if [[ -z "${TIME_ZONE}" ]] ; then
- echo -e "\e[94m Confirming time zone...\e[97m"
- TIME_ZONE=`cat /etc/timezone 2>&1`
- TIME_ZONE_ESCAPED=`echo ${TIME_ZONE} | sed -e 's/\\//\\\\\//g'`
-fi
-
-## PROJECT BUILD DIRECTORY
-
-# Create the build directory if it does not already exist.
-if [[ ! -d ${RECEIVER_BUILD_DIRECTORY} ]] ; then
- echo -e "\e[94m Creating the ADS-B Receiver Project build directory...\e[97m"
- mkdir -vp ${RECEIVER_BUILD_DIRECTORY} 2>&1
-fi
-
-# Create a component directory within the build directory if it does not already exist.
-if [[ ! -d "${RECEIVER_BUILD_DIRECTORY}/abovetustin" ]] ; then
- echo -e "\e[94m Creating the directory ${RECEIVER_BUILD_DIRECTORY}/abovetustin...\e[97m"
- echo ""
- mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/abovetustin 2>&1
-fi
-
-## SETUP PHANTOMJS IF IT DOES NOT ALREADY EXIST ON THIS DEVICE
-
-if [[ "${PHANTOMJS_EXISTS}" = "false" ]] ; then
- if [[ "${PHANTOMJS_BINARY_AVAILABLE}" = "true" ]] ; then
-
- # DOWNLOAD THE PHANTOMJS BINARY
-
- echo -e ""
- echo -e "\e[95m Downloading and installing the PhantomJS binary...\e[97m"
- echo -e ""
-
- # Enter the root of the project build directory.
- echo -e "\e[94m Entering the build directory...\e[97m"
- cd ${RECEIVER_BUILD_DIRECTORY}/abovetustin 2>&1
-
- # Select the relevant PhantomJS binary.
- case ${CPU_ARCHITECTURE} in
- "armv7l")
- # Use the armv7l version of the PhantomJS binary from https://github.com/jprochazka/phantomjs-linux-armv7l.
- echo -e "\e[94m Downloading the ${CPU_ARCHITECTURE} PhantomJS v${PHANTOMJS_VERSION} binary for Linux...\e[97m"
- echo -e ""
- PHANTOMJS_BINARY_URL="https://github.com/jprochazka/phantomjs-linux-armv7l/releases/download/${PHANTOMJS_VERSION}/phantomjs-${PHANTOMJS_VERSION}-linux-${CPU_ARCHITECTURE}.tar.bz2"
- ;;
- "x86_64")
- # Use the x86_64 version of the PhantomJS binary from the PhantomJS web site.
- echo -e "\e[94m Downloading the official ${CPU_ARCHITECTURE} PhantomJS v${PHANTOMJS_VERSION} binary for Linux...\e[97m"
- echo -e ""
- PHANTOMJS_BINARY_URL="https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-${PHANTOMJS_VERSION}-linux-${CPU_ARCHITECTURE}.tar.bz2"
- ;;
- "i686")
- # Use the i686 version of the PantomJS binary from the PhantomJS web site.
- echo -e "\e[94m Downloading the official ${CPU_ARCHITECTURE} PhantomJS v${PHANTOMJS_VERSION} binary for Linux...\e[97m"
- echo -e ""
- PHANTOMJS_BINARY_URL="https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-${PHANTOMJS_VERSION}-linux-${CPU_ARCHITECTURE}.tar.bz2"
- ;;
- esac
-
- # Download the PantomJS binary.
- if [[ -n "${PHANTOMJS_BINARY_URL}" ]] ; then
- curl -L "${PHANTOMJS_BINARY_URL}" -O 2>&1
- echo ""
- fi
-
- # Extract the files from the PhantomJS archive which was just downloaded.
- if [[ -f "phantomjs-${PHANTOMJS_VERSION}-linux-${CPU_ARCHITECTURE}.tar.bz2" ]] ; then
- echo -e "\e[94m Extracting the PhantomJS binary archive...\e[97m"
- echo ""
- tar -vxj -f phantomjs-${PHANTOMJS_VERSION}-linux-${CPU_ARCHITECTURE}.tar.bz2 2>&1
- echo -e ""
- echo -e "\e[94m Removing the PhantomJS binary archive...\e[97m"
- echo ""
- rm -vf phantomjs-${PHANTOMJS_VERSION}-linux-${CPU_ARCHITECTURE}.tar.bz2 2>&1
- echo -e ""
- else
- echo -e "\e[94m Unable to extract the PhantomJS binary archive...\e[97m"
- fi
-
- # Move the binary into the /usr/bin directory and make it executable.
- if [[ -f "phantomjs-${PHANTOMJS_VERSION}-linux-${CPU_ARCHITECTURE}/bin/phantomjs" ]] ; then
- echo -e "\e[94m Copying the PhantomJS binary into the directory /usr/bin...\e[97m"
- echo -e ""
- sudo cp -v phantomjs-${PHANTOMJS_VERSION}-linux-${CPU_ARCHITECTURE}/bin/phantomjs /usr/bin 2>&1
- echo ""
- else
- echo -e "\e[94m Unable to copying the PhantomJS binary into the directory /usr/bin...\e[97m"
- fi
-
- # Make the binary in /usr/bin executable.
- if [[ -f "/usr/bin/phantomjs" ]] ; then
- echo -e "\e[94m Making the file /usr/bin/phantomjs executable...\e[97m"
- echo -e ""
- sudo chmod -v +x /usr/bin/phantomjs 2>&1
- else
- echo -e "\e[94m Unable to make the file /usr/bin/phantomjs executable...\e[97m"
- fi
-
- else
-
- # BUILD PHANTOMJS
-
- echo -e ""
- echo -e "\e[95m Building then placing the PhantomJS binary...\e[97m"
- echo -e ""
-
- # Download the source code.
- echo -e ""
- echo -e "\e[95m Preparing the PhantomJS Git repository...\e[97m"
- echo -e ""
- if [[ -d "${RECEIVER_BUILD_DIRECTORY}/phantomjs" ]] && [[ -d "${RECEIVER_BUILD_DIRECTORY}/phantomjs/.git" ]] ; then
- # A directory with a git repository containing the source code already exists.
- echo -e "\e[94m Entering the PhantomJS git repository directory...\e[97m"
- cd ${RECEIVER_BUILD_DIRECTORY}/phantomjs 2>&1
- echo -e ""
- echo -e "\e[94m Updating the local PhantomJS git repository...\e[97m"
- git pull --all 2>&1
- echo -e ""
- else
- # A directory containing the source code does not exist in the build directory.
- echo -e "\e[94m Entering the build directory...\e[97m"
- cd ${RECEIVER_BUILD_DIRECTORY}/phantomjs 2>&1
- echo -e ""
- if [[ -d "${RECEIVER_BUILD_DIRECTORY}/phantomjs" ]] ; then
- echo -e "\e[94m Removing old PhantomJS build directory...\e[97m"
- rm -vrf "${RECEIVER_BUILD_DIRECTORY}/phantomjs" 2>&1
- echo -e ""
- fi
- echo -e "\e[94m Cloning the PhantomJS git repository locally...\e[97m"
- echo -e ""
- git clone git://github.com/ariya/phantomjs.git "${RECEIVER_BUILD_DIRECTORY}/phantomjs" 2>&1
- echo -e ""
- fi
-
- # Enter the PhantomJS build directory if not already there.
- if [[ ! "${PWD}" = "${RECEIVER_BUILD_DIRECTORY}/phantomjs" ]] ; then
- echo -e "\e[94m Entering the PhantomJS Git repository directory...\e[97m"
- cd ${RECEIVER_BUILD_DIRECTORY}/phantomjs 2>&1
- fi
-
- # Checkout the proper branch then init and update the submodules.
- echo -e "\e[94m Checking out the branch ${PHANTOMJS_VERSION}...\e[97m"
- echo -e ""
- git checkout ${PHANTOMJS_VERSION} 2>&1
- echo -e ""
- echo -e "\e[94m Initializing Git submodules...\e[97m"
- echo -e ""
- git submodule init 2>&1
- echo -e ""
- echo -e "\e[94m Updating Git submodules...\e[97m"
- echo -e ""
- git submodule update 2>&1
- echo -e ""
-
- # Compile and link the code.
- if [[ "${CPU_ARCHITECTURE}" = "armv7l" ]] || [[ "${CPU_ARCHITECTURE}" = "armv6l" ]] || [[ "${CPU_ARCHITECTURE}" = "aarch64" ]] ; then
- # Limit the amount of processors being used on Raspberry Pi devices.
- # Not doing will very likely cause the compile to fail due to an out of memory error.
- echo -e "\e[94m Building PhantomJS... \(Job will be limited to using 1 processor.\)\e[97m"
- python build.py -j 1 2>&1
- else
- echo -e "\e[94m Building PhantomJS...\e[97m"
- python build.py 2>&1
- fi
- echo -e ""
-
- # Test that the binary was built properly.
- if [[ ! -f "bin/pahntomjs" ]] || [[ ! "`bin/phantomjs --version`" = "${PHANTOMJS_VERSION}" ]] ; then
- # If the dump978 binaries could not be found halt setup.
- echo -e ""
- echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
- echo -e " THE PHANTOMJS BINARIES BUILD APPEARS TO HAVE FAILED."
- echo -e " SETUP HAS BEEN TERMINATED!"
- echo -e ""
- echo -e "\e[93mThe PhantomJS binary appear to have not been built successfully..\e[39m"
- echo -e ""
- echo -e "\e[93m ------------------------------------------------------------------------------\e[96m"
- echo -e "\e[92m AboveTustin setup halted.\e[39m"
- echo -e ""
- read -p "Press enter to continue..." CONTINUE
- exit 1
- fi
-
- # Move the binary into the /usr/bin directory and make it executable.
- echo -e "\e[94m Copying the PhantomJS binary into the directory /usr/bin...\e[97m"
- sudo cp -v bin/phantomjs /usr/bin 2>&1
- echo ""
- echo -e "\e[94m Making the file /usr/bin/phantomjs executable...\e[97m"
- sudo chmod -v +x /usr/bin/phantomjs 2>&1
-
- fi
-fi
-
-## INSTALL THE NEEDED PYTHON MODULES
-
-echo -e ""
-echo -e "\e[95m Setting up the required Python modules...\e[97m"
-echo -e ""
-
-# Upgrade pip.
-echo -e "\e[94m Upgrading pip...\e[97m"
-echo -e ""
-sudo pip3 install --upgrade pip 2>&1
-echo -e ""
-echo -e "\e[94m Upgrading virtualenv...\e[97m"
-echo -e ""
-sudo pip3 install --upgrade virtualenv 2>&1
-echo -e ""
-
-# Install Python modules.
-echo -e "\e[94m Installing the selenium Python module...\e[97m"
-echo -e ""
-sudo pip3 install selenium 2>&1
-echo -e ""
-echo -e "\e[94m Installing the twitter Python module...\e[97m"
-echo -e ""
-sudo pip3 install twitter 2>&1
-echo -e ""
-echo -e "\e[94m Installing the python-dateutil Python module...\e[97m"
-echo -e ""
-sudo pip3 install python-dateutil 2>&1
-echo -e ""
-
-## DOWNLOAD SOURCE
-
-echo -e "\e[95m Downloading and configuring AboveTustin...\e[97m"
-echo -e ""
-
-echo -e "\e[94m Checking if the Git repository has been cloned...\e[97m"
-if [[ -d "${RECEIVER_BUILD_DIRECTORY}/abovetustin/AboveTustin" ]] && [[ -d "${RECEIVER_BUILD_DIRECTORY}/abovetustin/AboveTustin/.git" ]] ; then
- # A directory with a git repository containing the source code already exists.
- echo -e "\e[94m Entering the local AboveTustin git repository directory...\e[97m"
- cd ${RECEIVER_BUILD_DIRECTORY}/abovetustin/AboveTustin 2>&1
- echo -e ""
- echo -e "\e[94m Updating the local AboveTustin git repository...\e[97m"
- echo ""
- git pull 2>&1
- echo -e ""
-else
- # A directory containing the source code does not exist in the build directory.
- echo -e "\e[94m Entering the AboveTustin build directory...\e[97m"
- cd ${RECEIVER_BUILD_DIRECTORY}/abovetustin 2>&1
- if [[ -d "${RECEIVER_BUILD_DIRECTORY}/abovetustin/AboveTustin" ]] ; then
- echo -e "\e[94m Removing old build directory...\e[97m"
- rm -vrf "${RECEIVER_BUILD_DIRECTORY}/abovetustin/AboveTustin" 2>&1
- echo -e ""
- fi
- echo -e "\e[94m Cloning the AboveTustin git repository locally...\e[97m"
- echo -e ""
- git clone https://github.com/kevinabrandon/AboveTustin.git "${RECEIVER_BUILD_DIRECTORY}/abovetustin/AboveTustin" 2>&1
- echo -e ""
-fi
-
-if [[ ! "${PWD}" = "${RECEIVER_BUILD_DIRECTORY}/abovetustin/AboveTustin" ]] ; then
- echo -e "\e[94m Entering the AboveTustin git repository directory...\e[97m"
- cd ${RECEIVER_BUILD_DIRECTORY}/abovetustin/AboveTustin 2>&1
-fi
-
-## BUILD AND INSTALL
-
-## APPLY CONFIGURATION
-
-# Copy the file config.sample.ini to config.ini
-if [[ -s "${RECEIVER_BUILD_DIRECTORY}/abovetustin/AboveTustin/config.ini" ]] ; then
- echo -e "\e[94m Found existing configuration file config.ini...\e[97m"
-elif [[ -s "${RECEIVER_BUILD_DIRECTORY}/abovetustin/AboveTustin/config.sample.ini" ]] ; then
- echo -e "\e[94m Copying the file config.sample.ini to the file config.ini...\e[97m"
- echo ""
- cp -v ${RECEIVER_BUILD_DIRECTORY}/abovetustin/AboveTustin/config.sample.ini ${RECEIVER_BUILD_DIRECTORY}/abovetustin/AboveTustin/config.ini 2>&1
- echo ""
-else
- echo -e "\e[94m Unable to install configuration file config.ini...\e[97m"
-fi
-
-# Write out the supplied values to the file config.ini.
-if [[ -n "${TWITTER_ACCESS_TOKEN}" ]] ; then
- echo -e "\e[94m Writing Twitter token value to the config.ini file...\e[97m"
- ChangeConfig access_token ${TWITTER_ACCESS_TOKEN} "${RECEIVER_BUILD_DIRECTORY}/abovetustin/AboveTustin/config.ini"
-fi
-if [[ -n "${TWITTER_ACCESS_TOKEN_SECRET}" ]] ; then
- echo -e "\e[94m Writing Twitter token secret value to the config.ini file...\e[97m"
- ChangeConfig access_token_secret ${TWITTER_ACCESS_TOKEN_SECRET} "${RECEIVER_BUILD_DIRECTORY}/abovetustin/AboveTustin/config.ini"
-fi
-if [[ -n "${TWITTER_CONSUMER_KEY}" ]] ; then
- echo -e "\e[94m Writing Twitter consumer key value to the config.ini file...\e[97m"
- ChangeConfig consumer_key ${TWITTER_CONSUMER_KEY} "${RECEIVER_BUILD_DIRECTORY}/abovetustin/AboveTustin/config.ini"
-fi
-if [[ -n "${TWITTER_CONSUMER_SECRET}" ]] ; then
- echo -e "\e[94m Writing Twitter consumer secret to the config.ini file...\e[97m"
- ChangeConfig consumer_secret ${TWITTER_CONSUMER_SECRET} "${RECEIVER_BUILD_DIRECTORY}/abovetustin/AboveTustin/config.ini"
-fi
-if [[ -n "${TIME_ZONE_ESCAPED}" ]] ; then
- echo -e "\e[94m Writing receiver timezone to the config.ini file...\e[97m"
- ChangeConfig time_zone ${TIME_ZONE_ESCAPED} "${RECEIVER_BUILD_DIRECTORY}/abovetustin/AboveTustin/config.ini"
-fi
-if [[ -n "${RECEIVER_LATITUDE}" ]] ; then
- echo -e "\e[94m Writing receiver latitude to the config.ini file...\e[97m"
- ChangeConfig latitude ${RECEIVER_LATITUDE} "${RECEIVER_BUILD_DIRECTORY}/abovetustin/AboveTustin/config.ini"
-fi
-if [[ -n "${RECEIVER_LONGITUDE}" ]] ; then
- echo -e "\e[94m Writing receiver longitude to the config.ini file...\e[97m"
- ChangeConfig longitude ${RECEIVER_LONGITUDE} "${RECEIVER_BUILD_DIRECTORY}/abovetustin/AboveTustin/config.ini"
-fi
-
-# Quick fix to remove quotes from config.
-sed -e 's/= "/= /g' -e 's/"$//g' -i "${RECEIVER_BUILD_DIRECTORY}/abovetustin/AboveTustin/config.ini" 2>&1
-
-## CREATE SCRIPTS
-
-# Add the run_tracker.sh script to /etc/rc.local so it is executed at boot up.
-echo -e "\e[94m Checking if the AboveTustin startup line is contained within the file /etc/rc.local...\e[97m"
-if [[ `grep -cFx "${RECEIVER_BUILD_DIRECTORY}/abovetustin/AboveTustin/run_tracker.sh &" /etc/rc.local` -eq 0 ]] ; then
- echo -e "\e[94m Adding the AboveTustin startup line to the file /etc/rc.local...\e[97m"
- lnum=($(sed -n '/exit 0/=' /etc/rc.local))
- ((lnum>0)) && sudo sed -i "${lnum[$((${#lnum[@]}-1))]}i ${RECEIVER_BUILD_DIRECTORY}/abovetustin/AboveTustin/run_tracker.sh &\n" /etc/rc.local
-fi
-
-## START SCRIPTS
-
-echo -e ""
-echo -e "\e[95m Starting AboveTustin...\e[97m"
-echo -e ""
-
-# Kill any currently running AboveTustin related processes.
-echo -e "\e[94m Checking for any running AboveTustin processes...\e[97m"
-if [[ $(ps -aux | grep '[r]un_tracker.sh' | awk '{print $2}') ]]; then
- echo -e "\e[94m Killing the current run_tracker.sh process...\e[97m"
- sudo kill -9 $(ps -aux | grep '[r]un_tracker.sh' | awk '{print $2}') &> /dev/null
-fi
-if [[ $(ps -aux | grep '[t]racker.py' | awk '{print $2}') ]]; then
- echo -e "\e[94m Killing the current tracker.py process...\e[97m"
- sudo kill -9 $(ps -aux | grep '[t]racker.py' | awk '{print $2}') &> /dev/null
-fi
-if [[ $(ps -aux | grep '[p]hantomjs' | awk '{print $2}') ]]; then
- echo -e "\e[94m Killing the current phantomjs process...\e[97m"
- sudo kill -9 $(ps -aux | grep '[p]hantomjs' | awk '{print $2}') &> /dev/null
-fi
-
-# Start the run_tracker.sh script.
-echo -e "\e[94m Executing the run_tracker.sh script...\e[97m"
-sudo nohup ${RECEIVER_BUILD_DIRECTORY}/abovetustin/AboveTustin/run_tracker.sh > /dev/null 2>&1 &
-
-## SETUP COMPLETE
-
-# Return to the project root directory.
-echo -e "\e[94m Entering the ADS-B Receiver Project root directory...\e[97m"
-cd ${RECEIVER_ROOT_DIRECTORY} 2>&1
-
-echo -e ""
-echo -e "\e[93m ------------------------------------------------------------------------------"
-echo -e "\e[92m AboveTustin setup is complete.\e[39m"
-echo -e ""
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]]; then
- read -p "Press enter to continue..." CONTINUE
-fi
-
-exit 0
diff --git a/bash/extras/beastsplitter.sh b/bash/extras/beastsplitter.sh
index 97cb671c..42cc16ef 100755
--- a/bash/extras/beastsplitter.sh
+++ b/bash/extras/beastsplitter.sh
@@ -9,7 +9,7 @@
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
-# Copyright (c) 2015-2016 Joseph A. Prochazka #
+# Copyright (c) 2015-2024 Joseph A. Prochazka #
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy #
# of this software and associated documentation files (the "Software"), to deal #
@@ -31,119 +31,59 @@
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-## SET INSTALLATION VARIABLES
-
-RECEIVER_ROOT_DIRECTORY="${PWD}"
-RECEIVER_BASH_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/bash"
-RECEIVER_BUILD_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/build"
-
-## INCLUDE EXTERNAL SCRIPTS
-
source ${RECEIVER_BASH_DIRECTORY}/variables.sh
source ${RECEIVER_BASH_DIRECTORY}/functions.sh
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] && [[ -s "${RECEIVER_CONFIGURATION_FILE}" ]] ; then
- source ${RECEIVER_CONFIGURATION_FILE}
-fi
-
## BEGIN SETUP
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- clear
- echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
-fi
+clear
+echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
echo -e ""
echo -e "\e[92m Setting up beast-splitter..."
echo -e "\e[93m ------------------------------------------------------------------------------\e[96m"
echo -e ""
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Beast-Splitter Setup" --yesno "beast-splitter is a helper utility for the Mode-S Beast.\n\nThe Beast provides a single data stream over a (USB) serial port. If you have more than one thing that wants to read that data stream, you need something to redistribute the data. This is what beast-splitter does.\n\n https://github.com/flightaware/beast-splitter\n\nContinue beast-splitter setup?" 15 78
- if [[ $? -eq 1 ]] ; then
- # Setup has been halted by the user.
- echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
- echo -e " Setup has been halted at the request of the user."
- echo -e ""
- echo -e "\e[93m ------------------------------------------------------------------------------\e[96m"
- echo -e "\e[92m beast-splitter setup halted.\e[39m"
- echo -e ""
- read -p "Press enter to continue..." CONTINUE
- exit 1
- fi
+whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Beast-Splitter Setup" --yesno "beast-splitter is a helper utility for the Mode-S Beast.\n\nThe Beast provides a single data stream over a (USB) serial port. If you have more than one thing that wants to read that data stream, you need something to redistribute the data. This is what beast-splitter does.\n\n https://github.com/flightaware/beast-splitter\n\nContinue beast-splitter setup?" 15 78
+if [[ $? -eq 1 ]] ; then
+ # Setup has been halted by the user.
+ echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
+ echo -e " Setup has been halted at the request of the user."
+ echo -e ""
+ echo -e "\e[93m ------------------------------------------------------------------------------\e[96m"
+ echo -e "\e[92m beast-splitter setup halted.\e[39m"
+ echo -e ""
+ read -p "Press enter to continue..." CONTINUE
+ exit 1
fi
-echo -e "\e[95m Setting up beast-splitter on this device...\e[97m"
-echo -e ""
-
-## ENABLE THE USE OF /ETC/RC.LOCAL IF THE FILE DOES NOT EXIST
+## GATHER CONFIGURATION OPTIONS
-if [ ! -f /etc/rc.local ]; then
- echo ""
- echo -e "\e[95m Enabling the use of the /etc/rc.local file...\e[97m"
- echo ""
-
- # In Debian Stretch /etc/rc.local has been removed.
- # However at this time we can bring this file back into play.
- # As to if in future releases this will work remains to be seen...
-
- echo -e "\e[94m Creating the file /etc/rc.local...\e[97m"
- sudo tee /etc/rc.local > /dev/null <&1 1>&2 2>&3)
+output_options=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Output Options for Beast Splitter" --nocancel --inputbox "Enter the option to tell Beast Splitter where to send output data. You can do so by establishing an outgoing connection or accepting inbound connections.\\Examples:\n--connect remotehost:remoteport\n --listen remotehost:remoteport" 8 78 3>&1 1>&2 2>&3)
## CHECK FOR PREREQUISITE PACKAGES
-# Check that the required packages are installed.
+echo -e "\e[95m Checking that the required packages are installed...\e[97m"
+echo -e ""
CheckPackage build-essential
CheckPackage debhelper
CheckPackage libboost-system-dev
CheckPackage libboost-program-options-dev
CheckPackage libboost-regex-dev
-CheckPackage dh-systemd
-
-## CONFIRM SETTINGS
-
-# Confirm settings with user.
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- # Ask the beast-splitter listen port.
- BEASTSPLITTER_LISTEN_PORT_TITLE="Listen Port"
- while [[ -z "${BEASTSPLITTER_LISTEN_PORT}" ]] ; do
- BEASTSPLITTER_LISTEN_PORT=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${BEASTSPLITTER_LISTEN_PORT_TITLE}" --nocancel --inputbox "\nPlease enter the port beast-splitter will listen on.\nThis must be a port which is currently not in use." 10 78 "30005" 3>&1 1>&2 2>&3)
- BEASTSPLITTER_LISTEN_PORT_TITLE="Listen Port (REQUIRED)"
- done
- # Ask the beast-splitter connect port.
- BEASTSPLITTER_CONNECT_PORT_TITLE="Connect Port"
- while [[ -z "${BEASTSPLITTER_CONNECT_PORT}" ]] ; do
- BEASTSPLITTER_CONNECT_PORT=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${BEASTSPLITTER_CONNECT_PORT_TITLE}" --nocancel --inputbox "\nPlease enter the port beast-splitter will connect to.\nThis is generally port 30104 on dump1090." 10 78 "30104" 3>&1 1>&2 2>&3)
- BEASTSPLITTER_CONNECT_PORT_TITLE="Connect Port (REQUIRED)"
- done
-fi
+echo ""
## DOWNLOAD SOURCE
-echo -e ""
-echo -e "\e[95m Downloading and configuring beast-splitter...\e[97m"
+echo -e "\e[95m Downloading the beast-splitter repository from GitHub...\e[97m"
echo -e ""
-echo -e "\e[94m Checking if the Git repository has been cloned...\e[97m"
-if [[ -d "${RECEIVER_BUILD_DIRECTORY}/beast-splitter/beast-splitter" ]] && [[ -d "${RECEIVER_BUILD_DIRECTORY}/beast-splitter/beast-splitter/.git" ]] ; then
+echo -e "\e[94m Checking if the Git repository has already been cloned...\e[97m"
+if [[ -d ${RECEIVER_BUILD_DIRECTORY}/beast-splitter/beast-splitter && -d ${RECEIVER_BUILD_DIRECTORY}/beast-splitter/beast-splitter/.git ]] ; then
# A directory with a git repository containing the source code already exists.
echo -e "\e[94m Entering the local beast-splitter git repository directory...\e[97m"
cd ${RECEIVER_BUILD_DIRECTORY}/beast-splitter/beast-splitter 2>&1
@@ -162,86 +102,47 @@ else
echo -e ""
git clone https://github.com/flightaware/beast-splitter.git 2>&1
fi
+echo ""
## BUILD AND INSTALL
-echo -e ""
echo -e "\e[95m Building and installing the beast-splitter package...\e[97m"
echo -e ""
-if [[ ! ${PWD} = ${RECEIVER_BUILD_DIRECTORY}/beast-splitter/beast-splitter ]] ; then
- echo -e "\e[94m Entering the beast-splitter git repository directory...\e[97m"
- cd ${RECEIVER_BUILD_DIRECTORY}/beast-splitter/beast-splitter 2>&1
-fi
+
+echo -e "\e[94m Entering the beast-splitter git repository directory...\e[97m"
+cd ${RECEIVER_BUILD_DIRECTORY}/beast-splitter/beast-splitter 2>&1
+
echo -e "\e[94m Executing the beast-splitter build script...\e[97m"
echo -e ""
dpkg-buildpackage -b 2>&1
echo -e ""
+
echo -e "\e[94m Entering the beast-splitter build directory...\e[97m"
cd ${RECEIVER_BUILD_DIRECTORY}/beast-splitter 2>&1
+
echo -e "\e[94m Installing the beast-splitter package...\e[97m"
echo ""
sudo dpkg -i beast-splitter_*.deb 2>&1
echo ""
-if [[ ! -d "${RECEIVER_BUILD_DIRECTORY}/package-archive" ]] ; then
- # Create binary package archive directory.
+# Archive binary package.
+if [[ ! -d ${RECEIVER_BUILD_DIRECTORY}/package-archive ]] ; then
echo -e "\e[94m Creating package archive directory...\e[97m"
echo ""
- mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/package-archive 2>&1
+ mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/package-archive 2>&1
echo ""
fi
-
-# Archive binary package.
echo -e "\e[94m Moving the beast-splitter package into the archive directory...\e[97m"
echo ""
-cp -vf ${RECEIVER_BUILD_DIRECTORY}/beast-splitter/*.deb ${RECEIVER_BUILD_DIRECTORY}/package-archive/ 2>&1
-echo ""
-
-## CREATE SCRIPTS
-
-echo -e "\e[94m Creating the file beast-splitter_maint.sh...\e[97m"
-tee ${RECEIVER_BUILD_DIRECTORY}/beast-splitter/beast-splitter_maint.sh > /dev/null <&1
+cp -vp ${RECEIVER_BUILD_DIRECTORY}/beast-splitter/*.deb ${RECEIVER_BUILD_DIRECTORY}/package-archive/ 2>&1
echo ""
-echo -e "\e[94m Checking if the beast-splitter startup line is contained within the file /etc/rc.local...\e[97m"
-if [[ `grep -cFx "${RECEIVER_BUILD_DIRECTORY}/beast-splitter/beast-splitter_maint.sh &" /etc/rc.local` -eq 0 ]] ; then
- echo -e "\e[94m Adding the beast-splitter startup line to the file /etc/rc.local...\e[97m"
- lnum=($(sed -n '/exit 0/=' /etc/rc.local))
- ((lnum>0)) && sudo sed -i "${lnum[$((${#lnum[@]}-1))]}i ${RECEIVER_BUILD_DIRECTORY}/beast-splitter/beast-splitter_maint.sh &\n" /etc/rc.local
-fi
-
-## START SCRIPTS
+## CONFIGURE BEAST SPLITTER
-echo -e ""
-echo -e "\e[95m Starting beast-splitter...\e[97m"
-echo -e ""
-
-# Kill any currently running instances.
-echo -e "\e[94m Checking for any running beast-splitter processes...\e[97m"
-if [[ $(ps -aux | grep '[b]east-splitter_maint.sh' | awk '{print $2}') ]]; then
- echo -e "\e[94m Killing the current beast-splitter_maint.sh process...\e[97m"
- sudo kill -9 $(ps -aux | grep '[b]east-splitter_maint.sh' | awk '{print $2}') &> /dev/null
-fi
-if [[ $(ps -aux | grep '[b]east-splitter' | awk '{print $2}') ]]; then
- echo -e "\e[94m Killing the current beast-splitter process...\e[97m"
- sudo kill -9 $(ps -aux | grep '[b]east-splitter' | awk '{print $2}') &> /dev/null
-fi
-
-# Start the beast-splitter_maint.sh script.
-echo -e "\e[94m Executing the beast-splitter script...\e[97m"
-echo -e ""
-sudo nohup ${RECEIVER_BUILD_DIRECTORY}/beast-splitter/beast-splitter_maint.sh > /dev/null 2>&1 &
+echo -e "\e[94m Configuring beast-splitter...\e[97m"
+ChangeConfig "ENABLED" $enabled "/etc/default/beast-splitter"
+ChangeConfig "INPUT_OPTIONS" $input_options "/etc/default/beast-splitter"
+ChangeConfig "OUTPUT_OPTIONS" $output_options "/etc/default/beast-splitter"
## SETUP COMPLETE
diff --git a/bash/extras/duckdns.sh b/bash/extras/duckdns.sh
index eb2f7739..3698fa38 100755
--- a/bash/extras/duckdns.sh
+++ b/bash/extras/duckdns.sh
@@ -9,7 +9,7 @@
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
-# Copyright (c) 2015-2016 Joseph A. Prochazka #
+# Copyright (c) 2015-2024 Joseph A. Prochazka #
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy #
# of this software and associated documentation files (the "Software"), to deal #
@@ -31,44 +31,30 @@
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-## SET INSTALLATION VARIABLES
-
-RECEIVER_ROOT_DIRECTORY="${PWD}"
-RECEIVER_BASH_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/bash"
-RECEIVER_BUILD_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/build"
-
## INCLUDE EXTERNAL SCRIPTS
source ${RECEIVER_BASH_DIRECTORY}/variables.sh
source ${RECEIVER_BASH_DIRECTORY}/functions.sh
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] && [[ -s "${RECEIVER_CONFIGURATION_FILE}" ]] ; then
- source ${RECEIVER_CONFIGURATION_FILE}
-fi
-
## BEGIN SETUP
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- clear
- echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
-fi
+clear
+echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
echo ""
echo -e "\e[92m Setting up Duck DNS..."
echo -e "\e[93m ------------------------------------------------------------------------------\e[96m"
echo ""
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Duck DNS Dynamic DNS" --yesno "Duck DNS is a free dynamic DNS service hosted on Amazon VPC.\n\nPLEASE NOTE:\n\nBefore continuing this setup it is recommended that you visit the Duck DNS website and signup for then setup a sub domain which will be used by this device. You will need both the domain and token supplied to you after setting up your account.\n\n http://www.duckdns.org\n\nContinue with Duck DNS update script setup?" 18 78
- if [[ $? -eq 1 ]] ; then
- # Setup has been halted by the user.
- echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
- echo -e " Setup has been halted at the request of the user."
- echo ""
- echo -e "\e[93m ------------------------------------------------------------------------------\e[96m"
- echo -e "\e[92m Duck DNS setup halted.\e[39m"
- echo ""
- read -p "Press enter to continue..." CONTINUE
- exit 1
- fi
+whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Duck DNS Dynamic DNS" --yesno "Duck DNS is a free dynamic DNS service hosted on Amazon VPC.\n\nPLEASE NOTE:\n\nBefore continuing this setup it is recommended that you visit the Duck DNS website and signup for then setup a sub domain which will be used by this device. You will need both the domain and token supplied to you after setting up your account.\n\n http://www.duckdns.org\n\nContinue with Duck DNS update script setup?" 18 78
+if [[ $? -eq 1 ]] ; then
+ # Setup has been halted by the user.
+ echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
+ echo -e " Setup has been halted at the request of the user."
+ echo ""
+ echo -e "\e[93m ------------------------------------------------------------------------------\e[96m"
+ echo -e "\e[92m Duck DNS setup halted.\e[39m"
+ echo ""
+ read -p "Press enter to continue..." CONTINUE
+ exit 1
fi
echo -e "\e[95m Setting up Duck DNS on this device...\e[97m"
@@ -77,29 +63,27 @@ echo ""
## CHECK FOR PREREQUISITE PACKAGES
# Check that the required packages are installed.
-echo ""
echo -e "\e[95m Installing packages needed to build and fulfill dependencies...\e[97m"
echo ""
CheckPackage cron
CheckPackage curl
+exho ""
## CONFIRM SETTINGS
-# Confirm settings with user.
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- # Ask for the user sub domain to be assigned to this device.
- DUCKDNS_DOMAIN_TITLE="Duck DNS Sub Domain"
- while [[ -z "${DUCKDNS_DOMAIN}" ]] ; do
- DUCKDNS_DOMAIN=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${DUCKDNS_DOMAIN_TITLE}" --nocancel --inputbox "\nPlease enter the Duck DNS sub domain you selected after registering.\nIf you do not have one yet visit http://www.ducknds.org to obtain one." 9 78 3>&1 1>&2 2>&3)
- DUCKDNS_DOMAIN_TITLE="Duck DNS Sub Domain (REQUIRED)"
- done
- # Ask for the Duck DNS token to be assigned to this receiver.
- DUCKDNS_TOKEN_TITLE="Duck DNS Token"
- while [[ -z "${DUCKDNS_TOKEN}" ]] ; do
- DUCKDNS_TOKEN=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${DUCKDNS_TOKEN_TITLE}" --nocancel --inputbox "\nPlease enter your Duck DNS token." 8 78 3>&1 1>&2 2>&3)
- DUCKDNS_TOKEN_TITLE="Duck DNS Token (REQUIRED)"
- done
-fi
+# Ask for the user sub domain to be assigned to this device.
+DUCKDNS_DOMAIN_TITLE="Duck DNS Sub Domain"
+while [[ -z "${DUCKDNS_DOMAIN}" ]] ; do
+ DUCKDNS_DOMAIN=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${DUCKDNS_DOMAIN_TITLE}" --nocancel --inputbox "\nPlease enter the Duck DNS sub domain you selected after registering.\nIf you do not have one yet visit http://www.ducknds.org to obtain one." 9 78 3>&1 1>&2 2>&3)
+ DUCKDNS_DOMAIN_TITLE="Duck DNS Sub Domain (REQUIRED)"
+done
+
+# Ask for the Duck DNS token to be assigned to this receiver.
+DUCKDNS_TOKEN_TITLE="Duck DNS Token"
+while [[ -z "${DUCKDNS_TOKEN}" ]] ; do
+ DUCKDNS_TOKEN=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${DUCKDNS_TOKEN_TITLE}" --nocancel --inputbox "\nPlease enter your Duck DNS token." 8 78 3>&1 1>&2 2>&3)
+ DUCKDNS_TOKEN_TITLE="Duck DNS Token (REQUIRED)"
+done
## PROJECT BUILD DIRECTORY
@@ -117,9 +101,7 @@ if [[ ! -d ${RECEIVER_BUILD_DIRECTORY}/duckdns ]] ; then
echo ""
fi
-## DOWNLOAD SOURCE
-
-## BUILD AND INSTALL
+## CREATE SCRIPT
# Create then set permissions on the file duck.sh.
echo -e "\e[94m Creating the Duck DNS update script...\e[97m"
@@ -132,7 +114,7 @@ echo ""
chmod -v 700 ${RECEIVER_BUILD_DIRECTORY}/duckdns/duck.sh 2>&1
echo ""
-## CREATE SCRIPTS
+## ADD TO CRON
echo -e "\e[94m Adding the DuckDNS cron file...\e[97m"
sudo tee /etc/cron.d/duckdns_ip_address_update > /dev/null <&1
sudo kill -9 ${PIDS} 2>&1
+ echo ""
fi
unset PIDS
done
@@ -175,9 +158,7 @@ echo ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m Duck DNS setup is complete.\e[39m"
echo ""
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- read -p "Press enter to continue..." CONTINUE
-fi
+read -p "Press enter to continue..." CONTINUE
exit 0
diff --git a/bash/feeders/adsbexchange.sh b/bash/feeders/adsbexchange.sh
index 8a95ed40..a023235b 100755
--- a/bash/feeders/adsbexchange.sh
+++ b/bash/feeders/adsbexchange.sh
@@ -9,7 +9,7 @@
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
-# Copyright (c) 2016-2018, Joseph A. Prochazka #
+# Copyright (c) 2016-2024, Joseph A. Prochazka #
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy #
# of this software and associated documentation files (the "Software"), to deal #
@@ -31,335 +31,67 @@
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-## VARIABLES
-
-RECEIVER_ROOT_DIRECTORY="${PWD}"
-RECEIVER_BASH_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/bash"
-RECEIVER_BUILD_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/build"
-
### INCLUDE EXTERNAL SCRIPTS
source ${RECEIVER_BASH_DIRECTORY}/variables.sh
source ${RECEIVER_BASH_DIRECTORY}/functions.sh
-# Source the automated install configuration file if this is an automated installation.
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] ; then
- source ${RECEIVER_CONFIGURATION_FILE}
-fi
-
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- clear
- echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
-fi
+clear
+echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
echo -e ""
echo -e "\e[92m Setting up the ADS-B Exchange feed..."
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------\e[96m"
echo -e ""
-
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- # Interactive install.
- CONTINUE_SETUP=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "ADS-B Exchange Feed Setup" --yesno "ADS-B Exchange is a co-op of ADS-B/Mode S/MLAT feeders from around the world, and the world’s largest source of unfiltered flight data.\n\n http://www.adsbexchange.com/how-to-feed/\n\nContinue setting up the ADS-B Exchange feed?" 12 78 3>&1 1>&2 2>&3)
- if [[ ${CONTINUE_SETUP} -eq 1 ]] ; then
- # Setup has been halted by the user.
- echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
- echo -e " Setup has been halted at the request of the user."
- echo -e ""
- echo -e "\e[93m ------------------------------------------------------------------------------"
- echo -e "\e[92m ADS-B Exchange feed setup halted.\e[39m"
- echo -e ""
- read -p "Press enter to continue..." CONTINUE
- exit 1
- fi
-else
- # Warn that automated installation is not supported.
- echo -e "\e[92m Automated installation of this script is not yet supported...\e[39m"
- echo -e ""
- exit 1
-fi
-
-## ENABLE THE USE OF /ETC/RC.LOCAL IF THE FILE DOES NOT EXIST
-
-if [ ! -f /etc/rc.local ]; then
- echo ""
- echo -e "\e[95m Enabling the use of the /etc/rc.local file...\e[97m"
- echo ""
-
- # In Debian Stretch /etc/rc.local has been removed.
- # However at this time we can bring this file back into play.
- # As to if in future releases this will work remains to be seen...
-
- echo -e "\e[94m Creating the file /etc/rc.local...\e[97m"
- sudo tee /etc/rc.local > /dev/null <&1
- sudo kill -9 ${PIDS} 2>&1
- echo -e ""
- fi
- # Remove the old line from /etc/rc.local.
- echo -e "\e[94m Removing the old adsbexchange--maint.sh startup line from /etc/rc.local...\e[97m"
- sudo sed -i '/$RECEIVER_BUILD_DIRECTORY\/adsbexchange\/adsbexchange-maint.sh &'/d /etc/rc.local 2>&1
-fi
-
-# Remove the depreciated adsbexchange-netcat_maint.sh script.
-echo -e "\e[94m Checking if the netcat startup line is contained within the file /etc/rc.local...\e[97m"
-if [ ! -z $(grep "$RECEIVER_BUILD_DIRECTORY/adsbexchange/adsbexchange-netcat_maint.sh" "/etc/rc.local") ]; then
- # Kill any currently running instances of the adsbexchange-netcat_maint.sh script.
- echo -e "\e[94m Checking for any running adsbexchange-netcat_maint.sh processes...\e[97m"
- if [[ $(ps -aux | grep '[a]dsbexchange-netcat_maint.sh' | awk '{print $2}') ]]; then
- echo -e "\e[94m Killing the current adsbexchange-netcat_maint.sh process...\e[97m"
- sudo kill -9 $(ps -aux | grep '[a]dsbexchange-netcat_maint.sh' | awk '{print $2}') &> /dev/null
- fi
- if [[ $(ps -aux | grep '[f]eed.adsbexchange.com' | awk '{print $2}') ]]; then
- echo -e "\e[94m Killing the current feed.adsbexchange.com process...\e[97m"
- sudo kill -9 $(ps -aux | grep '[f]eed.adsbexchange.com' | awk '{print $2}') &> /dev/null
- fi
- # Remove the depreciated netcat script start up line.
- if [ -f /etc/rc.local ]; then
- echo -e "\e[94m Removing the netcat startup script line to the file /etc/rc.local...\e[97m"
- sudo sed -i '/$RECEIVER_BUILD_DIRECTORY\/adsbexchange\/adsbexchange-netcat_maint.sh &'/d /etc/rc.local 2>&1
- fi
-fi
-echo -e ""
-
-## CHECK FOR PREREQUISITE PACKAGES
-
-echo -e "\e[95m Installing packages needed to build and fulfill dependencies...\e[97m"
-echo -e ""
-CheckPackage curl
-CheckPackage build-essential
-CheckPackage debhelper
-CheckPackage python-dev
-CheckPackage python3-dev
-CheckPackage socat
-
-## DOWNLOAD OR UPDATE THE MLAT-CLIENT SOURCE
-
-echo ""
-echo -e "\e[95m Preparing the mlat-client Git repository...\e[97m"
-echo ""
-if [ -d $RECEIVER_BUILD_DIRECTORY/mlat-client/mlat-client ] && [ -d $RECEIVER_BUILD_DIRECTORY/mlat-client/mlat-client/.git ]; then
- # A directory with a git repository containing the source code already exists.
- echo -e "\e[94m Entering the mlat-client git repository directory...\e[97m"
- cd $RECEIVER_BUILD_DIRECTORY/mlat-client/mlat-client
- echo -e "\e[94m Updating the local mlat-client git repository...\e[97m"
- echo ""
- git pull
-else
- # A directory containing the source code does not exist in the build directory.
- echo -e "\e[94m Creating the mlat-client build directory...\e[97m"
- echo ""
- mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/mlat-client
- echo ""
- echo -e "\e[94m Entering the mlat-client build directory...\e[97m"
- cd ${RECEIVER_BUILD_DIRECTORY}/mlat-client 2>&1
- echo -e "\e[94m Cloning the mlat-client git repository locally...\e[97m"
- echo ""
- git clone https://github.com/mutability/mlat-client.git
-fi
-
-## BUILD AND INSTALL THE MLAT-CLIENT PACKAGE
-
-echo ""
-echo -e "\e[95m Building and installing the mlat-client package...\e[97m"
-echo ""
-if [ ! $PWD = $RECEIVER_BUILD_DIRECTORY/mlat-client/mlat-client ]; then
- echo -e "\e[94m Entering the mlat-client git repository directory...\e[97m"
- cd $RECEIVER_BUILD_DIRECTORY/mlat-client/mlat-client
-fi
-echo -e "\e[94m Building the mlat-client package...\e[97m"
-echo ""
-dpkg-buildpackage -b -uc
-echo ""
-echo -e "\e[94m Installing the mlat-client package...\e[97m"
-echo ""
-sudo dpkg -i $RECEIVER_BUILD_DIRECTORY/mlat-client/mlat-client_${MLATCLIENTVERSION}*.deb
-
-# Check that the mlat-client package was installed successfully.
-echo ""
-echo -e "\e[94m Checking that the mlat-client package was installed properly...\e[97m"
-if [ $(dpkg-query -W -f='${STATUS}' mlat-client 2>/dev/null | grep -c "ok installed") -eq 0 ]; then
- # If the mlat-client package could not be installed halt setup.
- echo ""
+CONTINUE_SETUP=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "ADS-B Exchange Feed Setup" --yesno "ADS-B Exchange is a co-op of ADS-B/Mode S/MLAT feeders from around the world, and the world’s largest source of unfiltered flight data.\n\n http://www.adsbexchange.com/how-to-feed/\n\nContinue setting up the ADS-B Exchange feed?" 18 78 3>&1 1>&2 2>&3)
+if [[ ${CONTINUE_SETUP} -eq 1 ]] ; then
+ # Setup has been halted by the user.
echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
- echo -e " UNABLE TO INSTALL A REQUIRED PACKAGE."
- echo -e " SETUP HAS BEEN TERMINATED!"
- echo ""
- echo -e "\e[93mThe package \"mlat-client\" could not be installed.\e[39m"
- echo ""
- echo -e "\e[93m----------------------------------------------------------------------------------------------------"
+ echo -e " Setup has been halted at the request of the user."
+ echo -e ""
+ echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m ADS-B Exchange feed setup halted.\e[39m"
- echo ""
+ echo -e ""
read -p "Press enter to continue..." CONTINUE
exit 1
fi
-# Create binary package archive directory.
-if [[ ! -d "${RECEIVER_BUILD_DIRECTORY}/package-archive" ]] ; then
- echo -e "\e[94m Creating package archive directory...\e[97m"
- echo -e ""
- mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/package-archive 2>&1
- echo -e ""
-fi
-
-# Archive binary package.
-echo -e "\e[94m Moving the mlat-client binary package into the archive directory...\e[97m"
-echo ""
-mv -vf ${RECEIVER_BUILD_DIRECTORY}/mlat-client/mlat-client_*.deb ${RECEIVER_BUILD_DIRECTORY}/package-archive 2>&1
+## DOWNLOAD AND EXECUTE THE INSTALL SCRIPT
-## CREATE THE SCRIPT TO EXECUTE AND MAINTAIN MLAT-CLIENT AND SOCAT TO FEED ADS-B EXCHANGE
+# Explain the process.
+whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "ADS-B Exchange Feed Setup" --msgbox "Scripts supplied by ADS-B Exchange will be used in order to install or upgrade this system. Interaction with the script exececuted will be required in order to complete the installation." 10 78
+echo -e "\e[95m Preparing to execute the ${ACTION_TO_PERFORM} script...\e[97m"
echo ""
-echo -e "\e[95m Creating maintenance for both the mlat-client and socat feeds...\e[97m"
-echo ""
-
-# Ask the user for the user name for this receiver.
-RECEIVER_NAME_TITLE="Receiver Name"
-while [[ -z $RECEIVER_NAME ]]; do
- RECEIVER_NAME=$(whiptail --backtitle "$ADSB_PROJECTTITLE" --backtitle "$BACKTITLETEXT" --title "$RECEIVER_NAME_TITLE" --nocancel --inputbox "\nPlease enter a name for this receiver.\n\nIf you have more than one receiver, this name should be unique.\nExample: \"username-01\", \"username-02\", etc." 12 78 3>&1 1>&2 2>&3)
- RECEIVER_NAME_TITLE="Receiver Name (REQUIRED)"
-done
-
-# Get the altitude of the receiver from the Google Maps API using the latitude and longitude assigned dump1090-mutability if it is installed.
-if [[ $(dpkg-query -W -f='${STATUS}' dump1090-mutability 2>/dev/null | grep -c "ok installed") -eq 1 ]]; then
- RECEIVER_LATITUDE=`GetConfig "LAT" "/etc/default/dump1090-mutability"`
- RECEIVER_LONGITUDE=`GetConfig "LON" "/etc/default/dump1090-mutability"`
-fi
-
-# Ask the user for the receivers altitude. (This will be prepopulated by the altitude returned from the Google Maps API.
-RECEIVER_ALTITUDE=$(whiptail --backtitle "$ADSB_PROJECTTITLE" --backtitle "$BACKTITLETEXT" --title "Receiver Altitude" --nocancel --inputbox "\nEnter your receiver's altitude." 9 78 "`curl -s https://maps.googleapis.com/maps/api/elevation/json?locations=$RECEIVER_LATITUDE,$RECEIVER_LONGITUDE | python -c \"import json,sys;obj=json.load(sys.stdin);print obj['results'][0]['elevation']\"`" 3>&1 1>&2 2>&3)
-
-# Create the adsbexchange directory in the build directory if it does not exist.
-echo -e "\e[94m Checking for the adsbexchange build directory...\e[97m"
-if [ ! -d "$RECEIVER_BUILD_DIRECTORY/adsbexchange" ]; then
- echo -e "\e[94m Creating the adsbexchange build directory...\e[97m"
- mkdir $RECEIVER_BUILD_DIRECTORY/adsbexchange
-fi
-
-echo -e "\e[94m Creating the file adsbexchange-socat_maint.sh...\e[97m"
-
-# Some distgros place socat in /usr/bin instead of /user/sbin..
-if [ -f "/usr/sbin/socat" ]; then
- SOCAT_PATH="/usr/sbin/socat"
-fi
-if [ -f "/usr/bin/socat" ]; then
- SOCAT_PATH="/usr/bin/socat"
-fi
-if [ -z $SOCAT_PATH ]; then
- echo -e ""
- echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
- echo -e " UNABLE TO LOCATE SOCAT."
- echo -e ""
- exit 1
-fi
-
-tee $RECEIVER_BUILD_DIRECTORY/adsbexchange/adsbexchange-socat_maint.sh > /dev/null < /dev/null <0)) && sudo sed -i "${lnum[$((${#lnum[@]}-1))]}i $RECEIVER_BUILD_DIRECTORY/adsbexchange/adsbexchange-socat_maint.sh &\n" /etc/rc.local
+# Create the build directory if needed then enter it.
+if [ ! -d "${RECEIVER_BUILD_DIRECTORY}/adsbexchange" ]; then
+ echo -e "\e[94m Creating the ADSBExchange build directory...\e[97m"
+ mkdir ${RECEIVER_BUILD_DIRECTORY}/adsbexchange
fi
+echo -e "\e[94m Entering the ADSBExchange build directory...\e[97m"
+cd ${RECEIVER_BUILD_DIRECTORY}/adsbexchange
-echo -e "\e[94m Checking if the mlat-client startup line is contained within the file /etc/rc.local...\e[97m"
-if ! grep -Fxq "$RECEIVER_BUILD_DIRECTORY/adsbexchange/adsbexchange-mlat_maint.sh &" /etc/rc.local; then
- echo -e "\e[94m Adding the mlat-client startup line to the file /etc/rc.local...\e[97m"
- lnum=($(sed -n '/exit 0/=' /etc/rc.local))
- ((lnum>0)) && sudo sed -i "${lnum[$((${#lnum[@]}-1))]}i $RECEIVER_BUILD_DIRECTORY/adsbexchange/adsbexchange-mlat_maint.sh &\n" /etc/rc.local
+# Determine if the feeder is already installed or not.
+ACTION_TO_PERFORM="install"
+if [[ -f /lib/systemd/system/adsbexchange-mlat.service && -f /lib/systemd/system/adsbexchange-feed.service ]]; then
+ ACTION_TO_PERFORM="upgrade"
fi
-## START THE MLAT-CLIENT AND SOCAT FEED
-
-echo ""
-echo -e "\e[95m Starting both the mlat-client and socat feeds...\e[97m"
+# Begin the install or upgrade process.
+echo -e "\e[94m Downloading the ${ACTION_TO_PERFORM} script...\e[97m"
echo ""
-
-# Kill any currently running instances of the adsbexchange-socat_maint.sh script.
-echo -e "\e[94m Checking for any running adsbexchange-socat_maint.sh processes...\e[97m"
-if [[ $(ps -aux | grep '[a]dsbexchange-socat_maint.sh' | awk '{print $2}') ]]; then
- echo -e "\e[94m Killing the current adsbexchange-socat_maint.sh process...\e[97m"
- sudo kill -9 $(ps -aux | grep '[a]dsbexchange-socat_maint.sh' | awk '{print $2}') &> /dev/null
-fi
-if [[ $(ps -aux | grep '[f]eed.adsbexchange.com' | awk '{print $2}') ]]; then
- echo -e "\e[94m Killing the current feed.adsbexchange.com process...\e[97m"
- sudo kill -9 $(ps -aux | grep '[f]eed.adsbexchange.com' | awk '{print $2}') &> /dev/null
-fi
-
-# Kill any currently running instances of the adsbexchange-mlat_maint.sh script.
-echo -e "\e[94m Checking for any running adsbexchange-mlat_maint.sh processes...\e[97m"
-if [[ $(ps -aux | grep '[a]dsbexchange-mlat_maint.sh' | awk '{print $2}') ]]; then
- echo -e "\e[94m Killing the current adsbexchange-mlat_maint.sh process...\e[97m"
- sudo kill -9 $(ps -aux | grep '[a]dsbexchange-mlat_maint.sh' | awk '{print $2}') &> /dev/null
-fi
-if [[ $(ps -aux | grep 'mlat-client' | awk '{print $2}') ]]; then
- echo -e "\e[94m Killing the current mlat-client process...\e[97m"
- sudo kill -9 $(ps -aux | grep '[m]lat-client' | awk '{print $2}') &> /dev/null
+if [[ "${ACTION_TO_PERFORM}" = "install" ]]; then
+ wget -O ${RECEIVER_BUILD_DIRECTORY}/adsbexchange/feed-${ACTION_TO_PERFORM}.sh https://www.adsbexchange.com/feed.sh
+else
+ wget -O ${RECEIVER_BUILD_DIRECTORY}/adsbexchange/feed-${ACTION_TO_PERFORM}.sh https://www.adsbexchange.com/feed-update.sh
fi
-echo -e "\e[94m Executing the adsbexchange-socat_maint.sh script...\e[97m"
-sudo nohup $RECEIVER_BUILD_DIRECTORY/adsbexchange/adsbexchange-socat_maint.sh > /dev/null 2>&1 &
-
-echo -e "\e[94m Executing the adsbexchange-mlat_maint.sh script...\e[97m"
-sudo nohup $RECEIVER_BUILD_DIRECTORY/adsbexchange/adsbexchange-mlat_maint.sh > /dev/null 2>&1 &
+echo -e "\e[94m Making the ${ACTION_TO_PERFORM} script executable...\e[97m"
+chmod -x ${RECEIVER_BUILD_DIRECTORY}/adsbexchange/feed-${ACTION_TO_PERFORM}.sh
+echo -e "\e[94m Executing the ${ACTION_TO_PERFORM} script...\e[97m"
+echo ""
+sudo bash ${RECEIVER_BUILD_DIRECTORY}/adsbexchange/feed-${ACTION_TO_PERFORM}.sh
## ADS-B EXCHANGE FEED SETUP COMPLETE
diff --git a/bash/feeders/adsbhub.sh b/bash/feeders/adsbhub.sh
deleted file mode 100755
index 0f9fb0d6..00000000
--- a/bash/feeders/adsbhub.sh
+++ /dev/null
@@ -1,189 +0,0 @@
-#!/bin/bash
-
-#####################################################################################
-# ADS-B RECEIVER #
-#####################################################################################
-# #
-# This script is not meant to be executed directly. #
-# Instead execute install.sh to begin the installation process. #
-# #
-# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-# #
-# Copyright (c) 2015-2018, Joseph A. Prochazka #
-# #
-# Permission is hereby granted, free of charge, to any person obtaining a copy #
-# of this software and associated documentation files (the "Software"), to deal #
-# in the Software without restriction, including without limitation the rights #
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell #
-# copies of the Software, and to permit persons to whom the Software is #
-# furnished to do so, subject to the following conditions: #
-# #
-# The above copyright notice and this permission notice shall be included in all #
-# copies or substantial portions of the Software. #
-# #
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE #
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, #
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE #
-# SOFTWARE. #
-# #
-# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-
-### VARIABLES
-
-RECEIVER_ROOT_DIRECTORY="${PWD}"
-RECEIVER_BASH_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/bash"
-RECEIVER_BUILD_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/build"
-
-### INCLUDE EXTERNAL SCRIPTS
-
-source ${RECEIVER_BASH_DIRECTORY}/variables.sh
-source ${RECEIVER_BASH_DIRECTORY}/functions.sh
-
-## SET INSTALLATION VARIABLES
-
-# Source the automated install configuration file if this is an automated installation.
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] && [[ -s "${RECEIVER_CONFIGURATION_FILE}" ]] ; then
- source ${RECEIVER_CONFIGURATION_FILE}
-fi
-
-### BEGIN SETUP
-
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- clear
- echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
-fi
-echo -e ""
-echo -e "\e[92m Setting up ADSBHub feeder client..."
-echo -e ""
-echo -e "\e[93m ------------------------------------------------------------------------------\e[96m"
-echo -e ""
-
-# Confirm component installation.
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- # Interactive install.
- CONTINUE_SETUP=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "ADSBHub client Setup" --yesno "There are many Web sites tracking aircraft and all of them rely on data shared by ADS-B fans. However, the access to aggregated ADS-B worldwide data is limited. The main goal of ADSBHub is to become a ADS-B data sharing centre and valuable data source for all enthusiasts and professionals interested in development of ADS-B related software. For more information please see their website:\n\n http://www.adsbhub.org/howtofeed.php\n\nContinue setup by installing the ADSBHub client?" 16 78 3>&1 1>&2 2>&3)
- if [[ ${CONTINUE_SETUP} -eq 1 ]] ; then
- # Setup has been halted by the user.
- echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
- echo -e " Setup has been halted at the request of the user."
- echo -e ""
- echo -e "\e[93m ------------------------------------------------------------------------------"
- echo -e "\e[92m ADSBHub client setup halted.\e[39m"
- echo -e ""
- read -p "Press enter to continue..." CONTINUE
- exit 1
- fi
-else
- # Warn that automated installation is not supported.
- echo -e "\e[92m Automated installation of this script is not yet supported...\e[39m"
- echo -e ""
- exit 1
-fi
-
-### INSTALL REQUIRED PACKAGES IF THEY ARE NOT ALREADY INSTALLED
-
-CheckPackage wget
-CheckPackage netcat
-
-### ENABLE THE USE OF /ETC/RC.LOCAL IF THE FILE DOES NOT EXIST
-
-if [ ! -f /etc/rc.local ]; then
- echo ""
- echo -e "\e[95m Enabling the use of the /etc/rc.local file...\e[97m"
- echo ""
-
- # In Debian Stretch /etc/rc.local has been removed.
- # However at this time we can bring this file back into play.
- # As to if in future releases this will work remains to be seen...
-
- echo -e "\e[94m Creating the file /etc/rc.local...\e[97m"
- sudo tee /etc/rc.local > /dev/null <0)) && sudo sed -i "${lnum[$((${#lnum[@]}-1))]}i $RECEIVER_BUILD_DIRECTORY/adsbhub/adsbhub.sh &\n" /etc/rc.local
-fi
-
-### START THE ADSBHUB CLIENT
-
-echo ""
-echo -e "\e[95m Starting the ADSBHub client...\e[97m"
-echo ""
-
-# Kill any currently running instances of the adsbexchange-socat_maint.sh script.
-echo -e "\e[94m Checking for any running adsbexchange-socat_maint.sh processes...\e[97m"
-if [[ $(ps -aux | grep '[a]dsbhub/adsbhub.sh' | awk '{print $2}') ]]; then
- echo -e "\e[94m Killing the current adsbhub.sh process...\e[97m"
- sudo kill -9 $(ps -aux | grep '[a]dsbhub/adsbhub.sh' | awk '{print $2}') &> /dev/null
-fi
-
-echo -e "\e[94m Executing the ADSBHub client script...\e[97m"
-sudo nohup $RECEIVER_BUILD_DIRECTORY/adsbhub/adsbhub.sh > /dev/null 2>&1 &
-
-### INFORM THE USER THERE IS MORE TO DO
-
-whiptail --title "Complete Setup at ADSBHub.org" --msgbox "IMPORTANT!!!\n\nIn order to complete the ADSBHub setup process you will need to create/login to your ADSBHub account at http://www.adsbhub.com. After logining into your account click on the \"Settings\" button then next to your \"Profile\" tab click on \"New Station\" and fill out the form." 12 78
-
-### SETUP COMPLETE
-
-# Return to the project root directory.
-echo -e "\e[94m Returning to ${RECEIVER_PROJECT_TITLE} root directory...\e[97m"
-cd ${RECEIVER_ROOT_DIRECTORY} 2>&1
-
-echo -e ""
-echo -e "\e[93m ------------------------------------------------------------------------------"
-echo -e "\e[92m OpenSky Network feeder client setup is complete.\e[39m"
-echo -e ""
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- read -p "Press enter to continue..." CONTINUE
-fi
-
-exit 0
diff --git a/bash/feeders/flightradar24.sh b/bash/feeders/flightradar24.sh
index 5f7147d4..41e158b9 100755
--- a/bash/feeders/flightradar24.sh
+++ b/bash/feeders/flightradar24.sh
@@ -9,7 +9,7 @@
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
-# Copyright (c) 2015-2017, Joseph A. Prochazka #
+# Copyright (c) 2015-2024, Joseph A. Prochazka #
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy #
# of this software and associated documentation files (the "Software"), to deal #
@@ -31,30 +31,15 @@
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-### VARIABLES
-
-RECEIVER_ROOT_DIRECTORY="${PWD}"
-RECEIVER_BASH_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/bash"
-RECEIVER_BUILD_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/build"
-
### INCLUDE EXTERNAL SCRIPTS
source ${RECEIVER_BASH_DIRECTORY}/variables.sh
source ${RECEIVER_BASH_DIRECTORY}/functions.sh
-## SET INSTALLATION VARIABLES
-
-# Source the automated install configuration file if this is an automated installation.
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] && [[ -s "${RECEIVER_CONFIGURATION_FILE}" ]] ; then
- source ${RECEIVER_CONFIGURATION_FILE}
-fi
-
### BEGIN SETUP
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- clear
- echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
-fi
+clear
+echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
echo -e ""
echo -e "\e[92m Setting up FlightRadar24 feeder client..."
echo -e ""
@@ -67,64 +52,19 @@ if [[ $(dpkg-query -W -f='${STATUS}' fr24feed 2>/dev/null | grep -c "ok installe
fi
# Confirm component installation.
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- # Interactive install.
- CONTINUE_SETUP=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "FlightRadar24 feeder client Setup" --yesno "The FlightRadar24 feeder client takes data from a local dump1090 instance and shares this with FlightRadar24 using the fr24feed package, for more information please see their website:\n\n https://www.flightradar24.com/share-your-data\n\nContinue setup by installing the FlightRadar24 feeder client?" 13 78 3>&1 1>&2 2>&3)
- if [[ ${CONTINUE_SETUP} -eq 1 ]] ; then
- # Setup has been halted by the user.
- echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
- echo -e " Setup has been halted at the request of the user."
- echo -e ""
- echo -e "\e[93m ------------------------------------------------------------------------------"
- echo -e "\e[92m FlightRadar24 feeder client setup halted.\e[39m"
- echo -e ""
- read -p "Press enter to continue..." CONTINUE
- exit 1
- fi
-else
- # Warn that automated installation is not supported.
- echo -e "\e[92m Automated installation of this script is not yet supported...\e[39m"
+CONTINUE_SETUP=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "FlightRadar24 feeder client Setup" --yesno "The FlightRadar24 feeder client takes data from a local dump1090 instance and shares this with FlightRadar24 using the fr24feed package, for more information please see their website:\n\n https://www.flightradar24.com/share-your-data\n\nContinue setup by installing the FlightRadar24 feeder client?" 13 78 3>&1 1>&2 2>&3)
+if [[ ${CONTINUE_SETUP} -eq 1 ]] ; then
+ # Setup has been halted by the user.
+ echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
+ echo -e " Setup has been halted at the request of the user."
+ echo -e ""
+ echo -e "\e[93m ------------------------------------------------------------------------------"
+ echo -e "\e[92m FlightRadar24 feeder client setup halted.\e[39m"
echo -e ""
+ read -p "Press enter to continue..." CONTINUE
exit 1
fi
-### CHECK FOR PREREQUISITE PACKAGES
-
-echo -e "\e[95m Installing packages needed to fulfill dependencies for FlightRadar24 feeder client...\e[97m"
-echo -e ""
-
-if [[ "${CPU_ARCHITECTURE}" = "x86_64" ]] ; then
- if [[ $(dpkg --print-foreign-architectures $1 2>/dev/null | grep -c "i386") -eq 0 ]] ; then
- echo -e "\e[94m Adding the i386 architecture...\e[97m"
- sudo dpkg --add-architecture i386 2>&1
- echo -e "\e[94m Downloading latest package lists for enabled repositories and PPAs...\e[97m"
- echo -e ""
- sudo apt-get update
- echo -e ""
- fi
- CheckPackage libc6:i386
- CheckPackage libudev1:i386
- CheckPackage zlib1g:i386
- CheckPackage libusb-1.0-0:i386
- CheckPackage libstdc++6:i386
-else
- CheckPackage libc6
- CheckPackage libudev1
- CheckPackage zlib1g
- CheckPackage libusb-1.0-0
- CheckPackage libstdc++6
-fi
-CheckPackage wget
-CheckPackage dirmngr
-
-### STOP ANY RUNNING SERVICES
-
-# Attempt to stop using systemd.
-if [[ "`sudo systemctl status fr24feed 2>&1 | egrep -c "Active: active (running)"`" -gt 0 ]] ; then
- echo -e "\e[94m Stopping the FlightRadar24 feeder client service...\e[97m"
- sudo systemctl stop fr24feed 2>&1
-fi
-
### START INSTALLATION
echo -e ""
@@ -140,118 +80,51 @@ if [[ ! -d ${RECEIVER_BUILD_DIRECTORY}/flightradar24 ]] ; then
fi
# Change to the component build directory.
-if [[ ! ${PWD} = ${RECEIVER_BUILD_DIRECTORY}/flightradar24 ]] ; then
- echo -e "\e[94m Entering the FlightRadar24 feeder client build directory...\e[97m"
- cd ${RECEIVER_BUILD_DIRECTORY}/flightradar24 2>&1
-fi
+echo -e "\e[94m Entering the FlightRadar24 feeder client build directory...\e[97m"
+cd ${RECEIVER_BUILD_DIRECTORY}/flightradar24 2>&1
+echo ""
-## BUILD AND INSTALL THE COMPONENT PACKAGE
+## Download the official Flightradar24 installation script.
-echo -e ""
-echo -e "\e[95m Building and installing the FlightRadar24 feeder client package...\e[97m"
+echo -e "\e[95m Beginning the Flightradar24 client installation...\e[97m"
echo -e ""
-## DOWNLOAD OR UPDATE THE COMPONENT SOURCE
+echo -e "\e[94m Downloading the Flightradar24 client installation script...\e[97m"
+echo ""
+wget -v https://fr24.com/install.sh
-# Download the appropriate package depending on the devices architecture.
-if [[ "${CPU_ARCHITECTURE}" = "armv7l" ]] || [[ "${CPU_ARCHITECTURE}" = "armv6l" ]] || [[ "${CPU_ARCHITECTURE}" = "aarch64" ]] ; then
- # ARM achitecture detected.
- whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "FlightRadar24 feeder client setup instructions" --msgbox "This script will now download and execute the official FlightRadar24 feeder client setup script, please follow the instructions provided and supply the required information when ask for by the script.\n\nOnce finished the ADS-B Receiver Project scripts will continue." 11 78
+echo -e "\e[94m Executing the Flightradar24 client installation script...\e[97m"
+echo ""
+sudo bash ${RECEIVER_BUILD_DIRECTORY}/flightradar24/install.sh
+echo ""
- echo -e "\e[94m Downloading the FlightRadar24 feeder client installation script for ARM...\e[97m"
+# Check that the component package was installed successfully.
+echo -e "\e[94m Checking that the FlightRadar24 feeder client package was installed properly...\e[97m"
+
+if [[ $(dpkg-query -W -f='${STATUS}' fr24feed 2>/dev/null | grep -c "ok installed") -eq 0 ]] ; then
+ # If the component package could not be installed halt setup.
echo -e ""
- wget --no-check-certificate https://repo.feed.flightradar24.com/install_fr24_rpi.sh -O ${RECEIVER_BUILD_DIRECTORY}/flightradar24/install_fr24_rpi.sh
-else
- # Otherwise assume i386.
- echo -e "\e[94m Downloading the FlightRadar24 feeder client v${FLIGHTRADAR24_CLIENT_VERSION_I386} package for i386 devices...\e[97m"
+ echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
+ echo -e " UNABLE TO INSTALL A REQUIRED PACKAGE."
+ echo -e " SETUP HAS BEEN TERMINATED!"
echo -e ""
- wget --no-check-certificate https://feed.flightradar24.com/linux/fr24feed_${FLIGHTRADAR24_CLIENT_VERSION_I386}_i386.deb -O ${RECEIVER_BUILD_DIRECTORY}/flightradar24/fr24feed_${FLIGHTRADAR24_CLIENT_VERSION_I386}_i386.deb
-fi
-
-## INSTALL THE COMPONENT PACKAGE
-
-# Install the proper package depending on the devices architecture.
-if [[ "${CPU_ARCHITECTURE}" = "armv7l" ]] || [[ "${CPU_ARCHITECTURE}" = "armv6l" ]] || [[ "${CPU_ARCHITECTURE}" = "aarch64" ]] ; then
- # ARM achitecture detected.
- echo -e "\e[94m Executing the FlightRadar24 feeder client installation script...\e[97m"
+ echo -e "\e[93mThe package \"fr24feed\" could not be installed.\e[39m"
echo -e ""
- sudo bash ${RECEIVER_BUILD_DIRECTORY}/flightradar24/install_fr24_rpi.sh
-else
- # Otherwise assume i386.
- echo -e "\e[94m Installing the FlightRadar24 feeder client v${FLIGHTRADAR24_CLIENT_VERSION_I386} package for i386 devices...\e[97m"
- if [[ `lsb_release -si` = "Debian" ]] ; then
- # Force architecture if this is Debian.
- echo -e "\e[94m NOTE: dpkg executed with added flag --force-architecture.\e[97m"
- echo -e ""
- sudo dpkg -i --force-architecture ${RECEIVER_BUILD_DIRECTORY}/flightradar24/fr24feed_${FLIGHTRADAR24_CLIENT_VERSION_I386}_i386.deb 2>&1
- else
- echo -e ""
- sudo dpkg -i ${RECEIVER_BUILD_DIRECTORY}/flightradar24/fr24feed_${FLIGHTRADAR24_CLIENT_VERSION_I386}_i386.deb 2>&1
- fi
-fi
-
-# Dummy test for consistency with other feeder install scripts.
-if [[ -n "${CPU_ARCHITECTURE}" ]] ; then
- # Check that the component package was installed successfully.
+ echo -e "\e[93m ------------------------------------------------------------------------------"
+ echo -e "\e[92m FlightRadar24 feeder client setup halted.\e[39m"
echo -e ""
- echo -e "\e[94m Checking that the FlightRadar24 feeder client package was installed properly...\e[97m"
-
- if [[ $(dpkg-query -W -f='${STATUS}' fr24feed 2>/dev/null | grep -c "ok installed") -eq 0 ]] ; then
- # If the component package could not be installed halt setup.
- echo -e ""
- echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
- echo -e " UNABLE TO INSTALL A REQUIRED PACKAGE."
- echo -e " SETUP HAS BEEN TERMINATED!"
- echo -e ""
- echo -e "\e[93mThe package \"fr24feed\" could not be installed.\e[39m"
- echo -e ""
- echo -e "\e[93m ------------------------------------------------------------------------------"
- echo -e "\e[92m FlightRadar24 feeder client setup halted.\e[39m"
- echo -e ""
- if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- read -p "Press enter to continue..." CONTINUE
- fi
- exit 1
- elif [[ ! "${CPU_ARCHITECTURE}" = "armv7l" ]] && [[ ! "${CPU_ARCHITECTURE}" = "armv6l" ]] && [[ ! "${CPU_ARCHITECTURE}" = "aarch64" ]] ; then
- # Create binary package archive directory.
- if [[ ! -d "${RECEIVER_BUILD_DIRECTORY}/package-archive" ]] ; then
- echo -e "\e[94m Creating package archive directory...\e[97m"
- echo -e ""
- mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/package-archive 2>&1
- echo -e ""
- fi
-
- # Archive binary package.
- echo -e "\e[94m Moving the FlightRadar24 feeder client binary package into the archive directory...\e[97m"
- echo -e ""
- mv -vf ${RECEIVER_BUILD_DIRECTORY}/flightradar24/fr24feed_*.deb ${RECEIVER_BUILD_DIRECTORY}/package-archive 2>&1
- echo -e ""
+ read -p "Press enter to continue..." CONTINUE
+ exit 1
+fi
## COMPONENT POST INSTALL ACTIONS
- # Check for component first install
- if [[ "${COMPONENT_FIRST_INSTALL}" = "true" ]] ; then
- # Run signup script if first install.
- echo -e "\e[94m Starting fr24feed signup wizard...\e[97m"
- echo -e ""
- sudo fr24feed --signup
- echo -e ""
- fi
-
- # Update config file permissions
- echo -e "\e[94m Updating configuration file permissions...\e[97m"
- sudo chmod a+rw /etc/fr24feed.ini 2>&1
-
- # (re)start the component service.
- if [[ "`sudo systemctl status fr24feed 2>&1 | egrep -c "Active: active (running)"`" -gt 0 ]] ; then
- echo -e "\e[94m Restarting the FlightRadar24 feeder client service...\e[97m"
- sudo systemctl restart fr24feed 2>&1
- else
- echo -e "\e[94m Starting the FlightRadar24 feeder client service...\e[97m"
- sudo systemctl start fr24feed 2>&1
- fi
- fi
-fi
+# If sharing to other networks alongside Flightradar24 disable MLAT.
+echo -e "\e[94m Flightradar24 asks that MLAT be disabled if sharing with other networks...\e[97m"
+ChangeConfig "mlat" "no" "/etc/fr24feed.ini"
+ChangeConfig "mlat-without-gps" "no" "/etc/fr24feed.ini"
+echo -e "\e[94m Restarting the Flightradar24 client...\e[97m"
+sudo systemctl restart fr24feed
### SETUP COMPLETE
@@ -263,8 +136,6 @@ echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m FlightRadar24 feeder client setup is complete.\e[39m"
echo -e ""
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- read -p "Press enter to continue..." CONTINUE
-fi
+read -p "Press enter to continue..." CONTINUE
exit 0
diff --git a/bash/feeders/openskynetwork.sh b/bash/feeders/openskynetwork.sh
index 8f0bc3ee..360ddd39 100755
--- a/bash/feeders/openskynetwork.sh
+++ b/bash/feeders/openskynetwork.sh
@@ -9,7 +9,7 @@
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
-# Copyright (c) 2015-2018, Joseph A. Prochazka #
+# Copyright (c) 2015-2024, Joseph A. Prochazka #
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy #
# of this software and associated documentation files (the "Software"), to deal #
@@ -31,30 +31,15 @@
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-### VARIABLES
-
-RECEIVER_ROOT_DIRECTORY="${PWD}"
-RECEIVER_BASH_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/bash"
-RECEIVER_BUILD_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/build"
-
### INCLUDE EXTERNAL SCRIPTS
source ${RECEIVER_BASH_DIRECTORY}/variables.sh
source ${RECEIVER_BASH_DIRECTORY}/functions.sh
-## SET INSTALLATION VARIABLES
-
-# Source the automated install configuration file if this is an automated installation.
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] && [[ -s "${RECEIVER_CONFIGURATION_FILE}" ]] ; then
- source ${RECEIVER_CONFIGURATION_FILE}
-fi
-
### BEGIN SETUP
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- clear
- echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
-fi
+clear
+echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
echo -e ""
echo -e "\e[92m Setting up OpenSky Network feeder client..."
echo -e ""
@@ -62,24 +47,16 @@ echo -e "\e[93m ---------------------------------------------------------------
echo -e ""
# Confirm component installation.
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- # Interactive install.
- CONTINUE_SETUP=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "OpenSky Network feeder client Setup" --yesno "The OpenSky Network is a community-based receiver network which continuously collects air traffic surveillance data. Unlike other networks, OpenSky keeps the collected data forever and makes it accessible to researchers. For more information please see their website:\n\n https://opensky-network.org/\n\nContinue setup by installing the OpenSky Network feeder client?" 13 78 3>&1 1>&2 2>&3)
- if [[ ${CONTINUE_SETUP} -eq 1 ]] ; then
- # Setup has been halted by the user.
- echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
- echo -e " Setup has been halted at the request of the user."
- echo -e ""
- echo -e "\e[93m ------------------------------------------------------------------------------"
- echo -e "\e[92m OpenSky Network feeder client setup halted.\e[39m"
- echo -e ""
- read -p "Press enter to continue..." CONTINUE
- exit 1
- fi
-else
- # Warn that automated installation is not supported.
- echo -e "\e[92m Automated installation of this script is not yet supported...\e[39m"
+CONTINUE_SETUP=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "OpenSky Network feeder client Setup" --yesno "The OpenSky Network is a community-based receiver network which continuously collects air traffic surveillance data. Unlike other networks, OpenSky keeps the collected data forever and makes it accessible to researchers. For more information please see their website:\n\n https://opensky-network.org/\n\nContinue setup by installing the OpenSky Network feeder client?" 13 78 3>&1 1>&2 2>&3)
+if [[ ${CONTINUE_SETUP} -eq 1 ]] ; then
+ # Setup has been halted by the user.
+ echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
+ echo -e " Setup has been halted at the request of the user."
echo -e ""
+ echo -e "\e[93m ------------------------------------------------------------------------------"
+ echo -e "\e[92m OpenSky Network feeder client setup halted.\e[39m"
+ echo -e ""
+ read -p "Press enter to continue..." CONTINUE
exit 1
fi
@@ -98,10 +75,10 @@ if ! grep -q "^deb .*opensky." /etc/apt/sources.list /etc/apt/sources.list.d/*;
else
echo -e "\e[94m The OpenSky Network apt repository already exists in /etc/apt/sources.list.d/...\e[97m"
fi
+echo ""
### INSTALL THE OPENSKY NETWORK FEEDER PACKAGE USING APT
-echo ""
echo -e "\e[95m Installing the OpenSky Network fedder package...\e[97m"
echo ""
@@ -122,8 +99,6 @@ echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m OpenSky Network feeder client setup is complete.\e[39m"
echo -e ""
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- read -p "Press enter to continue..." CONTINUE
-fi
+read -p "Press enter to continue..." CONTINUE
exit 0
diff --git a/bash/feeders/piaware.sh b/bash/feeders/piaware.sh
index 73614e27..53097751 100755
--- a/bash/feeders/piaware.sh
+++ b/bash/feeders/piaware.sh
@@ -9,7 +9,7 @@
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
-# Copyright (c) 2015-2017, Joseph A. Prochazka #
+# Copyright (c) 2015-2024, Joseph A. Prochazka #
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy #
# of this software and associated documentation files (the "Software"), to deal #
@@ -31,30 +31,15 @@
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-### VARIABLES
-
-RECEIVER_ROOT_DIRECTORY="${PWD}"
-RECEIVER_BASH_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/bash"
-RECEIVER_BUILD_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/build"
-
### INCLUDE EXTERNAL SCRIPTS
source ${RECEIVER_BASH_DIRECTORY}/variables.sh
source ${RECEIVER_BASH_DIRECTORY}/functions.sh
-## SET INSTALLATION VARIABLES
-
-# Source the automated install configuration file if this is an automated installation.
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] && [[ -s "${RECEIVER_CONFIGURATION_FILE}" ]] ; then
- source ${RECEIVER_CONFIGURATION_FILE}
-fi
-
### BEGIN SETUP
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- clear
- echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
-fi
+clear
+echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
echo ""
echo -e "\e[92m Setting up FlightAware PiAware client..."
echo ""
@@ -67,24 +52,16 @@ if [[ $(dpkg-query -W -f='${STATUS}' piaware 2>/dev/null | grep -c "ok installed
fi
# Confirm component installation.
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- # Interactive install.
- CONTINUE_SETUP=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "FlightAware PiAware client Setup" --yesno "The FlightAware PiAware client takes data from a local dump1090 instance and shares this with FlightAware using the piaware package, for more information please see their website:\n\n https://www.flightaware.com/adsb/piaware/\n\nContinue setup by installing the FlightAware PiAware client?" 13 78 3>&1 1>&2 2>&3)
- if [[ ${CONTINUE_SETUP} -eq 1 ]] ; then
- # Setup has been halted by the user.
- echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
- echo -e " Setup has been halted at the request of the user."
- echo ""
- echo -e "\e[93m ------------------------------------------------------------------------------"
- echo -e "\e[92m FlightAware PiAware client setup halted.\e[39m"
- echo ""
- read -p "Press enter to continue..." CONTINUE
- exit 1
- fi
-else
- # Warn that automated installation is not supported.
- echo -e "\e[92m Automated installation of this script is not yet supported...\e[39m"
+CONTINUE_SETUP=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "FlightAware PiAware client Setup" --yesno "The FlightAware PiAware client takes data from a local dump1090 instance and shares this with FlightAware using the piaware package, for more information please see their website:\n\n https://www.flightaware.com/adsb/piaware/\n\nContinue setup by installing the FlightAware PiAware client?" 13 78 3>&1 1>&2 2>&3)
+if [[ ${CONTINUE_SETUP} -eq 1 ]] ; then
+ # Setup has been halted by the user.
+ echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
+ echo -e " Setup has been halted at the request of the user."
+ echo ""
+ echo -e "\e[93m ------------------------------------------------------------------------------"
+ echo -e "\e[92m FlightAware PiAware client setup halted.\e[39m"
echo ""
+ read -p "Press enter to continue..." CONTINUE
exit 1
fi
@@ -92,21 +69,77 @@ fi
echo -e "\e[95m Installing packages needed to fulfill dependencies for FlightAware PiAware client...\e[97m"
echo ""
-
CheckPackage build-essential
+CheckPackage git
+CheckPackage devscripts
CheckPackage debhelper
CheckPackage tcl8.6-dev
CheckPackage autoconf
CheckPackage python3-dev
CheckPackage python3-venv
-CheckPackage virtualenv
-CheckPackage dh-systemd
+CheckPackage python3-setuptools
CheckPackage zlib1g-dev
+CheckPackage openssl
+CheckPackage libboost-system-dev
+CheckPackage libboost-program-options-dev
+CheckPackage libboost-regex-dev
+CheckPackage libboost-filesystem-dev
+CheckPackage patchelf
+CheckPackage python3-pip
+CheckPackage python3-build
+CheckPackage python3-setuptools
+CheckPackage python3-wheel
+CheckPackage net-tools
CheckPackage tclx8.4
CheckPackage tcllib
-CheckPackage tcl-tls
CheckPackage itcl3
-CheckPackage net-tools
+CheckPackage libssl-dev
+CheckPackage tcl-dev
+CheckPackage chrpath
+echo ""
+
+## DOWNLOAD OR UPDATE THE TCLTLS REBUILD SOURCE
+
+echo -e "\e[95m Preparing the tcltls rebuild Git repository...\e[97m"
+echo ""
+# Build the FlightAware version of tcl-tls to address network issues with the stock package.
+if [[ -d ${RECEIVER_BUILD_DIRECTORY}/tcltls-rebuild ]] && [[ -d ${RECEIVER_BUILD_DIRECTORY}/tcltls-rebuild/.git ]] ; then
+ # A directory with a git repository containing the source code already exists.
+ echo -e "\e[94m Entering the tcltls-rebuild git repository directory...\e[97m"
+ cd ${RECEIVER_BUILD_DIRECTORY}/tcltls-rebuild 2>&1
+ echo -e "\e[94m Updating the local tcltls-rebuild git repository...\e[97m"
+ echo ""
+ git pull 2>&1
+else
+ # A directory containing the source code does not exist in the build directory.
+ echo -e "\e[94m Entering the ADS-B Receiver Project build directory...\e[97m"
+ cd ${RECEIVER_BUILD_DIRECTORY} 2>&1
+ echo -e "\e[94m Cloning the tcltls-rebuild git repository locally...\e[97m"
+ echo ""
+ git clone https://github.com/flightaware/tcltls-rebuild 2>&1
+fi
+echo ""
+
+## BUILD AND INSTALL THE DUMP1090-FA PACKAGE
+
+echo -e "\e[95m Building and installing the tcltls rebuild package...\e[97m"
+echo -e ""
+
+echo -e "\e[94m Entering the tcltls-rebuild source directory...\e[97m"
+cd ${RECEIVER_BUILD_DIRECTORY}/tcltls-rebuild/tcltls-1.7.22 2>&1
+echo -e "\e[94m Building the tcltls-rebuild package...\e[97m"
+echo ""
+dpkg-buildpackage -b 2>&1
+echo ""
+echo -e "\e[94m Installing the tcltls-rebuild package...\e[97m"
+echo ""
+sudo dpkg -i ${RECEIVER_BUILD_DIRECTORY}/tcltls-rebuild/tcl-tls_1.7.22-2+fa1_*.deb 2>&1
+echo ""
+echo -e "\e[94m Moving the tcltls-rebuild binary package into the archive directory...\e[97m"
+echo ""
+cp -vf ${RECEIVER_BUILD_DIRECTORY}/piaware_builder/*.deb ${RECEIVER_BUILD_DIRECTORY}/package-archive/ 2>&1
+echo ""
+
### STOP ANY RUNNING SERVICES
@@ -118,7 +151,6 @@ fi
### START INSTALLATION
-echo ""
echo -e "\e[95m Begining the FlightAware PiAware client installation process...\e[97m"
echo ""
@@ -137,10 +169,10 @@ else
echo ""
git clone https://github.com/flightaware/piaware_builder.git 2>&1
fi
+echo ""
## BUILD AND INSTALL THE COMPONENT PACKAGE
-echo ""
echo -e "\e[95m Building and installing the FlightAware PiAware client package...\e[97m"
echo ""
@@ -150,64 +182,72 @@ if [[ ! ${PWD} = ${RECEIVER_BUILD_DIRECTORY}/piaware_builder ]] ; then
cd ${RECEIVER_BUILD_DIRECTORY}/piaware_builder 2>&1
fi
-# Dummy test for consistency with other feeder install scripts.
-if [[ -n "${CPU_ARCHITECTURE}" ]] ; then
- # Execute build script.
- echo -e "\e[94m Executing the FlightAware PiAware client build script...\e[97m"
- echo ""
- ./sensible-build.sh jessie
- echo ""
+# Execute build script.
+DIST="bookworm"
+case ${RECEIVER_OS_CODE_NAME} in
+ buster)
+ DIST="buster"
+ ;;
+ bullseye)
+ DIST="bullseye"
+ ;;
+ bookworm)
+ DIST="bookworm"
+ ;;
+esac
+
+echo -e "\e[94m Executing the FlightAware PiAware client build script...\e[97m"
+echo ""
+./sensible-build.sh ${DIST}
+echo ""
+
+# Change to build script directory.
+echo -e "\e[94m Entering the FlightAware PiAware client build directory...\e[97m"
+cd ${RECEIVER_BUILD_DIRECTORY}/piaware_builder/package-${DIST} 2>&1
+
+# Build binary package.
+echo -e "\e[94m Building the FlightAware PiAware client package...\e[97m"
+echo ""
+dpkg-buildpackage -b 2>&1
+echo ""
+
+# Install binary package.
+echo -e "\e[94m Installing the FlightAware PiAware client package...\e[97m"
+echo ""
+sudo dpkg -i ${RECEIVER_BUILD_DIRECTORY}/piaware_builder/piaware_*.deb 2>&1
+echo ""
- # Change to build script directory.
- echo -e "\e[94m Entering the FlightAware PiAware client build directory...\e[97m"
- cd ${RECEIVER_BUILD_DIRECTORY}/piaware_builder/package-jessie 2>&1
+# Check that the component package was installed successfully.
+echo -e "\e[94m Checking that the FlightAware PiAware client package was installed properly...\e[97m"
- # Build binary package.
- echo -e "\e[94m Building the FlightAware PiAware client package...\e[97m"
+if [[ $(dpkg-query -W -f='${STATUS}' piaware 2>/dev/null | grep -c "ok installed") -eq 0 ]] ; then
+ # If the component package could not be installed halt setup.
echo ""
- dpkg-buildpackage -b 2>&1
+ echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
+ echo -e " UNABLE TO INSTALL A REQUIRED PACKAGE."
+ echo -e " SETUP HAS BEEN TERMINATED!"
echo ""
-
- # Install binary package.
- echo -e "\e[94m Installing the FlightAware PiAware client package...\e[97m"
+ echo -e "\e[93mThe package \"piaware\" could not be installed.\e[39m"
echo ""
- sudo dpkg -i ${RECEIVER_BUILD_DIRECTORY}/piaware_builder/piaware_*.deb 2>&1
+ echo -e "\e[93m ------------------------------------------------------------------------------"
+ echo -e "\e[92m FlightAware PiAware client setup halted.\e[39m"
echo ""
-
- # Check that the component package was installed successfully.
- echo -e "\e[94m Checking that the FlightAware PiAware client package was installed properly...\e[97m"
-
- if [[ $(dpkg-query -W -f='${STATUS}' piaware 2>/dev/null | grep -c "ok installed") -eq 0 ]] ; then
- # If the component package could not be installed halt setup.
- echo ""
- echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
- echo -e " UNABLE TO INSTALL A REQUIRED PACKAGE."
- echo -e " SETUP HAS BEEN TERMINATED!"
- echo ""
- echo -e "\e[93mThe package \"piaware\" could not be installed.\e[39m"
- echo ""
- echo -e "\e[93m ------------------------------------------------------------------------------"
- echo -e "\e[92m FlightAware PiAware client setup halted.\e[39m"
- echo ""
- if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- read -p "Press enter to continue..." CONTINUE
- fi
- exit 1
- else
- # Create binary package archive directory.
- if [[ ! -d "${RECEIVER_BUILD_DIRECTORY}/package-archive" ]] ; then
- echo -e "\e[94m Creating package archive directory...\e[97m"
- echo ""
- mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/package-archive 2>&1
- echo ""
- fi
-
- # Archive binary package.
- echo -e "\e[94m Moving the FlightAware PiAware client binary package into the archive directory...\e[97m"
+ read -p "Press enter to continue..." CONTINUE
+ exit 1
+else
+ # Create binary package archive directory.
+ if [[ ! -d "${RECEIVER_BUILD_DIRECTORY}/package-archive" ]] ; then
+ echo -e "\e[94m Creating package archive directory...\e[97m"
echo ""
- cp -vf ${RECEIVER_BUILD_DIRECTORY}/piaware_builder/*.deb ${RECEIVER_BUILD_DIRECTORY}/package-archive/ 2>&1
+ mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/package-archive 2>&1
echo ""
fi
+
+ # Archive binary package.
+ echo -e "\e[94m Moving the FlightAware PiAware client binary package into the archive directory...\e[97m"
+ echo ""
+ cp -vf ${RECEIVER_BUILD_DIRECTORY}/piaware_builder/*.deb ${RECEIVER_BUILD_DIRECTORY}/package-archive/ 2>&1
+ echo ""
fi
## COMPONENT POST INSTALL ACTIONS
@@ -225,9 +265,7 @@ echo ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m FlightAware PiAware client setup is complete.\e[39m"
echo ""
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- read -p "Press enter to continue..." CONTINUE
-fi
+read -p "Press enter to continue..." CONTINUE
exit 0
diff --git a/bash/feeders/planefinder.sh b/bash/feeders/planefinder.sh
index 8cee1a12..359cf204 100755
--- a/bash/feeders/planefinder.sh
+++ b/bash/feeders/planefinder.sh
@@ -9,7 +9,7 @@
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
-# Copyright (c) 2015-2018, Joseph A. Prochazka #
+# Copyright (c) 2015-2024, Joseph A. Prochazka #
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy #
# of this software and associated documentation files (the "Software"), to deal #
@@ -31,60 +31,32 @@
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-### VARIABLES
-
-RECEIVER_ROOT_DIRECTORY="${PWD}"
-RECEIVER_BASH_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/bash"
-RECEIVER_BUILD_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/build"
-
### INCLUDE EXTERNAL SCRIPTS
source ${RECEIVER_BASH_DIRECTORY}/variables.sh
source ${RECEIVER_BASH_DIRECTORY}/functions.sh
-## SET INSTALLATION VARIABLES
-
-# Source the automated install configuration file if this is an automated installation.
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] && [[ -s "${RECEIVER_CONFIGURATION_FILE}" ]] ; then
- source ${RECEIVER_CONFIGURATION_FILE}
-fi
-
### BEGIN SETUP
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- clear
- echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
-fi
+clear
+echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
echo -e ""
echo -e "\e[92m Setting up PlaneFinder ADS-B Client..."
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------\e[96m"
echo -e ""
-# Check for existing component install.
-if [[ $(dpkg-query -W -f='${STATUS}' pfclient 2>/dev/null | grep -c "ok installed") -eq 0 ]] ; then
- COMPONENT_FIRST_INSTALL="true"
-fi
-
# Confirm component installation.
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- # Interactive install.
- CONTINUE_SETUP=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "PlaneFinder ADS-B Client Setup" --yesno "The PlaneFinder ADS-B Client is an easy and accurate way to share your ADS-B and MLAT data with Plane Finder. It comes with a beautiful user interface that helps you explore and interact with your data in realtime.\n\n https://planefinder.net/sharing/client\n\nContinue setup by installing PlaneFinder ADS-B Client?" 13 78 3>&1 1>&2 2>&3)
- if [[ ${CONTINUE_SETUP} -eq 1 ]] ; then
- # Setup has been halted by the user.
- echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
- echo -e " Setup has been halted at the request of the user."
- echo -e ""
- echo -e "\e[93m ------------------------------------------------------------------------------"
- echo -e "\e[92m PlaneFinder ADS-B Client setup halted.\e[39m"
- echo -e ""
- read -p "Press enter to continue..." CONTINUE
- exit 1
- fi
-else
- # Warn that automated installation is not supported.
- echo -e "\e[92m Automated installation of PlaneFinder ADS-B Client is not yet supported...\e[39m"
+CONTINUE_SETUP=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "PlaneFinder ADS-B Client Setup" --yesno "The PlaneFinder ADS-B Client is an easy and accurate way to share your ADS-B and MLAT data with Plane Finder. It comes with a beautiful user interface that helps you explore and interact with your data in realtime.\n\n https://planefinder.net/sharing/client\n\nContinue setup by installing PlaneFinder ADS-B Client?" 13 78 3>&1 1>&2 2>&3)
+if [[ ${CONTINUE_SETUP} -eq 1 ]] ; then
+ # Setup has been halted by the user.
+ echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
+ echo -e " Setup has been halted at the request of the user."
+ echo -e ""
+ echo -e "\e[93m ------------------------------------------------------------------------------"
+ echo -e "\e[92m PlaneFinder ADS-B Client setup halted.\e[39m"
echo -e ""
+ read -p "Press enter to continue..." CONTINUE
exit 1
fi
@@ -92,23 +64,39 @@ fi
echo -e "\e[95m Installing packages needed to fulfill dependencies for PlaneFinder ADS-B Client...\e[97m"
echo -e ""
-
-if [[ "${CPU_ARCHITECTURE}" = "x86_64" ]] ; then
- if [[ $(dpkg --print-foreign-architectures $1 2>/dev/null | grep -c "i386") -eq 0 ]] ; then
- echo -e "\e[94m Adding the i386 architecture...\e[97m"
- sudo dpkg --add-architecture i386 2>&1
- echo -e "\e[94m Downloading latest package lists for enabled repositories and PPAs...\e[97m"
+CheckPackage wget
+echo ""
+
+### DETERMINE WHICH PACACKAGE TO INSTALL
+
+echo -e "\e[94m Determining the package to install...\e[97m"
+BASE_DOWNLOAD_URL="http://client.planefinder.net/"
+case "${CPU_ARCHITECTURE}" in
+ "armv7l"|"armv6l")
+ PACKAGE_NAME="pfclient_${PLANEFINDER_CLIENT_VERSION_ARMHF}_armhf.deb"
+ ;;
+ "aarch64")
+ PACKAGE_NAME="pfclient_${PLANEFINDER_CLIENT_VERSION_ARM64}_armhf.deb"
+ ;;
+ "x86_64")
+ PACKAGE_NAME="pfclient_${PLANEFINDER_CLIENT_VERSION_AMD64}_amd64.deb"
+ ;;
+ "i386")
+ PACKAGE_NAME="pfclient_${PLANEFINDER_CLIENT_VERSION_I386}_i386.deb"
+ ;;
+ *)
+ echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
+ echo -e " Unsupported CPU archetecture."
echo -e ""
- sudo apt-get update
+ echo -e " Archetecture Detected: ${CPU_ARCHITECTURE}"
echo -e ""
- fi
- CheckPackage libc6:i386
-else
- CheckPackage libc6
-fi
-CheckPackage wget
-
-### STOP ANY RUNNING SERVICES
+ echo -e "\e[93m ------------------------------------------------------------------------------"
+ echo -e "\e[92m PlaneFinder ADS-B Client setup halted.\e[39m"
+ echo -e ""
+ read -p "Press enter to continue..." CONTINUE
+ exit 1
+ ;;
+esac
### START INSTALLATION
@@ -123,94 +111,40 @@ if [[ ! -d ${RECEIVER_BUILD_DIRECTORY}/planefinder ]] ; then
mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/planefinder
echo ""
fi
-
-# Change to the component build directory.
-if [[ ! ${PWD} = ${RECEIVER_BUILD_DIRECTORY}/planefinder ]] ; then
- echo -e "\e[94m Entering the PlaneFinder ADS-B Client build directory...\e[97m"
- cd ${RECEIVER_BUILD_DIRECTORY}/planefinder 2>&1
-fi
+echo -e "\e[94m Entering the PlaneFinder ADS-B Client build directory...\e[97m"
+cd ${RECEIVER_BUILD_DIRECTORY}/planefinder 2>&1
+echo ""
## BUILD AND INSTALL THE COMPONENT PACKAGE
-echo -e ""
-echo -e "\e[95m Building and installing the PlaneFinder ADS-B Client package...\e[97m"
+echo -e "\e[95m Installing the PlaneFinder ADS-B Client package...\e[97m"
echo -e ""
-## DOWNLOAD OR UPDATE THE COMPONENT SOURCE
+## DOWNLOAD AND INSTALL THE PACKAGE
# Download the appropriate package depending on the devices architecture.
-if [[ "${CPU_ARCHITECTURE}" = "armv7l" ]] || [[ "${CPU_ARCHITECTURE}" = "armv6l" ]] ; then
- # ARM achitecture detected.
- echo -e "\e[94m Downloading the PlaneFinder ADS-B Client v${PLANEFINDER_CLIENT_VERSION_ARM} package for ARM devices...\e[97m"
- echo -e ""
- wget --no-check-certificate https://client.planefinder.net/pfclient_${PLANEFINDER_CLIENT_VERSION_ARM}_armhf.deb -O ${RECEIVER_BUILD_DIRECTORY}/planefinder/pfclient_${PLANEFINDER_CLIENT_VERSION_ARM}_armhf.deb
-else
- # Otherwise assume i386.
- echo -e "\e[94m Downloading the PlaneFinder ADS-B Client v${PLANEFINDER_CLIENT_VERSION_I386} package for i386 devices...\e[97m"
- echo -e ""
- wget --no-check-certificate https://client.planefinder.net/pfclient_${PLANEFINDER_CLIENT_VERSION_I386}_i386.deb -O ${RECEIVER_BUILD_DIRECTORY}/planefinder/pfclient_${PLANEFINDER_CLIENT_VERSION_I386}_i386.deb
-fi
-
-## INSTALL THE COMPONENT PACKAGE
+echo -e "\e[94m Downloading the appropriate deb package...\e[97m"
+echo ""
+wget --no-check-certificate ${BASE_DOWNLOAD_URL}/${PACKAGE_NAME} -O ${RECEIVER_BUILD_DIRECTORY}/planefinder/${PACKAGE_NAME}
# Install the proper package depending on the devices architecture.
-if [[ "${CPU_ARCHITECTURE}" = "armv7l" ]] || [[ "${CPU_ARCHITECTURE}" = "armv6l" ]] || [[ "${CPU_ARCHITECTURE}" = "aarch64" ]] ; then
- # ARM achitecture detected.
- echo -e "\e[94m Installing the PlaneFinder ADS-B Client v${PLANEFINDER_CLIENT_VERSION_ARM} package for ARM devices...\e[97m"
- echo -e ""
- sudo dpkg -i ${RECEIVER_BUILD_DIRECTORY}/planefinder/pfclient_${PLANEFINDER_CLIENT_VERSION_ARM}_armhf.deb 2>&1
-else
- # Otherwise assume i386.
- echo -e "\e[94m Installing the PlaneFinder ADS-B Client v${PLANEFINDER_CLIENT_VERSION_I386} package for i386 devices...\e[97m"
- if [[ `lsb_release -si` = "Debian" ]] ; then
- # Force architecture if this is Debian.
- echo -e "\e[94m NOTE: dpkg executed with added flag --force-architecture.\e[97m"
- echo -e ""
- sudo dpkg -i --force-architecture ${RECEIVER_BUILD_DIRECTORY}/planefinder/pfclient_${PLANEFINDER_CLIENT_VERSION_I386}_i386.deb 2>&1
- else
- echo -e ""
- sudo dpkg -i ${RECEIVER_BUILD_DIRECTORY}/planefinder/pfclient_${PLANEFINDER_CLIENT_VERSION_I386}_i386.deb 2>&1
- fi
-fi
+echo -e "\e[94m Installing the PlaneFinder Client...\e[97m"
+echo -e ""
+sudo dpkg -i ${RECEIVER_BUILD_DIRECTORY}/planefinder/${PACKAGE_NAME} 2>&1
+echo ""
-# Dummy test for consistency with other feeder install scripts.
-if [[ -n "${CPU_ARCHITECTURE}" ]] ; then
- # Check that the component package was installed successfully.
+# Archive the deb package..
+echo -e "\e[94m Archiving the deb package...\e[97m"
+if [[ ! -d "${RECEIVER_BUILD_DIRECTORY}/package-archive" ]] ; then
+ echo -e "\e[94m Creating package archive directory...\e[97m"
+ echo -e ""
+ mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/package-archive 2>&1
echo -e ""
- echo -e "\e[94m Checking that the PlaneFinder ADS-B Client package was installed properly...\e[97m"
-
- if [[ $(dpkg-query -W -f='${STATUS}' pfclient 2>/dev/null | grep -c "ok installed") -eq 0 ]] ; then
- # If the component package could not be installed halt setup.
- echo -e ""
- echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
- echo -e " UNABLE TO INSTALL A REQUIRED PACKAGE."
- echo -e " SETUP HAS BEEN TERMINATED!"
- echo -e ""
- echo -e "\e[93mThe package \"pfclient\" could not be installed.\e[39m"
- echo -e ""
- echo -e "\e[93m ------------------------------------------------------------------------------"
- echo -e "\e[92m PlaneFinder ADS-B Client setup halted.\e[39m"
- echo -e ""
- if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- read -p "Press enter to continue..." CONTINUE
- fi
- exit 1
- else
- # Create binary package archive directory.
- if [[ ! -d "${RECEIVER_BUILD_DIRECTORY}/package-archive" ]] ; then
- echo -e "\e[94m Creating package archive directory...\e[97m"
- echo -e ""
- mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/package-archive 2>&1
- echo -e ""
- fi
-
- # Archive binary package.
- echo -e "\e[94m Moving the PlaneFinder ADS-B Client binary package into the archive directory...\e[97m"
- echo -e ""
- mv -vf ${RECEIVER_BUILD_DIRECTORY}/planefinder/pfclient_*.deb ${RECEIVER_BUILD_DIRECTORY}/package-archive 2>&1
- echo -e ""
- fi
fi
+echo -e "\e[94m Moving the PlaneFinder ADS-B Client binary package into the archive directory...\e[97m"
+echo -e ""
+mv -vf ${RECEIVER_BUILD_DIRECTORY}/planefinder/pfclient_*.deb ${RECEIVER_BUILD_DIRECTORY}/package-archive 2>&1
+echo -e ""
## COMPONENT POST INSTALL ACTIONS
diff --git a/bash/init.sh b/bash/init.sh
index b11a17ed..4355c4b0 100755
--- a/bash/init.sh
+++ b/bash/init.sh
@@ -9,7 +9,7 @@
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
-# Copyright (c) 2015-2016 Joseph A. Prochazka #
+# Copyright (c) 2015-2024 Joseph A. Prochazka #
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy #
# of this software and associated documentation files (the "Software"), to deal #
@@ -68,18 +68,14 @@ function AptUpdate() {
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m Finished downloading and updating package lists.\e[39m"
- if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- echo -e ""
- read -p "Press enter to continue..." CONTINUE
- fi
+ echo -e ""
+ read -p "Press enter to continue..." CONTINUE
}
# Function to check that the packages required by this script are installed.
function CheckPrerequisites() {
- if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- clear
- echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
- fi
+ clear
+ echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
echo -e ""
echo -e "\e[92m Checking to make sure the whiptail and git packages are installed..."
echo -e "\e[93m ------------------------------------------------------------------------------\e[97m"
@@ -90,10 +86,8 @@ function CheckPrerequisites() {
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m The whiptail and git packages are installed.\e[39m"
- if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- echo -e ""
- read -p "Press enter to continue..." CONTINUE
- fi
+ echo -e ""
+ read -p "Press enter to continue..." CONTINUE
}
# Function to update the local git repository.
@@ -101,7 +95,7 @@ function UpdateRepository() {
# Update lcoal branches which are set to track remote.
ACTION=$(git remote update 2>&1)
# Check if local branch is behind remote.
- if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] && [[ `git status | grep -c "untracked files present"` -gt 0 ]] ; then
+ if [[ `git status | grep -c "untracked files present"` -gt 0 ]] ; then
# Local branch has untracked files.
clear
# Ask if the user wishes to save any changes made to any core files before resetting them.
@@ -150,18 +144,14 @@ function UpdateRepository() {
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m Finished pulling the latest version of the ADS-B Receiver Project repository....\e[39m"
- if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- echo -e ""
- read -p "Press enter to continue..." CONTINUE
- fi
+ echo -e ""
+ read -p "Press enter to continue..." CONTINUE
}
# Function to update the operating system.
function UpdateOperatingSystem() {
- if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- clear
- echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
- fi
+ clear
+ echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
echo -e ""
echo -e "\e[92m Downloading and installing the latest updates for your operating system..."
echo -e "\e[93m ------------------------------------------------------------------------------\e[97m"
@@ -170,10 +160,8 @@ function UpdateOperatingSystem() {
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m Your operating system should now be up to date.\e[39m"
- if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- echo -e ""
- read -p "Press enter to continue..." CONTINUE
- fi
+ echo -e ""
+ read -p "Press enter to continue..." CONTINUE
}
## Update the repository packages and check that prerequisite packages are installed.
@@ -192,18 +180,16 @@ CheckPrerequisites
## DISPLAY WELCOME SCREEN
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "The ADS-B Receiver Project" --yesno "Thanks for choosing The ADS-B Receiver Project to setup your receiver.\n\nMore information on this project as well as news, support, and discussions can be found on the projects official website located at:\n\n https://www.adsbreceiver.net\n\nWould you like to continue setup?" 14 78
- CONTINUE_SETUP=$?
- if [[ "${CONTINUE_SETUP}" = 1 ]] ; then
- # Setup has been halted by the user.
- echo -e ""
- echo -e "\e[91m \e[5mSETUP HALTED!\e[25m"
- echo -e " Setup has been halted at the request of the user."
- echo -e "\e[37m"
- read -p "Press enter to continue..." CONTINUE
- exit 1
- fi
+whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "The ADS-B Receiver Project" --yesno "Thanks for choosing The ADS-B Receiver Project to setup your receiver.\n\nMore information on this project as well as news, support, and discussions can be found on the projects official website located at:\n\n https://www.adsbreceiver.net\n\nWould you like to continue setup?" 14 78
+CONTINUE_SETUP=$?
+if [[ "${CONTINUE_SETUP}" = 1 ]] ; then
+# Setup has been halted by the user.
+ echo -e ""
+ echo -e "\e[91m \e[5mSETUP HALTED!\e[25m"
+ echo -e " Setup has been halted at the request of the user."
+ echo -e "\e[37m"
+ read -p "Press enter to continue..." CONTINUE
+ exit 1
fi
## UPDATE THE REPOSITORY
@@ -214,13 +200,12 @@ fi
## ASK IF OPERATING SYSTEM SHOULD BE UPDATED
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Operating System Updates" --yesno "It is recommended that you update your system before building and/or installing any ADS-B receiver related packages. This script can do this for you at this time if you like.\n\nWould you like to update your operating system now?" 11 78
- case $? in
- 0) UPDATE_OPERATING_SYSTEM="true" ;;
- 1) UPDATE_OPERATING_SYSTEM="false" ;;
- esac
-fi
+whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Operating System Updates" --yesno "It is recommended that you update your system before building and/or installing any ADS-B receiver related packages. This script can do this for you at this time if you like.\n\nWould you like to update your operating system now?" 11 78
+case $? in
+ 0) UPDATE_OPERATING_SYSTEM="true" ;;
+ 1) UPDATE_OPERATING_SYSTEM="false" ;;
+esac
+
if [[ "${UPDATE_OPERATING_SYSTEM}" = "true" ]] ; then
UpdateOperatingSystem
fi
@@ -244,9 +229,7 @@ fi
## INSTALLATION COMPLETE
# Display the installation complete message box.
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
- whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Software Installation Complete" --msgbox "INSTALLATION COMPLETE\n\nDO NOT DELETE THIS DIRECTORY!\n\nFiles needed for certain items to run properly are contained within this directory. Deleting this directory may result in your receiver not working properly.\n\nHopefully, these scripts and files were found useful while setting up your ADS-B Receiver. Feedback regarding this software is always welcome. If you have any issues or wish to submit feedback, feel free to do so on GitHub.\n\n https://github.com/jprochazka/adsb-receiver" 20 65
-fi
+whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Software Installation Complete" --msgbox "INSTALLATION COMPLETE\n\nDO NOT DELETE THIS DIRECTORY!\n\nFiles needed for certain items to run properly are contained within this directory. Deleting this directory may result in your receiver not working properly.\n\nHopefully, these scripts and files were found useful while setting up your ADS-B Receiver. Feedback regarding this software is always welcome. If you have any issues or wish to submit feedback, feel free to do so on GitHub.\n\n https://github.com/jprochazka/adsb-receiver" 20 65
echo -e "\e[32m"
echo -e "\e[91m Installation complete."
diff --git a/bash/main.sh b/bash/main.sh
index dbfb8983..705788d4 100755
--- a/bash/main.sh
+++ b/bash/main.sh
@@ -9,7 +9,7 @@
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
-# Copyright (c) 2015-2018 Joseph A. Prochazka #
+# Copyright (c) 2015-2024 Joseph A. Prochazka #
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy #
# of this software and associated documentation files (the "Software"), to deal #
@@ -31,22 +31,11 @@
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-### VARIABLES
-
-RECEIVER_ROOT_DIRECTORY="${PWD}"
-RECEIVER_BASH_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/bash"
-RECEIVER_BUILD_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/build"
-
## INCLUDE EXTERNAL SCRIPTS
source ${RECEIVER_BASH_DIRECTORY}/variables.sh
source ${RECEIVER_BASH_DIRECTORY}/functions.sh
-# Source the automated install configuration file if this is an automated installation.
-if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] && [[ -s "${RECEIVER_CONFIGURATION_FILE}" ]] ; then
- source ${RECEIVER_CONFIGURATION_FILE}
-fi
-
## Set the project title variable.
export RECEIVER_PROJECT_TITLE="The ADS-B Receiver Project v${PROJECT_VERSION} Installer"
@@ -55,15 +44,6 @@ export RECEIVER_PROJECT_TITLE="The ADS-B Receiver Project v${PROJECT_VERSION} In
## DECODERS
-# Execute the dump1090-mutability setup script.
-function InstallDump1090Mutability() {
- chmod +x ${RECEIVER_BASH_DIRECTORY}/decoders/dump1090-mutability.sh
- ${RECEIVER_BASH_DIRECTORY}/decoders/dump1090-mutability.sh
- if [[ $? -ne 0 ]] ; then
- exit 1
- fi
-}
-
# Execute the dump1090-fa setup script.
function InstallDump1090Fa() {
chmod +x ${RECEIVER_BASH_DIRECTORY}/decoders/dump1090-fa.sh
@@ -73,28 +53,10 @@ function InstallDump1090Fa() {
fi
}
-# Execute the dump1090-hptoa setup script.
-function InstallDump1090Hptoa() {
- chmod +x ${RECEIVER_BASH_DIRECTORY}/decoders/dump1090-hptoa.sh
- ${RECEIVER_BASH_DIRECTORY}/decoders/dump1090-hptoa.sh
- if [[ $? -ne 0 ]] ; then
- exit 1
- fi
-}
-
# Execute the dump978 setup script.
-function InstallDump978() {
- chmod +x ${RECEIVER_BASH_DIRECTORY}/decoders/dump978.sh
- ${RECEIVER_BASH_DIRECTORY}/decoders/dump978.sh
- if [[ $? -ne 0 ]] ; then
- exit 1
- fi
-}
-
-# Execute the RTL-SDR OGN setup script.
-function InstallRtlsdrOgn() {
- chmod +x ${RECEIVER_BASH_DIRECTORY}/decoders/rtlsdr-ogn.sh
- ${RECEIVER_BASH_DIRECTORY}/decoders/rtlsdr-ogn.sh
+function InstallDump978Fa() {
+ chmod +x ${RECEIVER_BASH_DIRECTORY}/decoders/dump978-fa.sh
+ ${RECEIVER_BASH_DIRECTORY}/decoders/dump978-fa.sh
if [[ $? -ne 0 ]] ; then
exit 1
fi
@@ -111,15 +73,6 @@ function InstallAdsbExchange() {
fi
}
-# Execute the ADSBHub setup script.
-function InstallAdsbhub() {
- chmod +x ${RECEIVER_BASH_DIRECTORY}/feeders/adsbhub.sh
- ${RECEIVER_BASH_DIRECTORY}/feeders/adsbhub.sh
- if [[ $? -ne 0 ]] ; then
- exit 1
- fi
-}
-
# Execute the Flightradar24 Feeder client setup script.
function InstallFlightradar24() {
chmod +x ${RECEIVER_BASH_DIRECTORY}/feeders/flightradar24.sh
@@ -169,15 +122,6 @@ function InstallWebPortal() {
## Extras
-# Execute the AboveTustin setup script.
-function InstallAboveTustin() {
- chmod +x ${RECEIVER_BASH_DIRECTORY}/extras/abovetustin.sh
- ${RECEIVER_BASH_DIRECTORY}/extras/abovetustin.sh
- if [[ $? -ne 0 ]] ; then
- exit 1
- fi
-}
-
# Execute the beast-splitter setup script.
function InstallBeastSplitter() {
chmod +x ${RECEIVER_BASH_DIRECTORY}/extras/beeastsplitter.sh
@@ -201,69 +145,13 @@ function InstallDuckDns() {
## Decoders
-# Check if the dump1090-mutability package is installed.
-if [[ $(dpkg-query -W -f='${STATUS}' dump1090-mutability 2>/dev/null | grep -c "ok installed") -eq 1 ]] ; then
- DUMP1090_FORK="mutability"
- DUMP1090_IS_INSTALLED="true"
- # Skip over this dialog if this installation is set to be automated.
- if [[ ! "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] ; then
- # Ask if dump1090-mutability should be reinstalled.
- whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Dump1090-mutability Installed" --defaultno --yesno "The dump1090-mutability package appears to be installed on your device, however...\n\nThe dump1090-mutability v1.15~dev source code is regularly updated without a change made to the version numbering.\n\nTo ensure you are running the latest version of dump1090-mutability you may opt to rebuild and reinstall this package.\n\nDownload, build, and reinstall this package?" 17 65
- case $? in
- 0)
- DUMP1090_DO_UPGRADE="true"
- ;;
- 1)
- DUMP1090_DO_UPGRADE="false"
- ;;
- esac
- else
- # Refer to the installation configuration to decide if dump1090-mutability is to be reinstalled or not.
- if [[ "${DUMP1090_UPGRADE}" = "true" ]] ; then
- DUMP1090_DO_UPGRADE="true"
- else
- DUMP1090_DO_UPGRADE="false"
- fi
- fi
-fi
-
# Check if the dump1090-fa package is installed.
if [[ $(dpkg-query -W -f='${STATUS}' dump1090-fa 2>/dev/null | grep -c "ok installed") -eq 1 ]] ; then
DUMP1090_FORK="fa"
DUMP1090_IS_INSTALLED="true"
# Check if a newer version can be installed.
- if [[ $(sudo dpkg -s dump1090-fa 2>/dev/null | grep -c "Version: ${PIAWARE_VERSION}") -eq 0 ]] ; then
- # Skip over this dialog if this installation is set to be automated.
- if [[ ! "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] ; then
- whiptail --backtitle "RECEIVER_PROJECT_TITLE" --title "Dump1090-fa Upgrade Available" --defaultno --yesno "An updated version of dump1090-fa is available.\n\nWould you like to download, build, then install the new version?" 16 65
- case $? in
- 0)
- DUMP1090_DO_UPGRADE="true"
- ;;
- 1)
- DUMP1090_DO_UPGRADE="false"
- ;;
- esac
- else
- # If a newer version of dump1090-fa is available refer to the installation configuration to decide if it should be upgraded or not.
- if [[ "${DUMP1090_UPGRADE}" = "true" ]] ; then
- DUMP1090_DO_UPGRADE="true"
- else
- DUMP1090_DO_UPGRADE="false"
- fi
- fi
- fi
-fi
-
-# Check if dump1090-hptoa is being used.
-if [ -f ${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa/dump1090-hptoa/build/dump1090 ] && [ -f ${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa/dump1090-hptoa/build/faup1090 ] && [ -f ${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa/dump1090-hptoa/build/view1090 ] && [ -f /etc/init.d/dump1090 ] ; then
- DUMP1090_FORK="hptoa"
- DUMP1090_IS_INSTALLED="true"
- # Skip over this dialog if this installation is set to be automated.
- if [[ ! "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] ; then
- # Ask if dump1090-hptoa should be reinstalled.
- whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Dump1090-hptoa Installed" --defaultno --yesno "The dump1090-hptoa package appears to be installed on your device, however...\n\nThe dump1090-hptoa source code may have been updated recently.\n\nTo ensure you are running the latest version of dump1090-hptoa you may opt to rebuild these binaries.\n\nDownload and rebuild dump1090-hptoa from source?" 17 65
-
+ if [[ $(sudo dpkg -s dump1090-fa 2>/dev/null | grep -c "Version: ${DUMP1090_FA_VERSION}") -eq 0 ]] ; then
+ whiptail --backtitle "RECEIVER_PROJECT_TITLE" --title "Dump1090-fa Upgrade Available" --defaultno --yesno "An updated version of dump1090-fa is available.\n\nWould you like to download, build, then install the new version?" 16 65
case $? in
0)
DUMP1090_DO_UPGRADE="true"
@@ -272,62 +160,35 @@ if [ -f ${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa/dump1090-hptoa/build/dump109
DUMP1090_DO_UPGRADE="false"
;;
esac
- else
- # Refer to the installation configuration to decide if dump1090-hptoa is to be reinstalled or not.
- if [[ "${DUMP1090_UPGRADE}" = "true" ]] ; then
- DUMP1090_DO_UPGRADE="true"
- else
- DUMP1090_DO_UPGRADE="false"
- fi
fi
fi
# If no dump1090 fork is installed then attempt to install one.
if [[ ! "${DUMP1090_IS_INSTALLED}" = "true" ]] ; then
- # If this is not an automated installation ask the user which one to install.
- if [[ ! "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] ; then
- DUMP1090_OPTION=$(whiptail --nocancel --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Choose Dump1090 Version To Install" --radiolist "Dump1090 does not appear to be present on this device. In order to continue setup dump1090 will need to exist on this device. Please select your prefered dump1090 version from the list below.\n\nPlease note that in order to run dump1090-fa PiAware will need to be installed as well." 16 65 3 "dump1090-mutability" "(Mutability)" ON "dump1090-fa" "(FlightAware)" OFF "dump1090-hptoa" "(OpenSky Network)" OFF 3>&1 1>&2 2>&3)
- case ${DUMP1090_OPTION} in
- "dump1090-mutability")
- DUMP1090_FORK="mutability"
- DUMP1090_DO_INSTALL="true"
- ;;
- "dump1090-fa")
- DUMP1090_FORK="fa"
- DUMP1090_DO_INSTALL="true"
- ;;
- "dump1090-hptoa")
- DUMP1090_FORK="hptoa"
- DUMP1090_DO_INSTALL="true"
- ;;
- *)
- DUMP1090_DO_INSTALL="false"
- ;;
- esac
- else
- # Refer to the installation configuration to check if a dump1090 fork has been specified
- if [[ "${DUMP1090_FORK}" = "mutability" ]] || [[ "${DUMP1090_FORK}" = "fa" ]] || [[ "${DUMP1090_FORK}" = "hptoa" ]] ; then
+ DUMP1090_OPTION=$(whiptail --nocancel --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Choose Dump1090 Version To Install" --radiolist "Dump1090 does not appear to be present on this device. In order to continue setup dump1090 will need to exist on this device. Please select your prefered dump1090 version from the list below.\n\nPlease note that in order to run dump1090-fa PiAware will need to be installed as well." 16 65 2 "dump1090-fa" "(FlightAware)" ON 3>&1 1>&2 2>&3)
+ case ${DUMP1090_OPTION} in
+ "dump1090-fa")
+ DUMP1090_FORK="fa"
DUMP1090_DO_INSTALL="true"
- else
+ ;;
+ *)
DUMP1090_DO_INSTALL="false"
- fi
- fi
+ ;;
+ esac
fi
# If the FlightAware fork of dump1090 is or has been chosen to be installed PiAware must be installed.
-if [[ "${DUMP1090_FORK}" = "fa" ]] ; then
- if [[ "${DUMP1090_DO_INSTALL}" = "true" ]] || [[ "${DUMP1090_DO_UPGRADE}" = "true" ]] ; then
- FORCE_PIAWARE_INSTALL="true"
- fi
+if [[ "${DUMP1090_FORK}" = "fa" && "${DUMP1090_DO_INSTALL}" = "true" || "${DUMP1090_DO_UPGRADE}" = "true" ]]; then
+ FORCE_PIAWARE_INSTALL="true"
fi
-# Check if the dump978 binaries exist.
-if [[ -f "${RECEIVER_BUILD_DIRECTORY}/dump978/dump978" ]] && [[ -f "${RECEIVER_BUILD_DIRECTORY}/dump978/uat2text" ]] && [[ -f "${RECEIVER_BUILD_DIRECTORY}/dump978/uat2esnt" ]] && [[ -f "${RECEIVER_BUILD_DIRECTORY}/dump978/uat2json" ]] ; then
- # Dump978 appears to have been built already.
+# Check if the dump978-fa package is installed.
+if [[ $(dpkg-query -W -f='${STATUS}' dump978-fa 2>/dev/null | grep -c "ok installed") -eq 1 ]]; then
+ # Dump978 appears to be present on this device.
+ DUMP978_FORK="fa"
DUMP978_IS_INSTALLED="true"
- # Prompt user to confirm if a rebuild is required.
- if [[ ! "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] ; then
- whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Dump978 Installed" --defaultno --yesno "Dump978 appears to be installed on your device, however...\n\nThe dump978 source code may have been updated since it was built last. To ensure you are running the latest version of dump978 you may opt to rebuild the binaries making up dump978.\n\nDownload and rebuild the dump978 binaries?" 14 65
+ if [[ $(sudo dpkg -s dump978-fa 2>/dev/null | grep -c "Version: ${DUMP978_FA_VERSION}") -eq 0 ]]; then
+ whiptail --backtitle "RECEIVER_PROJECT_TITLE" --title "Dump978-fa Upgrade Available" --defaultno --yesno "An updated version of dump978-fa is available.\n\nWould you like to download, build, then install the new version?" 16 65
case $? in
0)
DUMP978_DO_UPGRADE="true"
@@ -336,94 +197,19 @@ if [[ -f "${RECEIVER_BUILD_DIRECTORY}/dump978/dump978" ]] && [[ -f "${RECEIVER_B
DUMP978_DO_UPGRADE="false"
;;
esac
- else
- # Refer to the installation configuration to decide if dump978 is to be rebuilt from source or not.
- if [[ "${DUMP978_UPGRADE}" = "true" ]] ; then
- DUMP978_DO_UPGRADE="true"
- else
- DUMP978_DO_UPGRADE="false"
- fi
fi
else
# Dump978 does not appear to be present on this device.
DUMP978_IS_INSTALLED="false"
- # Prompt user to confirm if installation is required.
- if [[ ! "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] ; then
- whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Dump978 Not Installed" --defaultno --yesno "Dump978 is an experimental demodulator/decoder for 978MHz UAT signals. These scripts can setup dump978 for you. However keep in mind a second RTL-SDR device will be required to feed data to it.\n\nDo you wish to install dump978?" 10 65
- case $? in
- 0)
- DUMP978_DO_INSTALL="true"
- ;;
- 1)
- DUMP978_DO_INSTALL="false"
- ;;
- esac
- else
- # Refer to the installation configuration to decide if dump978 is to be installed from source or not.
- if [[ "${DUMP978_INSTALL}" = "true" ]] ; then
+ whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Dump978-fa Not Installed" --defaultno --yesno "Dump978 is an experimental demodulator/decoder for 978MHz UAT signals. These scripts can setup dump978 for you. However keep in mind a second RTL-SDR device will be required to feed data to it.\n\nDo you wish to install dump978?" 10 65
+ case $? in
+ 0)
DUMP978_DO_INSTALL="true"
- else
+ ;;
+ 1)
DUMP978_DO_INSTALL="false"
- fi
-
- fi
-fi
-
-# Check if the RTL-SDR OGN binaries exist on this device.
-if [[ -f "/etc/init.d/rtlsdr-ogn" ]] ; then
- RTLSDROGN_IS_INSTALLED="true"
- # Check if a newer version of the binaries are available.
- if [[ ! -d "${RECEIVER_BUILD_DIRECTORY}/rtlsdr-ogn/rtlsdr-ogn-${RTLSDROGN_VERSION}" ]] ; then
- # Prompt user to confirm if a rebuild is required.
- if [[ ! "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] ; then
- whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "RTL-SDR OGN Installed" --defaultno --yesno "A newer version of the RTL-SDR OGN binaries is available.\n\nWould you like to setup the newer binaries on this device?" 14 65
- case $? in
- 0)
- RTLSDROGN_DO_UPGRADE="true"
- ;;
- 1)
- RTLSDROGN_DO_UPGRADE="false"
- ;;
- esac
- else
- # Refer to the installation configuration to decide if RTL-SDR OGN is to be rebuilt from source or not.
- if [[ "${RTLSDROGN_UPGRADE}" = "true" ]] ; then
- RTLSDROGN_DO_UPGRADE="true"
- else
- RTLSDROGN_DO_UPGRADE="false"
- fi
- fi
- fi
-else
- # The RTL-SDR OGN binaries do not appear to exist on this device.
-
- # Support for Open Glider Network has been removed until the script has been rewritten to
- # utilize the updated software they supply in their GItHub repositories.
- #
- # https://github.com/glidernet
-
- RTLSDROGN_IS_INSTALLED="false"
- RTLSDROGN_DO_INSTALL="false"
-
- ## Prompt user to confirm if installation is required.
- #if [[ ! "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] ; then
- # whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "RTL-SDR OGN Not Installed" --defaultno --yesno "RTL-SDR OGN is a combined decoder and feeder for the Open Glider Network which focuses on tracking gilders and other GA aircraft equipped with FLARM, FLARM-compatible devices or OGN tracker.\n\nRTL-SDR OGN will require an additional RTL-SDR dongle to run.\nFLARM is most prevalent within Europe, but new receivers are welcome at any location.\n\nDo you wish to setup RTL-SDR OGN?" 10 65
- # case $? in
- # 0)
- # RTLSDROGN_DO_INSTALL="true"
- # ;;
- # 1)
- # RTLSDROGN_DO_INSTALL="false"
- # ;;
- # esac
- #else
- # # Refer to the installation configuration to decide if RTL-SDR OGN is to be installed.
- # if [[ "${RTLSDROGN_INSTALL}" = "true" ]] ; then
- # RTLSDROGN_DO_INSTALL="true"
- # else
- # RTLSDROGN_DO_INSTALL="false"
- # fi
- #fi
+ ;;
+ esac
fi
## Feeder Selection Menu
@@ -432,202 +218,122 @@ fi
declare array FEEDER_LIST
touch ${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES
-# Check if MLAT client has been installed to be used to feed ADS-B Exchange.
-if [[ $(dpkg-query -W -f='${STATUS}' mlat-client 2>/dev/null | grep -c "ok installed") -eq 1 ]] ; then
- # The mlat-client package appears to be installed.
- MLAT_CLIENT_IS_INSTALLED="true"
- MLAT_CLIENT_VERSION_AVAILABLE=$(echo ${MLAT_CLIENT_VERSION} | tr -cd '[:digit:]' | sed -e 's/^0//g')
- MLAT_CLIENT_VERSION_INSTALLED=$(sudo dpkg -s mlat-client 2>/dev/null | grep "^Version:" | awk '{print $2}' | tr -cd '[:digit:]' | sed -e 's/^0//g')
- # Check if installed mlat-client matches the available version.
- if [[ ! "${MLAT_CLIENT_VERSION_AVAILABLE}" = "${MLAT_CLIENT_VERSION_INSTALLED}" ]] ; then
- # Prompt user to confirm the upgrade.
- if [[ ! "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] ; then
- # Add this choice to the FEEDER_LIST array to be used by the whiptail menu.
- FEEDER_LIST=("${FEEDER_LIST[@]}" 'ADS-B Exchange data export and MLAT Client (upgrade)' '' OFF)
- else
- # Check the installation configuration file to see if the mlat-client Client is to be upgraded.
- if [[ -z "${ADSBEXCHANGE_INSTALL}" ]] && [[ "${ADSBEXCHANGE_INSTALL}" = "true" ]] && [[ -z "${ADSBEXCHANGE_UPGRADE}" ]] && [[ "${ADSBEXCHANGE_UPGRADE}" = "true" ]] ; then
- # Since the menu will be skipped add this choice directly to the FEEDER_CHOICES file.
- echo "ADS-B Exchange data export and MLAT Client (upgrade)" >> ${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES
- fi
- fi
- fi
+# Check if the ADS-B Exchange feeder has been set up.
+if [[ -f /lib/systemd/system/adsbexchange-mlat.service && -f /lib/systemd/system/adsbexchange-feed.service ]]; then
+ # The feeder appears to be set up.
+ echo "ADS-B Exchange Feeder (upgrade)" >> ${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES
+ FEEDER_LIST=("${FEEDER_LIST[@]}" 'ADS-B Exchange Feeder (upgrade)' '' OFF)
else
- # The mlat-client package does not appear to be installed.
- MLAT_CLIENT_IS_INSTALLED="false"
- if [[ ! "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] ; then
- # Add this choice to the FEEDER_LIST array to be used by the whiptail menu.
- FEEDER_LIST=("${FEEDER_LIST[@]}" 'ADS-B Exchange data export and MLAT Client' '' OFF)
- else
- # Check the installation configuration file to see if ADS-B Exchange feeding is to be setup.
- if [[ -z "${ADSBEXCHANGE_INSTALL}" ]] && [[ "${ADSBEXCHANGE_INSTALL}" = "true" ]] ; then
- # Since the menu will be skipped add this choice directly to the FEEDER_CHOICES file.
- echo "ADS-B Exchange data export and MLAT Client" >> ${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES
- fi
- fi
-fi
-
-# Check if the ADSBHub client script has been set up.
-if ! grep -q "${BUILDDIR}/adsbexchange/adsbexchange-maint.sh &" /etc/rc.local; then
- # The ADSBHub client script does not appear to be executed on start up.
- if [[ ! "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] ; then
- # Add this choice to the FEEDER_LIST array to be used by the whiptail menu.
- FEEDER_LIST=("${FEEDER_LIST[@]}" 'ADSBHub Client Script' '' OFF)
- else
- # Check the installation configuration file to see if the ADSBHub client is to be installed.
- if [[ -z "${ADSBHUB_INSTALL}" ]] && [[ "${ADSBHUB_INSTALL}" = "true" ]] ; then
- # Since the menu will be skipped add this choice directly to the FEEDER_CHOICES file.
- echo "ADSBHub Client Script" >> ${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES
- fi
- fi
+ # The feeder does not appear to be set up.
+ echo "ADS-B Exchange Feeder" >> ${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES
+ FEEDER_LIST=("${FEEDER_LIST[@]}" 'ADS-B Exchange Feeder' '' OFF)
fi
# Check for the OpenSky Network package.
-if [[ $(dpkg-query -W -f='${STATUS}' opensky-feeder 2>/dev/null | grep -c "ok installed") -eq 0 ]] ; then
+if [[ $(dpkg-query -W -f='${STATUS}' opensky-feeder 2>/dev/null | grep -c "ok installed") -eq 0 ]]; then
# The OpenSky Network feeder package appears to not be installed.
- if [[ ! "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] ; then
- # Add this choice to the FEEDER_LIST array to be used by the whiptail menu.
- FEEDER_LIST=("${FEEDER_LIST[@]}" 'OpenSky Network Feeder' '' OFF)
+ FEEDER_LIST=("${FEEDER_LIST[@]}" 'OpenSky Network Feeder' '' OFF)
+else
+ # Check if a newer version can be installed if this is not a Raspberry Pi device.
+ if [[ $(sudo dpkg -s opensky-feeder 2>/dev/null | grep -c "Version: ${OPENSKY_NETWORK_CLIENT_VERSION}") -eq 0 ]]; then
+ FEEDER_LIST=("${FEEDER_LIST[@]}" 'OpenSky Network Feeder (upgrade)' '' OFF)
else
- # Check the installation configuration file to see if the OpenSky Network package is to be installed.
- if [[ -z "${OPENSKY_NETWORK_INSTALL}" ]] && [[ "${OPENSKY_NETWORK_INSTALL}" = "true" ]] ; then
- # Since the menu will be skipped add this choice directly to the FEEDER_CHOICES file.
- echo "OpenSky Network Feeder" >> ${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES
- fi
+ FEEDER_LIST=("${FEEDER_LIST[@]}" 'OpenSky Network Feeder (reinstall)' '' OFF)
fi
fi
# Check for the PiAware package.
-if [[ $(dpkg-query -W -f='${STATUS}' piaware 2>/dev/null | grep -c "ok installed") -eq 0 ]] ; then
+if [[ $(dpkg-query -W -f='${STATUS}' piaware 2>/dev/null | grep -c "ok installed") -eq 0 ]]; then
# Do not show the PiAware install option if the FlightAware fork of dump1090 has been chosen.
if [[ "${DUMP1090_FORK}" != "fa" ]] ; then
- # The PiAware package appears to not be installed.
- if [[ ! "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] ; then
- # Add this choice to the FEEDER_LIST array to be used by the whiptail menu.
- FEEDER_LIST=("${FEEDER_LIST[@]}" 'FlightAware PiAware' '' OFF)
- else
- # Check the installation configuration file to see if PiAware is to be installed.
- if [[ -z "${PIAWARE_INSTALL}" ]] && [[ "${PIAWARE_INSTALL}" = "true" ]] ; then
- # Since the menu will be skipped add this choice directly to the FEEDER_CHOICES file.
- echo "FlightAware PiAware" >> ${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES
- fi
+ if [[ -z "${PIAWARE_INSTALL}" && "${PIAWARE_INSTALL}" = "true" ]]; then
+ echo "FlightAware PiAware" >> ${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES
fi
fi
else
# Check if a newer version can be installed.
- if [[ $(sudo dpkg -s piaware 2>/dev/null | grep -c "Version: ${PIAWARE_VERSION}") -eq 0 ]] ; then
- if [[ ! "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] ; then
- # Add this choice to the FEEDER_LIST array to be used by the whiptail menu.
- FEEDER_LIST=("${FEEDER_LIST[@]}" 'FlightAware PiAware (upgrade)' '' OFF)
- else
- # Check the installation configuration file to see if PiAware is to be upgraded.
- if [[ -z "${PIAWARE_INSTALL}" ]] && [[ "${PIAWARE_INSTALL}" = "true" ]] && [[ -z "${PIAWARE_UPGRADE}" ]] && [[ "${PIAWARE_UPGRADE}" = "true" ]] ; then
- # Since the menu will be skipped add this choice directly to the FEEDER_CHOICES file.
- echo "FlightAware PiAware (upgrade)" >> ${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES
- fi
- fi
+ if [[ $(sudo dpkg -s piaware 2>/dev/null | grep -c "Version: ${PIAWARE_VERSION}") -eq 0 ]]; then
+ FEEDER_LIST=("${FEEDER_LIST[@]}" 'FlightAware PiAware (upgrade)' '' OFF)
+ else
+ FEEDER_LIST=("${FEEDER_LIST[@]}" 'FlightAware PiAware (reinstall)' '' OFF)
fi
fi
# Check for the Flightradar24 Feeder Client package.
-if [[ $(dpkg-query -W -f='${STATUS}' fr24feed 2>/dev/null | grep -c "ok installed") -eq 0 ]] ; then
- # The Flightradar24 client package does not appear to be installed.
- if [[ ! "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] ; then
- # Add this choice to the FEEDER_LIST array to be used by the whiptail menu.
- FEEDER_LIST=("${FEEDER_LIST[@]}" 'Flightradar24 Client' '' OFF)
- else
- # Check the installation configuration file to see if the Flightradar24 Client is to be installed.
- if [[ -z "${FLIGHTRADAR_INSTALL}" ]] && [[ "${FLIGHTRADAR_INSTALL}" = "true" ]] ; then
- # Since the menu will be skipped add this choice directly to the FEEDER_CHOICES file.
- echo "Flightradar24 Client" >> ${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES
- fi
- fi
+if [[ $(dpkg-query -W -f='${STATUS}' fr24feed 2>/dev/null | grep -c "ok installed") -eq 0 ]]; then
+ # Add this choice to the FEEDER_LIST array to be used by the whiptail menu.
+ FEEDER_LIST=("${FEEDER_LIST[@]}" 'Flightradar24 Client' '' OFF)
else
# Check if a newer version can be installed if this is not a Raspberry Pi device.
- if [[ "${CPU_ARCHITECTURE}" != "armv7l" ]] ; then
- if [[ $(sudo dpkg -s fr24feed 2>/dev/null | grep -c "Version: ${FLIGHTRADAR24_CLIENT_VERSION_I386}") -eq 0 ]] ; then
- if [[ ! "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] ; then
- # Add this choice to the FEEDER_LIST array to be used by the whiptail menu.
- FEEDER_LIST=("${FEEDER_LIST[@]}" 'Flightradar24 Client (upgrade)' '' OFF)
- else
- # Check the installation configuration file to see if the Flightradar24 Client is to be upgraded.
- if [[ -z "${FLIGHTRADAR_INSTALL}" ]] && [[ "${FLIGHTRADAR_INSTALL}" = "true" ]] && [[ -z "${FLIGHTRADAR_UPGRADE}" ]] && [[ "${FLIGHTRADAR_UPGRADE}" = "true" ]] ; then
- # Since the menu will be skipped add this choice directly to the FEEDER_CHOICES file.
- echo "Flightradar24 Client (upgrade)" >> ${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES
- fi
- fi
- fi
+ if [[ $(sudo dpkg -s fr24feed 2>/dev/null | grep -c "Version: ${FLIGHTRADAR24_CLIENT_VERSION_I386}") -eq 0 ]]; then
+ # Add this choice to the FEEDER_LIST array to be used by the whiptail menu.
+ FEEDER_LIST=("${FEEDER_LIST[@]}" 'Flightradar24 Client (upgrade)' '' OFF)
+ else
+ FEEDER_LIST=("${FEEDER_LIST[@]}" 'Flightradar24 Client (reinstall)' '' OFF)
fi
fi
# Check for the Planefinder ADS-B Client package.
-if [[ $(dpkg-query -W -f='${STATUS}' pfclient 2>/dev/null | grep -c "ok installed") -eq 0 ]] ; then
+if [[ $(dpkg-query -W -f='${STATUS}' pfclient 2>/dev/null | grep -c "ok installed") -eq 0 ]]; then
# The Planefinder Client package does not appear to be installed.
- if [[ ! "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] ; then
- # Add this choice to the FEEDER_LIST array to be used by the whiptail menu.
- FEEDER_LIST=("${FEEDER_LIST[@]}" 'Plane Finder Client' '' OFF)
- else
- # Check the installation configuration file to see if the Plane Finder Client is to be installed.
- if [[ -z "${PLANEFINDER_INSTALL}" ]] && [[ "${PLANEFINDER_INSTALL}" = "true" ]] ; then
- # Since the menu will be skipped add this choice directly to the FEEDER_CHOICES file.
- echo "Plane Finder Client" >> ${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES
- fi
- fi
+ FEEDER_LIST=("${FEEDER_LIST[@]}" 'Plane Finder Client' '' OFF)
else
# Check if a newer version can be installed.
- if [[ "${CPU_ARCHITECTURE}" = "armv7l" ]] ; then
- if [[ ! $(sudo dpkg -s pfclient | grep Version | awk '{print $2}') == "$PLANEFINDER_CLIENT_VERSION_ARM" ]] ; then
- if [[ ! "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] ; then
- # Add this choice to the FEEDER_LIST array to be used by the whiptail menu.
+ PLANEFINDER_CLIENT_INSTALLED_VERSION=$(sudo dpkg -s pfclient | grep Version | awk '{print $2}')
+ case "${CPU_ARCHITECTURE}" in
+ "armv7l"|"armv6l")
+ if [[ ! "$PLANEFINDER_CLIENT_INSTALLED_VERSION" = "${PLANEFINDER_CLIENT_VERSION_ARMHF}" ]]; then
FEEDER_LIST=("${FEEDER_LIST[@]}" 'Plane Finder Client (upgrade)' '' OFF)
else
- # Check the installation configuration file to see if the Planefinder Client is to be upgraded.
- if [[ -z "${PLANEFINDER_INSTALL}" ]] && [[ "${PLANEFINDER_INSTALL}" = "true" ]] && [[ -z "${PLANEFINDER_UPGRADE}" ]] && [[ "${PLANEFINDER_UPGRADE}" = "true" ]] ; then
- # Since the menu will be skipped add this choice directly to the FEEDER_CHOICES file.
- echo "Plane Finder Client (upgrade)" >> ${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES
- fi
+ FEEDER_LIST=("${FEEDER_LIST[@]}" 'Plane Finder Client (reinstall)' '' OFF)
fi
- fi
- else
- if [[ ! $(sudo dpkg -s pfclient | grep Version | awk '{print $2}') == "$PLANEFINDER_CLIENT_VERSION_I386" ]] ; then
- if [[ ! "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] ; then
- # Add this choice to the FEEDER_LIST array to be used by the whiptail menu.
+ ;;
+ "aarch64")
+ if [[ ! "$PLANEFINDER_CLIENT_INSTALLED_VERSION" = "${PLANEFINDER_CLIENT_VERSION_ARM64}" ]]; then
FEEDER_LIST=("${FEEDER_LIST[@]}" 'Plane Finder Client (upgrade)' '' OFF)
else
- # Check the installation configuration file to see if the Planefinder Client is to be upgraded.
- if [[ -z "${PLANEFINDER_INSTALL}" ]] && [[ "${PLANEFINDER_INSTALL}" = "true" ]] && [[ -z "${PLANEFINDER_UPGRADE}" ]] && [[ "${PLANEFINDER_UPGRADE}" = "true" ]] ; then
- # Since the menu will be skipped add this choice directly to the FEEDER_CHOICES file.
- echo "Plane Finder Client (upgrade)" >> ${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES
- fi
+ FEEDER_LIST=("${FEEDER_LIST[@]}" 'Plane Finder Client (reinstall)' '' OFF)
fi
- fi
- fi
+ ;;
+ "x86_64")
+ if [[ ! "$PLANEFINDER_CLIENT_INSTALLED_VERSION" = "${PLANEFINDER_CLIENT_VERSION_AMD64}" ]]; then
+ FEEDER_LIST=("${FEEDER_LIST[@]}" 'Plane Finder Client (upgrade)' '' OFF)
+ else
+ FEEDER_LIST=("${FEEDER_LIST[@]}" 'Plane Finder Client (reinstall)' '' OFF)
+ fi
+ ;;
+ "i386")
+ if [[ ! "$PLANEFINDER_CLIENT_INSTALLED_VERSION" = "${PLANEFINDER_CLIENT_VERSION_I386}" ]]; then
+ FEEDER_LIST=("${FEEDER_LIST[@]}" 'Plane Finder Client (upgrade)' '' OFF)
+ else
+ FEEDER_LIST=("${FEEDER_LIST[@]}" 'Plane Finder Client (reinstall)' '' OFF)
+ fi
+ ;;
+ *)
+ FEEDER_LIST=("${FEEDER_LIST[@]}" 'Plane Finder Client (reinstall)' '' OFF)
+ esac
fi
-if [[ ! "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] ; then
- if [[ -n "${FEEDER_LIST}" ]] ; then
- # Display a checklist containing feeders that are not installed if any.
- whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Feeder Installation Options" --checklist --nocancel --separate-output "The following feeders are available for installation.\nChoose the feeders you wish to install." 13 65 6 "${FEEDER_LIST[@]}" 2>${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES
- else
- # Since all available feeders appear to be installed inform the user of the fact.
- whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "All Feeders Installed" --msgbox "It appears that all the optional feeders available for installation by this script have been installed already." 8 65
- fi
+if [[ -n "${FEEDER_LIST}" ]] ; then
+ # Display a checklist containing feeders that are not installed if any.
+ whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Feeder Installation Options" --checklist --nocancel --separate-output "The following feeders are available for installation.\nChoose the feeders you wish to install." 13 65 6 "${FEEDER_LIST[@]}" 2>${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES
+else
+ # Since all available feeders appear to be installed inform the user of the fact.
+ whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "All Feeders Installed" --msgbox "It appears that all the optional feeders available for installation by this script have been installed already." 8 65
fi
## ADS-B Receiver Project Web Portal
-if [[ ! "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] ; then
- # Ask if the web portal should be installed.
- whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Install The ADS-B Receiver Project Web Portal" --yesno "The ADS-B Receiver Project Web Portal is a lightweight web interface for dump-1090-mutability installations.\n\nCurrent features include the following:\n Unified navigation between all web pages.\n System and dump1090 performance graphs.\n\nWould you like to install the ADS-B Receiver Project web portal?" 14 78
- case $? in
- 0)
- WEBPORTAL_DO_INSTALL="true"
- ;;
- 1)
- WEBPORTAL_DO_INSTALL="false"
- ;;
- esac
-fi
+# Ask if the web portal should be installed.
+whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Install The ADS-B Receiver Project Web Portal" --yesno "The ADS-B Receiver Project Web Portal is a lightweight web interface for dump-1090 installations.\n\nCurrent features include the following:\n Unified navigation between all web pages.\n System and dump1090 performance graphs.\n\nWould you like to install the ADS-B Receiver Project web portal?" 14 78
+case $? in
+ 0)
+ WEBPORTAL_DO_INSTALL="true"
+ ;;
+ 1)
+ WEBPORTAL_DO_INSTALL="false"
+ ;;
+esac
## Extras
@@ -635,95 +341,31 @@ fi
declare array EXTRAS_LIST
touch ${RECEIVER_ROOT_DIRECTORY}/EXTRAS_CHOICES
-# Check if the AboveTustin repository has been cloned.
-if [[ -d "${RECEIVER_BUILD_DIRECTORY}/AboveTustin" ]] && [[ -d "${RECEIVER_BUILD_DIRECTORY}/AboveTustin/.git" ]] ; then
- # The AboveTustin repository has been cloned to this device.
- if [[ ! "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] ; then
- # Add this choice to the EXTRAS_LIST array to be used by the whiptail menu.
- EXTRAS_LIST=("${EXTRAS_LIST[@]}" 'AboveTustin (reinstall)' '' OFF)
- else
- # Check the installation configuration file to see if AboveTustin is to be upgraded.
- if [[ -z "${ABOVETUSTIN_INSTALL}" ]] && [[ "${ABOVETUSTIN_INSTALL}" = "true" ]] && [[ -z "${ABOVETUSTIN_UPGRADE}" ]] && [[ "${ABOVETUSTIN_UPGRADE}" = "true" ]] ; then
- # Since the menu will be skipped add this choice directly to the EXTRAS_CHOICES file.
- echo "AboveTustin (reinstall)" >> ${RECEIVER_ROOT_DIRECTORY}/EXTRAS_CHOICES
- fi
- fi
-else
- # The AboveTustin repository has not been cloned to this device.
- if [[ ! "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] ; then
- # Add this choice to the EXTRAS_LIST array to be used by the whiptail menu.
- EXTRAS_LIST=("${EXTRAS_LIST[@]}" 'AboveTustin' '' OFF)
- else
- # Check the installation configuration file to see if AboveTustin is to be installed.
- if [[ -z "${ABOVETUSTIN_INSTALL}" ]] && [[ "${ABOVETUSTIN_INSTALL}" = "true" ]] ; then
- # Since the menu will be skipped add this choice directly to the EXTRAS_CHOICES file.
- echo "AboveTustin" >> ${RECEIVER_ROOT_DIRECTORY}/EXTRAS_CHOICES
- fi
- fi
-fi
-
# Check if the beast-splitter package is installed.
-if [[ $(dpkg-query -W -f='${STATUS}' beast-splitter 2>/dev/null | grep -c "ok installed") -eq 0 ]] ; then
+if [[ $(dpkg-query -W -f='${STATUS}' beast-splitter 2>/dev/null | grep -c "ok installed") -eq 0 ]]; then
# The beast-splitter package appears to not be installed.
- if [[ ! "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] ; then
- # Add this choice to the EXTRAS_LIST array to be used by the whiptail menu.
- EXTRAS_LIST=("${EXTRAS_LIST[@]}" 'beast-splitter' '' OFF)
- else
- # Check the installation configuration file to see if beast-splitter is to be installed.
- if [[ -z "${BEASTSPLITTER_INSTALL}" ]] && [[ "${BEASTSPLITTER_INSTALL}" = "true" ]] ; then
- # Since the menu will be skipped add this choice directly to the EXTRAS_CHOICES file.
- echo "beast-splitter" >> ${RECEIVER_ROOT_DIRECTORY}/EXTRAS_CHOICES
- fi
- fi
+ EXTRAS_LIST=("${EXTRAS_LIST[@]}" 'beast-splitter' '' OFF)
else
# Offer the option to build then reinstall the beast-splitter package.
- if [[ ! "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] ; then
- # Add this choice to the EXTRAS_LIST array to be used by the whiptail menu.
- EXTRAS_LIST=("${EXTRAS_LIST[@]}" 'beast-splitter (reinstall)' '' OFF)
- else
- if [[ -z "${BEASTSPLITTER_INSTALL}" ]] && [[ "${BEASTSPLITTER_INSTALL}" = "true" ]] && [[ -z "${BEASTSPLITTER_UPGRADE}" ]] && [[ "${BEASTSPLITTER_UPGRADE}" = "true" ]] ; then
- # Since the menu will be skipped add this choice directly to the EXTRAS_CHOICES file.
- echo "beast-splitter (reinstall)" >> ${RECEIVER_ROOT_DIRECTORY}/EXTRAS_CHOICES
- fi
- fi
+ EXTRAS_LIST=("${EXTRAS_LIST[@]}" 'beast-splitter (reinstall)' '' OFF)
fi
# Check if the Duck DNS update script exists.
-if [[ ! -f "${RECEIVER_BUILD_DIRECTORY}/duckdns/duck.sh" ]] ; then
+if [[ ! -f "${RECEIVER_BUILD_DIRECTORY}/duckdns/duck.sh" ]]; then
# Duck DNS does not appear to be set up on this device.
- if [[ ! "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] ; then
- # Add this choice to the EXTRAS_LIST array to be used by the whiptail menu.
- EXTRAS_LIST=("${EXTRAS_LIST[@]}" 'Duck DNS Free Dynamic DNS Hosting' '' OFF)
- else
- # Check the installation configuration file to see if Duck DNS dynamic DNS support is to be added.
- if [[ -z "${DUCKDNS_INSTALL}" ]] && [[ "${DUCKDNS_INSTALL}" = "true" ]] ; then
- # Since the menu will be skipped add this choice directly to the EXTRAS_CHOICES file.
- echo "Duck DNS Free Dynamic DNS Hosting" >> ${RECEIVER_ROOT_DIRECTORY}/EXTRAS_CHOICES
- fi
- fi
+ EXTRAS_LIST=("${EXTRAS_LIST[@]}" 'Duck DNS Free Dynamic DNS Hosting' '' OFF)
else
# Offer the option to install/setup Duck DNS once more.
- if [[ ! "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] ; then
- # Add this choice to the EXTRAS_LIST array to be used by the whiptail menu.
- EXTRAS_LIST=("${EXTRAS_LIST[@]}" 'Duck DNS Free Dynamic DNS Hosting (reinstall)' '' OFF)
- else
- if [[ -z "${DUCKDNS_INSTALL}" ]] && [[ "${DUCKDNS_INSTALL}" = "true" ]] && [[ -z "${DUCKDNS_UPGRADE}" ]] && [[ "${DUCKDNS_UPGRADE}" = "true" ]] ; then
- # Since the menu will be skipped add this choice directly to the EXTRAS_CHOICES file.
- echo "Duck DNS Free Dynamic DNS Hosting (reinstall)" >> ${RECEIVER_ROOT_DIRECTORY}/EXTRAS_CHOICES
- fi
- fi
+ EXTRAS_LIST=("${EXTRAS_LIST[@]}" 'Duck DNS Free Dynamic DNS Hosting (reinstall)' '' OFF)
fi
-
-if [[ ! "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] ; then
- # Display a menu the user can use to pick extras to be installed.
- if [[ -n "${EXTRAS_LIST}" ]] ; then
- # Display a checklist containing feeders that are not installed if any.
- whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Feeder Installation Options" --checklist --nocancel --separate-output "The following extras are available for installation, please select any which you wish to install." 13 65 4 "${EXTRAS_LIST[@]}" 2>${RECEIVER_ROOT_DIRECTORY}/EXTRAS_CHOICES
- else
- # Since all available extras appear to be installed inform the user of the fact.
- whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "All Extras Installed" --msgbox "It appears that all the optional extras available for installation by this script have been installed already." 8 65
- fi
+# Display a menu the user can use to pick extras to be installed.
+if [[ -n "${EXTRAS_LIST}" ]]; then
+ # Display a checklist containing feeders that are not installed if any.
+ whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Feeder Installation Options" --checklist --nocancel --separate-output "The following extras are available for installation, please select any which you wish to install." 13 65 4 "${EXTRAS_LIST[@]}" 2>${RECEIVER_ROOT_DIRECTORY}/EXTRAS_CHOICES
+else
+ # Since all available extras appear to be installed inform the user of the fact.
+ whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "All Extras Installed" --msgbox "It appears that all the optional extras available for installation by this script have been installed already." 8 65
fi
## Setup Confirmation
@@ -731,7 +373,7 @@ fi
declare CONFIRMATION
# Check if anything is to be done before moving on.
-if [[ "${DUMP1090_DO_INSTALL}" = "false" ]] && [[ "${DUMP1090_DO_UPGRADE}" = "false" ]] && [[ "${DUMP978_DO_INSTALL}" = "false" ]] && [[ "${DUMP978_DO_UPGRADE}" = "false" ]] && [[ "${RTLSDROGN_DO_INSTALL}" = "false" ]] && [[ "${RTLSDROGN_DO_UPGRADE}" = "false" ]] && [[ "${WEBPORTAL_DO_INSTALL}" = "false" ]] && [[ ! -s "${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES" ]] && [[ ! -s "${RECEIVER_ROOT_DIRECTORY}/EXTRAS_CHOICES" ]] ; then
+if [[ "${DUMP1090_DO_INSTALL}" = "false" && "${DUMP1090_DO_UPGRADE}" = "false" && "${DUMP978_DO_INSTALL}" = "false" && "${DUMP978_DO_UPGRADE}" = "false" && "${WEBPORTAL_DO_INSTALL}" = "false" && ! -s "${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES" && ! -s "${RECEIVER_ROOT_DIRECTORY}/EXTRAS_CHOICES" ]]; then
# Nothing was chosen to be installed.
whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Nothing to be done" --msgbox "Nothing has been selected to be installed so the script will exit now." 10 65
echo -e "\e[31m"
@@ -743,130 +385,59 @@ else
CONFIRMATION="The following software will be installed:\n"
# dump1090
- if [[ "${DUMP1090_DO_UPGRADE}" = "true" ]] ; then
+ if [[ "${DUMP1090_DO_UPGRADE}" = "true" ]]; then
case ${DUMP1090_FORK} in
- "mutability")
- CONFIRMATION="${CONFIRMATION}\n * dump1090-mutability (reinstall)"
- ;;
"fa")
CONFIRMATION="${CONFIRMATION}\n * dump1090-fa (upgrade)"
;;
- "hptoa")
- CONFIRMATION="${CONFIRMATION}\n * dump1090-hptoa (reinstall)"
- ;;
esac
- elif [[ "${DUMP1090_DO_INSTALL}" = "true" ]] ; then
+ elif [[ "${DUMP1090_DO_INSTALL}" = "true" ]]; then
case ${DUMP1090_FORK} in
- "mutability")
- CONFIRMATION="${CONFIRMATION}\n * dump1090-mutability"
- ;;
"fa")
CONFIRMATION="${CONFIRMATION}\n * dump1090-fa"
;;
- "hptoa")
- CONFIRMATION="${CONFIRMATION}\n * dump1090-hptoa"
- ;;
esac
fi
# dump978
- if [[ "${DUMP978_DO_UPGRADE}" = "true" ]] ; then
+ if [[ "${DUMP978_DO_UPGRADE}" = "true" ]]; then
CONFIRMATION="${CONFIRMATION}\n * dump978 (rebuild)"
- elif [[ "${DUMP978_DO_INSTALL}" = "true" ]] ; then
+ elif [[ "${DUMP978_DO_INSTALL}" = "true" ]]; then
CONFIRMATION="${CONFIRMATION}\n * dump978"
fi
- # RTL-SDR OGN
- if [[ "${RTLSDROGN_DO_UPGRADE}" = "true" ]] ; then
- CONFIRMATION="${CONFIRMATION}\n * RTL-SDR OGN (upgrade)"
- elif [[ "${RTLSDROGN_DO_INSTALL}" = "true" ]] ; then
- CONFIRMATION="${CONFIRMATION}\n * RTL-SDR OGN"
- fi
-
# If PiAware is required add it to the list.
- if [[ "${DUMP1090_FORK}" = "fa" ]] ; then
+ if [[ "${DUMP1090_FORK}" = "fa" && $(dpkg-query -W -f='${STATUS}' piaware 2>/dev/null | grep -c "ok installed") -eq 0 || "${PIAWARE_INSTALL}" = "true" ]]; then
CONFIRMATION="${CONFIRMATION}\n * FlightAware PiAware"
fi
- if [[ -s "${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES" ]] ; then
+ if [[ -s "${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES" ]]; then
while read FEEDER_CHOICE
do
- case ${FEEDER_CHOICE} in
- "ADS-B Exchange data export and MLAT Client")
- CONFIRMATION="${CONFIRMATION}\n * ADS-B Exchange data export and MLAT Client"
- ;;
- "ADS-B Exchange data export and MLAT Client (upgrade)")
- CONFIRMATION="${CONFIRMATION}\n * ADS-B Exchange data export and MLAT Client (upgrade)"
- ;;
- "ADSBHub Client Script")
- CONFIRMATION="${CONFIRMATION}\n * ADSBHub Client Script"
- ;;
- "FlightAware PiAware")
- CONFIRMATION="${CONFIRMATION}\n * FlightAware PiAware"
- ;;
- "FlightAware PiAware (upgrade)")
- CONFIRMATION="${CONFIRMATION}\n * FlightAware PiAware (upgrade)"
- ;;
- "Flightradar24 Client")
- CONFIRMATION="${CONFIRMATION}\n * Flightradar24 Client"
- ;;
- "Flightradar24 Client (upgrade)")
- CONFIRMATION="${CONFIRMATION}\n * Flightradar24 Client (upgrade)"
- ;;
- "OpenSky Network Feeder")
- CONFIRMATION="${CONFIRMATION}\n * OpenSky Network Feeder"
- ;;
- "Plane Finder Client")
- CONFIRMATION="${CONFIRMATION}\n * Plane Finder Client"
- ;;
- "Plane Finder Client (upgrade)")
- CONFIRMATION="${CONFIRMATION}\n * Plane Finder Client (upgrade)"
- ;;
- esac
+ CONFIRMATION="${CONFIRMATION}\n * ${FEEDER_CHOICE}"
done < ${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES
fi
- if [[ "${WEBPORTAL_DO_INSTALL}" = "true" ]] ; then
+ if [[ "${WEBPORTAL_DO_INSTALL}" = "true" ]]; then
CONFIRMATION="${CONFIRMATION}\n * ADS-B Receiver Project Web Portal"
fi
- if [[ -s "${RECEIVER_ROOT_DIRECTORY}/EXTRAS_CHOICES" ]] ; then
+ if [[ -s "${RECEIVER_ROOT_DIRECTORY}/EXTRAS_CHOICES" ]]; then
while read EXTRAS_CHOICE
do
- case ${EXTRAS_CHOICE} in
- "AboveTustin")
- CONFIRMATION="${CONFIRMATION}\n * AboveTustin"
- ;;
- "AboveTustin (reinstall)")
- CONFIRMATION="${CONFIRMATION}\n * AboveTustin (reinstall)"
- ;;
- "beast-splitter")
- CONFIRMATION="${CONFIRMATION}\n * beast-splitter"
- ;;
- "beast-splitter (reinstall)")
- CONFIRMATION="${CONFIRMATION}\n * beast-splitter (reinstall)"
- ;;
- "Duck DNS Free Dynamic DNS Hosting")
- CONFIRMATION="${CONFIRMATION}\n * Duck DNS Free Dynamic DNS Hosting"
- ;;
- "Duck DNS Free Dynamic DNS Hosting (reinstall)")
- CONFIRMATION="${CONFIRMATION}\n * Duck DNS Free Dynamic DNS Hosting (reinstall)"
- ;;
- esac
+ CONFIRMATION="${CONFIRMATION}\n * ${EXTRAS_CHOICE}"
done < ${RECEIVER_ROOT_DIRECTORY}/EXTRAS_CHOICES
fi
CONFIRMATION="${CONFIRMATION}\n\n"
fi
-if [[ ! "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] ; then
- # Ask for confirmation before moving on.
- CONFIRMATION="${CONFIRMATION}Do you wish to continue setup?"
- if ! (whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Confirm You Wish To Continue" --yesno "${CONFIRMATION}" 21 78) then
- echo -e "\e[31m"
- echo " Installation canceled by user."
- exit 1
- fi
+# Ask for confirmation before moving on.
+CONFIRMATION="${CONFIRMATION}Do you wish to continue setup?"
+if ! (whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Confirm You Wish To Continue" --yesno "${CONFIRMATION}" 21 78) then
+ echo -e "\e[31m"
+ echo " Installation canceled by user."
+ exit 1
fi
#################
@@ -874,26 +445,16 @@ fi
## Decoders
-if [[ "${DUMP1090_DO_INSTALL}" = "true" ]] || [[ "${DUMP1090_DO_UPGRADE}" = "true" ]] ; then
+if [[ "${DUMP1090_DO_INSTALL}" = "true" || "${DUMP1090_DO_UPGRADE}" = "true" ]]; then
case ${DUMP1090_FORK} in
- "mutability")
- InstallDump1090Mutability
- ;;
"fa")
InstallDump1090Fa
;;
- "hptoa")
- InstallDump1090Hptoa
- ;;
esac
fi
-if [[ "${DUMP978_DO_INSTALL}" = "true" ]] || [[ "${DUMP978_DO_UPGRADE}" = "true" ]] ; then
- InstallDump978
-fi
-
-if [[ "${RTLSDROGN_DO_INSTALL}" = "true" ]] || [[ "${RTLSDROGN_DO_UPGRADE}" = "true" ]] ; then
- InstallRtlsdrOgn
+if [[ "${DUMP978_DO_INSTALL}" = "true" || "${DUMP978_DO_UPGRADE}" = "true" ]]; then
+ InstallDump978Fa
fi
## Feeders
@@ -907,76 +468,65 @@ RUN_FLIGHTRADAR24_SCRIPT="false"
RUN_OPENSKYNETWORK_SCRIPT="false"
RUN_PLANEFINDER_SCRIPT="false"
-if [[ -s "${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES" ]] ; then
+if [[ -s "${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES" ]]; then
while read FEEDER_CHOICE
do
case ${FEEDER_CHOICE} in
- "ADS-B Exchange data export and MLAT Client"|"ADS-B Exchange data export and MLAT Client (upgrade)")
+ "ADS-B Exchange Feeder"|"ADS-B Exchange Feeder (upgrade)")
RUN_ADSBEXCHANGE_SCRIPT="true"
;;
- "ADSBHub Client Script")
- RUN_ADSBHUB_SCRIPT="true"
- ;;
- "FlightAware PiAware"|"FlightAware PiAware (upgrade)")
+ "FlightAware PiAware"|"FlightAware PiAware (upgrade)"|"FlightAware PiAware (reinstall)")
RUN_PIAWARE_SCRIPT="true"
;;
- "Flightradar24 Client"|"Flightradar24 Client (upgrade)")
+ "Flightradar24 Client"|"Flightradar24 Client (upgrade)"|"Flightradar24 Client (reinstall)")
RUN_FLIGHTRADAR24_SCRIPT="true"
;;
"OpenSky Network Feeder")
RUN_OPENSKYNETWORK_SCRIPT="true"
;;
- "Plane Finder Client"|"Plane Finder Client (upgrade)")
+ "Plane Finder Client"|"Plane Finder Client (upgrade)"|"Plane Finder Client (reinstall)")
RUN_PLANEFINDER_SCRIPT="true"
;;
esac
done < ${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES
fi
-if [[ "${RUN_ADSBEXCHANGE_SCRIPT}" = "true" ]] ; then
+if [[ "${RUN_ADSBEXCHANGE_SCRIPT}" = "true" ]]; then
InstallAdsbExchange
fi
-if [[ "${RUN_ADSBHUB_SCRIPT}" = "true" ]] ; then
- InstallAdsbhub
-fi
-
-if [[ "${RUN_PIAWARE_SCRIPT}" = "true" ]] || [[ "${FORCE_PIAWARE_INSTALL}" = "true" ]] ; then
+if [[ "${RUN_PIAWARE_SCRIPT}" = "true" || "${FORCE_PIAWARE_INSTALL}" = "true" ]]; then
InstallPiAware
fi
-if [[ "${RUN_FLIGHTRADAR24_SCRIPT}" = "true" ]] ; then
+if [[ "${RUN_FLIGHTRADAR24_SCRIPT}" = "true" ]]; then
InstallFlightradar24
fi
-if [[ "${RUN_OPENSKYNETWORK_SCRIPT}" = "true" ]] ; then
+if [[ "${RUN_OPENSKYNETWORK_SCRIPT}" = "true" ]]; then
InstallOpenSkyNetwork
fi
-if [[ "${RUN_PLANEFINDER_SCRIPT}" = "true" ]] ; then
+if [[ "${RUN_PLANEFINDER_SCRIPT}" = "true" ]]; then
InstallPlaneFinder
fi
## ADS-B Receiver Project Web Portal
-if [[ "${WEBPORTAL_DO_INSTALL}" = "true" ]] ; then
+if [[ "${WEBPORTAL_DO_INSTALL}" = "true" ]]; then
InstallWebPortal
fi
# Moved execution of functions outside of while loop.
# Inside the while loop the installation scripts are not stopping at reads.
-RUN_ABOVETUSTIN_SCRIPT="false"
RUN_BEASTSPLITTER_SCRIPT="false"
RUN_DUCKDNS_SCRIPT="false"
-if [[ -s "${RECEIVER_ROOT_DIRECTORY}/EXTRAS_CHOICES" ]] ; then
+if [[ -s "${RECEIVER_ROOT_DIRECTORY}/EXTRAS_CHOICES" ]]; then
while read EXTRAS_CHOICE
do
case ${EXTRAS_CHOICE} in
- "AboveTustin"|"AboveTustin (reinstall)")
- RUN_ABOVETUSTIN_SCRIPT="true"
- ;;
"beast-splitter"|"beast-splitter (reinstall)")
RUN_BEASTSPLITTER_SCRIPT="true"
;;
@@ -987,15 +537,11 @@ if [[ -s "${RECEIVER_ROOT_DIRECTORY}/EXTRAS_CHOICES" ]] ; then
done < ${RECEIVER_ROOT_DIRECTORY}/EXTRAS_CHOICES
fi
-if [[ "${RUN_ABOVETUSTIN_SCRIPT}" = "true" ]] ; then
- InstallAboveTustin
-fi
-
-if [[ "${RUN_BEASTSPLITTER_SCRIPT}" = "true" ]] ; then
+if [[ "${RUN_BEASTSPLITTER_SCRIPT}" = "true" ]]; then
InstallBeastSplitter
fi
-if [[ "${RUN_DUCKDNS_SCRIPT}" = "true" ]] ; then
+if [[ "${RUN_DUCKDNS_SCRIPT}" = "true" ]]; then
InstallDuckDns
fi
diff --git a/bash/portal/core.sh b/bash/portal/core.sh
index 12b55bb0..c3396237 100755
--- a/bash/portal/core.sh
+++ b/bash/portal/core.sh
@@ -9,7 +9,7 @@
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
-# Copyright (c) 2015-2018 Joseph A. Prochazka #
+# Copyright (c) 2015-2024 Joseph A. Prochazka #
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy #
# of this software and associated documentation files (the "Software"), to deal #
@@ -33,8 +33,6 @@
## VARIABLES
-RECEIVER_ROOT_DIRECTORY="${PWD}"
-RECEIVER_BUILD_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/build"
PORTAL_BUILD_DIRECTORY="${RECEIVER_BUILD_DIRECTORY}/portal"
PORTAL_PYTHON_DIRECTORY="${PORTAL_BUILD_DIRECTORY}/python"
diff --git a/bash/portal/graphs.sh b/bash/portal/graphs.sh
index 092d0771..f86de41e 100755
--- a/bash/portal/graphs.sh
+++ b/bash/portal/graphs.sh
@@ -9,7 +9,7 @@
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
-# Copyright (c) 2015-2018 Joseph A. Prochazka #
+# Copyright (c) 2015-2024 Joseph A. Prochazka #
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy #
# of this software and associated documentation files (the "Software"), to deal #
@@ -33,8 +33,6 @@
### VARIABLES
-RECEIVER_ROOT_DIRECTORY="${PWD}"
-RECEIVER_BUILD_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/build"
PORTAL_BUILD_DIRECTORY="${RECEIVER_BUILD_DIRECTORY}/portal"
COLLECTD_CONFIG="/etc/collectd/collectd.conf"
@@ -161,6 +159,8 @@ LoadPlugin table
LoadPlugin interface
LoadPlugin memory
LoadPlugin cpu
+LoadPlugin cpufreq
+LoadPlugin thermal
LoadPlugin aggregation
LoadPlugin match_regex
LoadPlugin df
@@ -190,7 +190,6 @@ LoadPlugin curl
MountPoint "/"
IgnoreSelected false
- ReportReserved true
ReportInodes true
diff --git a/bash/portal/install.sh b/bash/portal/install.sh
index fbe52641..db11209e 100755
--- a/bash/portal/install.sh
+++ b/bash/portal/install.sh
@@ -9,7 +9,7 @@
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
-# Copyright (c) 2015-2018 Joseph A. Prochazka #
+# Copyright (c) 2015-2024 Joseph A. Prochazka #
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy #
# of this software and associated documentation files (the "Software"), to deal #
@@ -33,9 +33,6 @@
## VARIABLES
-RECEIVER_ROOT_DIRECTORY="${PWD}"
-RECEIVER_BASH_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/bash"
-RECEIVER_BUILD_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/build"
PORTAL_BUILD_DIRECTORY="${RECEIVER_BUILD_DIRECTORY}/portal"
## INCLUDE EXTERNAL SCRIPTS
@@ -144,8 +141,8 @@ else
else
# Install the MySQL server package now if it is not already installed.
whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "MySQL Server Setup" --msgbox "This script will now check for the MySQL server package. If the MySQL server package is not installed it will be installed at this time.\n\nPlease note you may be asked questions used to secure your database server installation after the setup process." 12 78
- CheckPackage mysql-server
- if [[ $(dpkg-query -W -f='${STATUS}' mariadb-server-10.1 2>/dev/null | grep -c "ok installed") -eq 1 ]] ; then
+ CheckPackage mariadb-server
+ if [[ $(dpkg-query -W -f='${STATUS}' mariadb-server 2>/dev/null | grep -c "ok installed") -eq 1 ]] ; then
echo -e "\e[94m Executing the mysql_secure_installation script...\e[97m"
sudo mysql_secure_installation
echo ""
@@ -243,20 +240,17 @@ fi
DISTRO_PHP_VERSION="5"
case $RECEIVER_OS_DISTRIBUTION in
- debian|raspbian)
- if [[ $RECEIVER_OS_RELEASE -ge "9" ]]; then DISTRO_PHP_VERSION="7.0"; fi
- if [[ $RECEIVER_OS_RELEASE -ge "10" ]]; then DISTRO_PHP_VERSION="7.3"; fi
- ;;
- ubuntu)
- if [ `bc -l <<< "$RECEIVER_OS_RELEASE >= 16.04"` -eq 1 ]; then DISTRO_PHP_VERSION="7.0"; fi
- if [ `bc -l <<< "$RECEIVER_OS_RELEASE >= 17.10"` -eq 1 ]; then DISTRO_PHP_VERSION="7.1"; fi
- if [ `bc -l <<< "$RECEIVER_OS_RELEASE >= 18.04"` -eq 1 ]; then DISTRO_PHP_VERSION="7.2"; fi
+ debian)
+ if [[ $RECEIVER_OS_CODE_NAME = "bookworm" ]]; then DISTRO_PHP_VERSION="8.2"; fi
+ if [[ $RECEIVER_OS_CODE_NAME = "bullseye" ]]; then DISTRO_PHP_VERSION="7.4"; fi
;;
esac
# Install PHP.
CheckPackage php${DISTRO_PHP_VERSION}-cgi
-CheckPackage php${DISTRO_PHP_VERSION}-json
+if (( $(echo "${DISTRO_PHP_VERSION} < 8" | bc -l) )); then
+ CheckPackage php${DISTRO_PHP_VERSION}-json
+fi
# Performance graph dependencies.
CheckPackage collectd-core
@@ -267,16 +261,16 @@ if [ "$RECEIVER_MTA" == "POSTFIX" ] || [ -z "$RECEIVER_MTA" ]; then
CheckPackage postfix
fi
-CheckPackage libpython2.7
+CheckPackage libpython3-stdlib
# Install packages needed for advanced portal setups.
if [[ "${ADVANCED}" = "true" ]] ; then
- CheckPackage python-pyinotify
- CheckPackage python-apt
+ CheckPackage python3-pyinotify
+ CheckPackage python3-apt
case "${DATABASEENGINE}" in
"MySQL")
- CheckPackage mysql-client
- CheckPackage python-mysqldb
+ CheckPackage mariadb-client
+ CheckPackage python3-mysqldb
CheckPackage php${DISTRO_PHP_VERSION}-mysql
;;
"SQLite")
@@ -356,7 +350,7 @@ sudo chmod 666 ${LIGHTTPD_DOCUMENT_ROOT}/data/*
# Check if dump978 was setup.
echo -e "\e[94m Checking if dump978 was set up...\e[97m"
-if [[ -f "/etc/rc.local" ]] && [[ `grep -cFx "${RECEIVER_BUILD_DIRECTORY}/dump978/dump978-maint.sh &" /etc/rc.local` -eq 0 ]] ; then
+if [[ $(dpkg-query -W -f='${STATUS}' dump1090-fa 2>/dev/null | grep -c "ok installed") -eq 1 ]]; then
# Check if a heywhatsthat.com range file exists in the dump1090 HTML folder.
echo -e "\e[94m Checking for the file upintheair.json in the dump1090 HTML folder...\e[97m"
if [[ -f "/usr/share/dump1090-mutability/html/upintheair.json" ]] || [[ -f "/usr/share/dump1090-fa/html/upintheair.json" ]] ; then
@@ -370,26 +364,18 @@ if [[ -f "/etc/rc.local" ]] && [[ `grep -cFx "${RECEIVER_BUILD_DIRECTORY}/dump97
fi
fi
-if [[ $(dpkg-query -W -f='${STATUS}' dump1090-mutability 2>/dev/null | grep -c "ok installed") -eq 1 ]] ; then
- echo -e "\e[94m Removing conflicting redirects from the Lighttpd dump1090.conf file...\e[97m"
- # Remove this line completely.
- sudo sed -i "/$(echo ' "^/dump1090$" => "/dump1090/gmap.html"' | sed -e 's/\\/\\\\/g' -e 's/\//\\\//g' -e 's/&/\\\&/g')/d" /etc/lighttpd/conf-available/89-dump1090.conf
- # Remove the trailing coma from this line.
- sudo sed -i "s/$(echo '"^/dump1090/$" => "/dump1090/gmap.html",' | sed -e 's/\\/\\\\/g' -e 's/\//\\\//g' -e 's/&/\\\&/g')/$(echo '"^/dump1090/$" => "/dump1090/gmap.html"' | sed -e 's/\\/\\\\/g' -e 's/\//\\\//g' -e 's/&/\\\&/g')/g" /etc/lighttpd/conf-available/89-dump1090.conf
-fi
-
# Add to the Lighttpd configuration.
echo -e "\e[94m Adding the Lighttpd portal configuration file...\e[97m"
-if [[ -f "/etc/lighttpd/conf-available/89-adsb-portal.conf" ]] ; then
- sudo rm -f /etc/lighttpd/conf-available/89-adsb-portal.conf
+if [[ -f "/etc/lighttpd/conf-available/87-adsb-portal.conf" ]] ; then
+ sudo rm -f /etc/lighttpd/conf-available/87-adsb-portal.conf
fi
-sudo touch /etc/lighttpd/conf-available/89-adsb-portal.conf
+sudo touch /etc/lighttpd/conf-available/87-adsb-portal.conf
if [[ $(dpkg-query -W -f='${STATUS}' dump1090-fa 2>/dev/null | grep -c "ok installed") -eq 1 ]] ; then
- sudo tee -a /etc/lighttpd/conf-available/89-adsb-portal.conf > /dev/null < /dev/null < "/run/dump1090-fa/",
- "/dump1090/" => "/usr/share/dump1090-fa/html/"
+ "/dump1090/" => "/usr/share/skyaware/html/"
)
# Redirect the slash-less dump1090 URL
url.redirect += (
@@ -402,7 +388,7 @@ server.modules += ( "mod_setenv" )
}
EOF
fi
-sudo tee -a /etc/lighttpd/conf-available/89-adsb-portal.conf > /dev/null < /dev/null < /dev/null < /dev/null < /dev/null < /dev/null < /dev/null <0)) && sudo sed -i "${LINENUMBER[$((${#LINENUMBER[@]}-1))]}i ${PORTAL_PYTHON_DIRECTORY}/flights-maint.sh &\n" /etc/rc.local
-fi
-
-# Remove old maintenance-maint.sh start up line from /etc/rc.local.
-sudo sed -i '/build\/portal\/logging\/maintenance-maint.sh/d' /etc/rc.local
-
-# Add maintenance maintenance script to rc.local.
-if [[ `grep -cFx "${PORTAL_PYTHON_DIRECTORY}/maintenance-maint.sh &" /etc/rc.local` -eq 0 ]] ; then
- echo -e "\e[94m Adding the maintenance maintenance script startup line to /etc/rc.local...\e[97m"
- LINENUMBER=($(sed -n '/exit 0/=' /etc/rc.local))
- ((LINENUMBER>0)) && sudo sed -i "${LINENUMBER[$((${#LINENUMBER[@]}-1))]}i ${PORTAL_PYTHON_DIRECTORY}/maintenance-maint.sh &\n" /etc/rc.local
-fi
-
-# Kill any previously running maintenance scripts.
-echo -e "\e[94m Checking for any running flights-maint.sh processes...\e[97m"
-PIDS=`ps -efww | grep -w "flights-maint.sh" | awk -vpid=$$ '$2 != pid { print $2 }'`
-if [[ -n "${PIDS}" ]] ; then
- echo -e "\e[94m Killing any running flights-maint.sh processes...\e[97m"
- sudo kill ${PIDS}
- sudo kill -9 ${PIDS}
-fi
-PIDS=`ps -efww | grep -w "maintenance-maint.sh" | awk -vpid=$$ '$2 != pid { print $2 }'`
-if [[ -n "${PIDS}" ]] ; then
- echo -e "\e[94m Killing any running maintenance-maint.sh processes...\e[97m"
- sudo kill ${PIDS}
- sudo kill -9 ${PIDS}
-fi
-
-# Start flight logging.
-echo -e "\e[94m Executing the flight logging maintenance script...\e[97m"
-nohup ${PORTAL_PYTHON_DIRECTORY}/flights-maint.sh > /dev/null 2>&1 &
-
-# Start maintenance.
-echo -e "\e[94m Executing the maintenance maintenance script...\e[97m"
-nohup ${PORTAL_PYTHON_DIRECTORY}/maintenance-maint.sh > /dev/null 2>&1 &
diff --git a/bash/variables.sh b/bash/variables.sh
index d9e66545..9fbd096c 100644
--- a/bash/variables.sh
+++ b/bash/variables.sh
@@ -9,7 +9,7 @@
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
-# Copyright (c) 2015-2017, Joseph A. Prochazka #
+# Copyright (c) 2015-2024, Joseph A. Prochazka #
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy #
# of this software and associated documentation files (the "Software"), to deal #
@@ -34,25 +34,25 @@
## SOFTWARE VERSIONS
# The ADS-B Receiver Project
-PROJECT_VERSION="2.7.2"
+PROJECT_VERSION="2.8.0"
# RTL-SDR OGN
RTLSDROGN_VERSION="0.2.5"
-# FlightAware PiAware
-DUMP1090_FA_VERSION="3.7.1"
-PIAWARE_VERSION="3.7.1"
+# FlightAware
+DUMP1090_FA_VERSION="9.0"
+DUMP978_FA_VERSION="9.0"
+PIAWARE_VERSION="9.0.1"
+SKYAWARE978_VERSION="9.0"
# PlaneFinder Client
-PLANEFINDER_CLIENT_VERSION_ARM="4.1.1"
-PLANEFINDER_CLIENT_VERSION_I386="4.1.1"
+PLANEFINDER_CLIENT_VERSION_ARMHF="5.0.161"
+PLANEFINDER_CLIENT_VERSION_ARM64="5.1.440"
+PLANEFINDER_CLIENT_VERSION_AMD64="5.0.162"
+PLANEFINDER_CLIENT_VERSION_I386="5.0.161"
# Flightradar24 Client
-FLIGHTRADAR24_CLIENT_VERSION_I386="1.0.18-5"
+FLIGHTRADAR24_CLIENT_VERSION="1.0.18-5"
-# mlat-client
-MLAT_CLIENT_VERSION="0.2.6"
-MLAT_CLIENT_TAG="v0.2.6"
-
-# PhantomJS
-PHANTOMJS_VERSION="2.1.1"
+# OpenSky Network Client
+OPENSKY_NETWORK_CLIENT_VERSION="2.1.7-1"
diff --git a/build/portal/graphs/dump1090.py b/build/portal/graphs/dump1090.py
index e54d1914..44328c04 100644
--- a/build/portal/graphs/dump1090.py
+++ b/build/portal/graphs/dump1090.py
@@ -1,8 +1,9 @@
import collectd
import json, math
from contextlib import closing
-from urllib2 import urlopen, URLError
-import urlparse
+from urllib.request import urlopen
+from urllib.error import URLError
+from urllib.parse import urlparse
import time
def handle_config(root):
@@ -19,10 +20,10 @@ def handle_config(root):
collectd.warning('No URL found in dump1090 Instance ' + instance_name)
else:
collectd.register_read(callback=handle_read,
- data=(instance_name, urlparse.urlparse(url).hostname, url),
+ data=(instance_name, urlparse(url).hostname, url),
name='dump1090.' + instance_name)
collectd.register_read(callback=handle_read_1min,
- data=(instance_name, urlparse.urlparse(url).hostname, url),
+ data=(instance_name, urlparse(url).hostname, url),
name='dump1090.' + instance_name + '.1min',
interval=60)
@@ -54,8 +55,8 @@ def read_stats_1min(instance_name, host, url):
return
# Signal measurements - from the 1 min bucket
- if stats['last1min'].has_key('local'):
- if stats['last1min']['local'].has_key('signal'):
+ if 'local' in stats['last1min']:
+ if 'signal' in stats['last1min']['local']:
V.dispatch(plugin_instance = instance_name,
host=host,
type='dump1090_dbfs',
@@ -64,7 +65,7 @@ def read_stats_1min(instance_name, host, url):
values = [stats['last1min']['local']['signal']],
interval = 60)
- if stats['last1min']['local'].has_key('peak_signal'):
+ if 'peak_signal' in stats['last1min']['local']:
V.dispatch(plugin_instance = instance_name,
host=host,
type='dump1090_dbfs',
@@ -73,7 +74,7 @@ def read_stats_1min(instance_name, host, url):
values = [stats['last1min']['local']['peak_signal']],
interval = 60)
- if stats['last1min']['local'].has_key('min_signal'):
+ if 'min_signal' in stats['last1min']['local']:
V.dispatch(plugin_instance = instance_name,
host=host,
type='dump1090_dbfs',
@@ -82,7 +83,7 @@ def read_stats_1min(instance_name, host, url):
values = [stats['last1min']['local']['min_signal']],
interval = 60)
- if stats['last1min']['local'].has_key('noise'):
+ if 'noise' in stats['last1min']['local']:
V.dispatch(plugin_instance = instance_name,
host=host,
type='dump1090_dbfs',
@@ -100,7 +101,7 @@ def read_stats(instance_name, host, url):
return
# Local message counts
- if stats['total'].has_key('local'):
+ if 'local' in stats['total']:
counts = stats['total']['local']['accepted']
V.dispatch(plugin_instance = instance_name,
host=host,
@@ -108,7 +109,7 @@ def read_stats(instance_name, host, url):
type_instance='local_accepted',
time=T(stats['total']['end']),
values = [sum(counts)])
- for i in xrange(len(counts)):
+ for i in range(len(counts)):
V.dispatch(plugin_instance = instance_name,
host=host,
type='dump1090_messages',
@@ -116,7 +117,7 @@ def read_stats(instance_name, host, url):
time=T(stats['total']['end']),
values = [counts[i]])
- if stats['total']['local'].has_key('strong_signals'):
+ if 'strong_signals' in stats['total']['local']:
V.dispatch(plugin_instance = instance_name,
host=host,
type='dump1090_messages',
@@ -126,7 +127,7 @@ def read_stats(instance_name, host, url):
interval = 60)
# Remote message counts
- if stats['total'].has_key('remote'):
+ if 'remote' in stats['total']:
counts = stats['total']['remote']['accepted']
V.dispatch(plugin_instance = instance_name,
host=host,
@@ -134,7 +135,7 @@ def read_stats(instance_name, host, url):
type_instance='remote_accepted',
time=T(stats['total']['end']),
values = [sum(counts)])
- for i in xrange(len(counts)):
+ for i in range(len(counts)):
V.dispatch(plugin_instance = instance_name,
host=host,
type='dump1090_messages',
@@ -185,7 +186,7 @@ def read_aircraft(instance_name, host, url):
with closing(urlopen(url + '/data/receiver.json', None, 5.0)) as receiver_file:
receiver = json.load(receiver_file)
- if receiver.has_key('lat'):
+ if 'lat' not in receiver:
rlat = float(receiver['lat'])
rlon = float(receiver['lon'])
else:
@@ -203,7 +204,7 @@ def read_aircraft(instance_name, host, url):
mlat = 0
for a in aircraft_data['aircraft']:
if a['seen'] < 15: total += 1
- if a.has_key('seen_pos') and a['seen_pos'] < 15:
+ if 'seen_pos' in a and a['seen_pos'] < 15:
with_pos += 1
if rlat is not None:
distance = greatcircle(rlat, rlon, a['lat'], a['lon'])
diff --git a/build/portal/html/admin/blog/add.php b/build/portal/html/admin/blog/add.php
index 7544f03f..d0e7f063 100644
--- a/build/portal/html/admin/blog/add.php
+++ b/build/portal/html/admin/blog/add.php
@@ -7,7 +7,7 @@
// //
// The MIT License (MIT) //
// //
- // Copyright (c) 2015-2016 Joseph A. Prochazka //
+ // Copyright (c) 2015-2024 Joseph A. Prochazka //
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy //
// of this software and associated documentation files (the "Software"), to deal //
@@ -89,29 +89,18 @@
-
+
+