From 0bd32ef097a9af48c98c5d4069e02c073e3ee67f Mon Sep 17 00:00:00 2001 From: jprochazka Date: Fri, 19 Jul 2024 15:58:45 -0400 Subject: [PATCH 01/26] Added untested Nobel support and logging foundations. --- bash/feeders/piaware.sh | 219 ++++++++++++++++++++-------------------- bash/functions.sh | 51 ++++++++++ 2 files changed, 160 insertions(+), 110 deletions(-) diff --git a/bash/feeders/piaware.sh b/bash/feeders/piaware.sh index 14911c25..cf30182d 100755 --- a/bash/feeders/piaware.sh +++ b/bash/feeders/piaware.sh @@ -1,38 +1,34 @@ #!/bin/bash -## INCLUDE EXTERNAL SCRIPTS +# THE FLIGHTAWARE PIAWARE CLIENT SETUP SCRIPT -source $RECEIVER_BASH_DIRECTORY/variables.sh -source $RECEIVER_BASH_DIRECTORY/functions.sh +## PRE INSTALLATION OPERATIONS -## BEGIN SETUP +source $RECEIVER_BASH_DIRECTORY/variables.sh +source $RECEIVER_BASH_DIRECTORY/functions.sh clear -echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}" -echo "" -echo -e "\e[92m Setting up FlightAware PiAware client..." -echo "" -echo -e "\e[93m ------------------------------------------------------------------------------\e[96m" +LogProjectName ${RECEIVER_PROJECT_TITLE} +LogTitleHeading "Setting up the FlightAware PiAware Client" +LogTitleMessage "------------------------------------------------------------------------------" echo "" -# Confirm component installation if ! 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; then - echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m" - echo -e " Setup has been halted at the request of the user." + LogAlertHeading "INSTALLATION HALTED" + LogAlertMessage "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" + LogTitleMessage "------------------------------------------------------------------------------" + LogTitleHeading "ADS-B Receiver Portal setup halted" echo "" - read -p "Press enter to continue..." discard exit 1 fi ## CHECK FOR PREREQUISITE PACKAGES -echo -e "\e[95m Installing packages needed to fulfill dependencies for FlightAware PiAware client...\e[97m" -echo "" +LogHeading "Installing packages needed to fulfill dependencies for FlightAware PiAware client" + CheckPackage build-essential CheckPackage git CheckPackage devscripts @@ -60,96 +56,109 @@ CheckPackage libssl-dev CheckPackage tcl-dev CheckPackage chrpath -# Some older distros may need different packages than newer ones -case ${RECEIVER_OS_CODE_NAME} in - focal) - CheckPackage python3-dev - ;; - *) - CheckPackage python3-build - ;; -esac +if "${RECEIVER_OS_CODE_NAME}" == "noble" + CheckPackage python3-pyasyncore +fi + +if "${RECEIVER_OS_CODE_NAME}" == "focal" + CheckPackage python3-dev +else + CheckPackage python3-build +fi echo "" -## DOWNLOAD OR UPDATE THE TCLTLS REBUILD SOURCE +## CLONE OR PULL THE TCLTLS REBUILD GIT REPOSITORY + +LogHeading "Preparing the FlightAware tcltls-rebuild Git repository" -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" + LogMessage "Entering the tcltls-rebuild git repository directory" + cd $RECEIVER_BUILD_DIRECTORY/tcltls-rebuild + LogMessage "Updating the local tcltls-rebuild git repository" echo "" - git pull 2>&1 + git pull 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" + LogMessage "Entering the ADS-B Receiver Project build directory" + cd $RECEIVER_BUILD_DIRECTORY + LogMessage "Cloning the tcltls-rebuild git repository locally" echo "" - git clone https://github.com/flightaware/tcltls-rebuild 2>&1 + git clone https://github.com/flightaware/tcltls-rebuild fi echo "" -## BUILD AND INSTALL THE DUMP1090-FA PACKAGE +## BUILD AND INSTALL THE TCLTLS-REBUILD PACKAGE -echo -e "\e[95m Building and installing the tcltls rebuild package...\e[97m" -echo -e "" +LogHeading "Beginning the FlightAware tcltls-rebuild installation process" -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" +LogMessage "Entering the tcltls-rebuild source directory" +cd $RECEIVER_BUILD_DIRECTORY/tcltls-rebuild/tcltls-1.7.22 +LogMessage "Building the tcltls-rebuild package" echo "" -sudo dpkg -i $RECEIVER_BUILD_DIRECTORY/tcltls-rebuild/tcl-tls_1.7.22-2+fa1_*.deb 2>&1 +dpkg-buildpackage -b echo "" -echo -e "\e[94m Moving the tcltls-rebuild binary package into the archive directory...\e[97m" +LogMessage "Installing the tcltls-rebuild package" echo "" -cp -vf $RECEIVER_BUILD_DIRECTORY/piaware_builder/*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ 2>&1 +sudo dpkg -i $RECEIVER_BUILD_DIRECTORY/tcltls-rebuild/tcl-tls_1.7.22-2+fa1_*.deb echo "" +LogMessage "Checking that the FlightAware tcltls-rebuild package was installed properly" +if [[ $(dpkg-query -W -f='${STATUS}' tcltls 2>/dev/null | grep -c "ok installed") -eq 0 ]]; then + echo "" + LogAlertHeading "INSTALLATION HALTED" + echo "" + LogAlertMessage "FlightAware tcltls-rebuild package installation failed" + LogAlertMessage "Setup has been terminated" + echo "" + LogTitleMessage "------------------------------------------------------------------------------" + LogTitleHeading "FlightAware PiAware client setup failed" + echo "" + read -p "Press enter to continue..." discard + exit 1 +else + if [[ ! -d $RECEIVER_BUILD_DIRECTORY/package-archive ]]; then + LogMessage "Creating the package archive directory" + echo "" + mkdir -vp $RECEIVER_BUILD_DIRECTORY/package-archive + echo "" + fi + LogMessage "Copying the FlightAware tcltls-rebuild binary package into the archive directory" + echo "" + cp -vf $RECEIVER_BUILD_DIRECTORY/tcltls-rebuild/*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ + echo "" +fi + -## START INSTALLATION +## CLONE OR PULL THE PIAWARE_BUILDER GIT REPOSITORY -echo -e "\e[95m Begining the FlightAware PiAware client installation process...\e[97m" -echo "" +LogHeading "Preparing the FlightAware piaware_builder Git repository" if [[ -d $RECEIVER_BUILD_DIRECTORY/piaware_builder && -d $RECEIVER_BUILD_DIRECTORY/piaware_builder/.git ]]; then - # A directory with a git repository containing the source code already exists - echo -e "\e[94m Entering the piaware_builder git repository directory...\e[97m" - cd $RECEIVER_BUILD_DIRECTORY/piaware_builder 2>&1 - echo -e "\e[94m Updating the local piaware_builder git repository...\e[97m" + LogMessage "Entering the piaware_builder git repository directory" + cd $RECEIVER_BUILD_DIRECTORY/piaware_builder + LogMessage "Updating the local piaware_builder git repository" echo "" - git pull 2>&1 + git pull 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 piaware_builder git repository locally...\e[97m" + LogMessage "Entering the ADS-B Receiver Project build directory" + cd $RECEIVER_BUILD_DIRECTORY + LogMessage "Cloning the piaware_builder git repository locally" echo "" - git clone https://github.com/flightaware/piaware_builder.git 2>&1 + git clone https://github.com/flightaware/piaware_builder.git fi echo "" -## BUILD AND INSTALL THE COMPONENT PACKAGE +## BUILD AND INSTALL THE PIAWARE PACKAGE -echo -e "\e[95m Building and installing the FlightAware PiAware client package...\e[97m" -echo "" +LogHeading "Beginning the FlightAware PiAware installation process" -# Change to the component build directory -echo -e "\e[94m Entering the piaware_builder git repository directory...\e[97m" -cd $RECEIVER_BUILD_DIRECTORY/piaware_builder 2>&1 +LogMessage "Entering the piaware_builder git repository directory" +cd $RECEIVER_BUILD_DIRECTORY/piaware_builder -# Execute build script +LogMessage "Determining which piaware_builder build strategy should be use" distro="bookworm" case $RECEIVER_OS_CODE_NAME in buster | focal) @@ -158,80 +167,70 @@ case $RECEIVER_OS_CODE_NAME in bullseye | jammy) distro="bullseye" ;; - bookworm) + bookworm | noble) distro="bookworm" ;; esac -echo -e "\e[94m Executing the FlightAware PiAware client build script...\e[97m" + +LogMessage "Executing the FlightAware PiAware client build script" echo "" ./sensible-build.sh $distro 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-${distro} 2>&1 - -# Build binary package -echo -e "\e[94m Building the FlightAware PiAware client package...\e[97m" +LogMessage "Entering the FlightAware PiAware client build directory" +cd $RECEIVER_BUILD_DIRECTORY/piaware_builder/package-${distro} +LogMessage "Building the FlightAware PiAware client package" echo "" -dpkg-buildpackage -b 2>&1 +dpkg-buildpackage -b echo "" - -# Install binary package -echo -e "\e[94m Installing the FlightAware PiAware client package...\e[97m" +LogMessage "Installing the FlightAware PiAware client package" echo "" sudo dpkg -i $RECEIVER_BUILD_DIRECTORY/piaware_builder/piaware_*.deb 2>&1 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" - +LogMessage "Checking that the FlightAware PiAware client package was installed properly" if [[ $(dpkg-query -W -f='${STATUS}' piaware 2>/dev/null | grep -c "ok installed") -eq 0 ]]; then echo "" - echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m" - echo -e " UNABLE TO INSTALL A REQUIRED PACKAGE." - echo -e " SETUP HAS BEEN TERMINATED!" + LogAlertHeading "INSTALLATION HALTED" echo "" - echo -e "\e[93mThe package \"piaware\" could not be installed.\e[39m" + LogAlertMessage "FlightAware PiAware package installation failed" + LogAlertMessage "Setup has been terminated" echo "" - echo -e "\e[93m ------------------------------------------------------------------------------" - echo -e "\e[92m FlightAware PiAware client setup halted.\e[39m" + LogTitleMessage "------------------------------------------------------------------------------" + LogTitleHeading "FlightAware PiAware client setup failed" echo "" read -p "Press enter to continue..." discard 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" + LogMessage "Creating the package archive directory" echo "" - mkdir -vp $RECEIVER_BUILD_DIRECTORY/package-archive 2>&1 + mkdir -vp $RECEIVER_BUILD_DIRECTORY/package-archive echo "" fi - - # Archive binary package. - echo -e "\e[94m Moving the FlightAware PiAware client binary package into the archive directory...\e[97m" + LogMessage "Copying the FlightAware PiAware client binary package into the archive directory" echo "" - cp -vf $RECEIVER_BUILD_DIRECTORY/piaware_builder/*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ 2>&1 + cp -vf $RECEIVER_BUILD_DIRECTORY/piaware_builder/*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ echo "" fi -## COMPONENT POST INSTALL ACTIONS +## POST INSTALLATION OPERATIONS + +LogHeading "Performing post installation operations" -# Instruct the user as to how they can claim their receiver online. +LogMessage "Displaying the message informing the user on how to claim their device" whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Claiming Your PiAware Device" --msgbox "FlightAware requires you claim your feeder online using the following URL:\n\n http://flightaware.com/adsb/piaware/claim\n\nTo claim your device simply visit the address listed above." 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 +LogMessage "Returning to ${RECEIVER_PROJECT_TITLE} root directory" +cd $RECEIVER_ROOT_DIRECTORY echo "" -echo -e "\e[93m ------------------------------------------------------------------------------" -echo -e "\e[92m FlightAware PiAware client setup is complete.\e[39m" +LogTitleMessage "------------------------------------------------------------------------------" +LogTitleHeading "FlightAware PiAware client setup is complete" echo "" read -p "Press enter to continue..." discard -exit 0 +exit 0 \ No newline at end of file diff --git a/bash/functions.sh b/bash/functions.sh index 539323d8..a17d0616 100755 --- a/bash/functions.sh +++ b/bash/functions.sh @@ -98,3 +98,54 @@ function UncommentConfig { sudo sed -i "/#${1}*/ s/#*//" $2 fi } + + +## LOGGING + +# Logs the "PROJECT NAME" to the console +function LogProjectName { + echo -e "${DISPLAY_PROJECT_NAME} ${1}${DISPLAY_DEFAULT}" + echo "" +} + +# Logs a "HEADING" to the console +function LogHeading { + echo "" + echo -e "${DISPLAY_HEADING} ${1}${DISPLAY_DEFAULT}" + echo "" +} + +# Logs a "MESSAGE" to the console +function LogMessage { + echo -e "${DISPLAY_MESSAGE} ${1}${DISPLAY_DEFAULT}" +} + +# Logs an alert "HEADING" to the console +function LogAlertHeading { + echo -e "${DISPLAY_ALERT_HEADING} ${1}${DISPLAY_DEFAULT}" +} + +# Logs an alert "MESSAGE" to the console +function LogAlertMessage { + echo -e "${DISPLAY_ALERT_MESSAGE} ${1}${DISPLAY_DEFAULT}" +} + +# Logs an title "HEADING" to the console +function LogTitleHeading { + echo -e "${DISPLAY_TITLE_HEADING} ${1}${DISPLAY_DEFAULT}" +} + +# Logs an title "MESSAGE" to the console +function LogTitleMessage { + echo -e "${DISPLAY_TITLE_MESSAGE} ${1}${DISPLAY_DEFAULT}" +} + +# Logs a warning "HEADING" to the console +function LogWarningHeading { + echo -e "${DISPLAY_WARNING_HEADING} ${1}${DISPLAY_DEFAULT}" +} + +# Logs a warning "MESSAGE" to the console +function LogWarningMessage { + echo -e "${DISPLAY_WARNING_MESSAGE} ${1}${DISPLAY_DEFAULT}" +} \ No newline at end of file From 6489731ebc9ec906c98c77fdd81167081e75ca08 Mon Sep 17 00:00:00 2001 From: jprochazka Date: Fri, 19 Jul 2024 16:04:56 -0400 Subject: [PATCH 02/26] Added notes on tcltls-rebuild. --- bash/feeders/piaware.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bash/feeders/piaware.sh b/bash/feeders/piaware.sh index cf30182d..b3f000f3 100755 --- a/bash/feeders/piaware.sh +++ b/bash/feeders/piaware.sh @@ -2,6 +2,15 @@ # THE FLIGHTAWARE PIAWARE CLIENT SETUP SCRIPT +# TCLTLS-REBUILD +# --------------------------------------------------------------------------------- +# Along with PiAware, a version of tcltls maintained by FlightAware is installed. +# The source code making up this version of tcltls has been modified to resolve +# networking issues found in the maintained version. It was noted that newer +# versions of the maintained tcltls packages do not experience this issue. Sometime +# in the future the option to install this package will be removed from the script +# once it has been confirmed the issue is resolved. + ## PRE INSTALLATION OPERATIONS From 398f16bf8bc6627e5f679a5860a8cba2c796de8f Mon Sep 17 00:00:00 2001 From: jprochazka Date: Fri, 19 Jul 2024 17:00:17 -0400 Subject: [PATCH 03/26] Skip tcltls-rebuild installation on most distros. --- bash/feeders/piaware.sh | 115 +++++++++++++++++++++------------------- 1 file changed, 61 insertions(+), 54 deletions(-) diff --git a/bash/feeders/piaware.sh b/bash/feeders/piaware.sh index b3f000f3..5438d284 100755 --- a/bash/feeders/piaware.sh +++ b/bash/feeders/piaware.sh @@ -3,13 +3,13 @@ # THE FLIGHTAWARE PIAWARE CLIENT SETUP SCRIPT # TCLTLS-REBUILD -# --------------------------------------------------------------------------------- -# Along with PiAware, a version of tcltls maintained by FlightAware is installed. -# The source code making up this version of tcltls has been modified to resolve -# networking issues found in the maintained version. It was noted that newer -# versions of the maintained tcltls packages do not experience this issue. Sometime -# in the future the option to install this package will be removed from the script -# once it has been confirmed the issue is resolved. +# ----------------------------------------------------------------------------------- +# Along with PiAware, a version of tcltls maintained by FlightAware can be installed. +# This package is only needed for Debian Buster and possibly Ubuntu Focal Fossa. Once +# these releases pass their end of life date the scripting will be removed. +# +# Debian Buster's end of life occured June 30, 2024 and is no longer supported. +# Ubuntu Focal Fossa's end of life is scheduled for April 2025. ## PRE INSTALLATION OPERATIONS @@ -65,13 +65,14 @@ CheckPackage libssl-dev CheckPackage tcl-dev CheckPackage chrpath -if "${RECEIVER_OS_CODE_NAME}" == "noble" +if [[ "${RECEIVER_OS_CODE_NAME}" == "noble" ]]; then CheckPackage python3-pyasyncore fi -if "${RECEIVER_OS_CODE_NAME}" == "focal" +if [[ "${RECEIVER_OS_CODE_NAME}" == "focal" ]]; then CheckPackage python3-dev else + CheckPackage tcl-tls CheckPackage python3-build fi @@ -80,63 +81,69 @@ echo "" ## CLONE OR PULL THE TCLTLS REBUILD GIT REPOSITORY -LogHeading "Preparing the FlightAware tcltls-rebuild Git repository" +if [[ "${RECEIVER_OS_CODE_NAME}" == "focal" ]]; then -if [[ -d $RECEIVER_BUILD_DIRECTORY/tcltls-rebuild && -d $RECEIVER_BUILD_DIRECTORY/tcltls-rebuild/.git ]]; then - LogMessage "Entering the tcltls-rebuild git repository directory" - cd $RECEIVER_BUILD_DIRECTORY/tcltls-rebuild - LogMessage "Updating the local tcltls-rebuild git repository" - echo "" - git pull -else - LogMessage "Entering the ADS-B Receiver Project build directory" - cd $RECEIVER_BUILD_DIRECTORY - LogMessage "Cloning the tcltls-rebuild git repository locally" + LogHeading "Preparing the FlightAware tcltls-rebuild Git repository" + + if [[ -d $RECEIVER_BUILD_DIRECTORY/tcltls-rebuild && -d $RECEIVER_BUILD_DIRECTORY/tcltls-rebuild/.git ]]; then + LogMessage "Entering the tcltls-rebuild git repository directory" + cd $RECEIVER_BUILD_DIRECTORY/tcltls-rebuild + LogMessage "Updating the local tcltls-rebuild git repository" + echo "" + git pull + else + LogMessage "Entering the ADS-B Receiver Project build directory" + cd $RECEIVER_BUILD_DIRECTORY + LogMessage "Cloning the tcltls-rebuild git repository locally" + echo "" + git clone https://github.com/flightaware/tcltls-rebuild + fi echo "" - git clone https://github.com/flightaware/tcltls-rebuild -fi -echo "" -## BUILD AND INSTALL THE TCLTLS-REBUILD PACKAGE + ## BUILD AND INSTALL THE TCLTLS-REBUILD PACKAGE -LogHeading "Beginning the FlightAware tcltls-rebuild installation process" + LogHeading "Beginning the FlightAware tcltls-rebuild installation process" -LogMessage "Entering the tcltls-rebuild source directory" -cd $RECEIVER_BUILD_DIRECTORY/tcltls-rebuild/tcltls-1.7.22 -LogMessage "Building the tcltls-rebuild package" -echo "" -dpkg-buildpackage -b -echo "" -LogMessage "Installing the tcltls-rebuild package" -echo "" -sudo dpkg -i $RECEIVER_BUILD_DIRECTORY/tcltls-rebuild/tcl-tls_1.7.22-2+fa1_*.deb -echo "" + LogMessage "Checking if the FlightAware tcltls-rebuild is required" -LogMessage "Checking that the FlightAware tcltls-rebuild package was installed properly" -if [[ $(dpkg-query -W -f='${STATUS}' tcltls 2>/dev/null | grep -c "ok installed") -eq 0 ]]; then + LogMessage "Entering the tcltls-rebuild source directory" + cd $RECEIVER_BUILD_DIRECTORY/tcltls-rebuild/tcltls-1.7.22 + LogMessage "Building the tcltls-rebuild package" echo "" - LogAlertHeading "INSTALLATION HALTED" + dpkg-buildpackage -b echo "" - LogAlertMessage "FlightAware tcltls-rebuild package installation failed" - LogAlertMessage "Setup has been terminated" + LogMessage "Installing the tcltls-rebuild package" echo "" - LogTitleMessage "------------------------------------------------------------------------------" - LogTitleHeading "FlightAware PiAware client setup failed" + sudo dpkg -i $RECEIVER_BUILD_DIRECTORY/tcltls-rebuild/tcl-tls_1.7.22-2+fa1_*.deb echo "" - read -p "Press enter to continue..." discard - exit 1 -else - if [[ ! -d $RECEIVER_BUILD_DIRECTORY/package-archive ]]; then - LogMessage "Creating the package archive directory" + + LogMessage "Checking that the FlightAware tcltls-rebuild package was installed properly" + if [[ $(dpkg-query -W -f='${STATUS}' tcltls 2>/dev/null | grep -c "ok installed") -eq 0 ]]; then echo "" - mkdir -vp $RECEIVER_BUILD_DIRECTORY/package-archive + LogAlertHeading "INSTALLATION HALTED" + echo "" + LogAlertMessage "FlightAware tcltls-rebuild package installation failed" + LogAlertMessage "Setup has been terminated" + echo "" + LogTitleMessage "------------------------------------------------------------------------------" + LogTitleHeading "FlightAware PiAware client setup failed" + echo "" + read -p "Press enter to continue..." discard + exit 1 + else + if [[ ! -d $RECEIVER_BUILD_DIRECTORY/package-archive ]]; then + LogMessage "Creating the package archive directory" + echo "" + mkdir -vp $RECEIVER_BUILD_DIRECTORY/package-archive + echo "" + fi + LogMessage "Copying the FlightAware tcltls-rebuild binary package into the archive directory" + echo "" + cp -vf $RECEIVER_BUILD_DIRECTORY/tcltls-rebuild/*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ echo "" fi - LogMessage "Copying the FlightAware tcltls-rebuild binary package into the archive directory" - echo "" - cp -vf $RECEIVER_BUILD_DIRECTORY/tcltls-rebuild/*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ - echo "" + fi @@ -160,7 +167,7 @@ fi echo "" -## BUILD AND INSTALL THE PIAWARE PACKAGE +## BUILD AND INSTALL THE PIAWARE CLIENT PACKAGE LogHeading "Beginning the FlightAware PiAware installation process" @@ -170,7 +177,7 @@ cd $RECEIVER_BUILD_DIRECTORY/piaware_builder LogMessage "Determining which piaware_builder build strategy should be use" distro="bookworm" case $RECEIVER_OS_CODE_NAME in - buster | focal) + focal) distro="buster" ;; bullseye | jammy) From ee411ea7beeb1fabf190630efbaa387e410f4d45 Mon Sep 17 00:00:00 2001 From: Joseph Prochazka Date: Fri, 19 Jul 2024 21:01:06 -0400 Subject: [PATCH 04/26] Display and installer fixes. --- bash/variables.sh | 15 +++++++++ install.sh | 80 +++-------------------------------------------- 2 files changed, 19 insertions(+), 76 deletions(-) diff --git a/bash/variables.sh b/bash/variables.sh index a5a2b1e7..a7a19a58 100644 --- a/bash/variables.sh +++ b/bash/variables.sh @@ -1,5 +1,6 @@ #!/bin/bash + ## SOFTWARE VERSIONS # The ADS-B Receiver Project @@ -22,3 +23,17 @@ FLIGHTRADAR24_CLIENT_VERSION="1.0.18-5" # OpenSky Network Client OPENSKY_NETWORK_CLIENT_VERSION="2.1.7-1" + + +## DISPLAY + +DISPLAY_DEFAULT = "\033[0m" +DISPLAY_HEADING = "\033[1;36m" +DISPLAY_MESSAGE = "\033[2;36m" +DISPLAY_PROJECT_NAME = "\033[1;33m" +DISPLAY_TITLE_HEADING = "\033[1;32m" +DISPLAY_TITLE_MESSAGE = "\033[2;32m" +DISPLAY_WARNING_HEADING = "\033[1;33m" +DISPLAY_WARNING_MESSAGE = "\033[2;33m" +DISPLAY_ALERT_HEADING = "\033[1;31m" +DISPLAY_ALERT_MESSAGE = "\033[2;31m" \ No newline at end of file diff --git a/install.sh b/install.sh index c850b0f6..947ea97a 100755 --- a/install.sh +++ b/install.sh @@ -94,6 +94,10 @@ while [[ $# > 0 ]] ; do fi shift 2 ;; + --version | -v) + # Display the version + echo $PROJECT_VERSION + exit 0 *) # Unknown options were set so exit echo -e "Error: Unknown option: $1" >&2 @@ -156,82 +160,6 @@ export RECIEVER_CPU_ARCHITECTURE=`uname -m | tr -d "\n\r"` export RECEIVER_CPU_REVISION=`grep "^Revision" /proc/cpuinfo | awk '{print $3}'` -## FUNCTIONS - -# Display the help message -function DisplayHelp() { - echo " " - echo "Usage: $0 [OPTIONS] [ARGUMENTS] " - echo " " - echo "-------------------------------------------------------------------------------------------" - echo "Option GNU long option Description " - echo "-------------------------------------------------------------------------------------------" - echo "-b --branch= Specifies the repository branch to be used. " - echo "-d --development Skips local repository update so changes are not overwrote." - echo "-h --help Shows this message. " - echo "-m --mta= Specify which email MTA to use currently Exim or Postfix. " - echo "-------------------------------------------------------------------------------------------" - echo " " -} - - -## CHECK FOR OPTIONS AND ARGUMENTS - -while [[ $# > 0 ]] ; do - echo "SWITCH: ${1}" - case $1 in - --branch*) - # The specified branch of github - project_branch=`echo $1 | sed -e 's/^[^=]*=//g'` - shift 1 - ;; - -b) - # The specified branch of github - project_branch=$2 - shift 2 - ;; - --development | -d) - # Skip adsb-receiver repository update - development_mode="true" - shift 1 - ;; - --help | -h) - # Display a help message - DisplayHelp - exit 0 - ;; - --mta*) - mta=`echo ${1^^} | sed -e 's/^[^=]*=//g'` - if [[ "${mta}" != "EXIM" && "${mta}" != "POSTFIX" ]]; then - echo "MTA can only be either EXIM or POSTFIX." - exit 1 - fi - shift 1 - ;; - -m) - # The MTA to use - mta=${2^^} - if [[ "${mta}" != "EXIM" && "${mta}" != "POSTFIX" ]]; then - echo "MTA can only be either EXIM or POSTFIX." - exit 1 - fi - shift 2 - ;; - *) - # Unknown options were set so exit - echo -e "Error: Unknown option: $1" >&2 - DisplayHelp - exit 1 - ;; - esac -done - -# Add any environmental variables needed by any child scripts -export RECEIVER_PROJECT_BRANCH=$project_branch -export RECEIVER_DEVELOPMENT_MODE=$development_mode -export RECEIVER_MTA=$mta - - ## EXECUTE BASH/INIT.SH chmod +x $RECEIVER_BASH_DIRECTORY/init.sh From 143331a7d5890cebf3281cca454c19c466a1377c Mon Sep 17 00:00:00 2001 From: jprochazka Date: Sun, 21 Jul 2024 20:58:36 -0400 Subject: [PATCH 05/26] Updated dump1090.fa script and fixed color variables. --- CHANGELOG.md | 10 ++ README.md | 4 +- bash/decoders/dump1090-fa.sh | 238 ++++++++++++++++++----------------- bash/feeders/piaware.sh | 46 +++---- bash/functions.sh | 158 ++++++++++++----------- bash/main.sh | 14 +-- bash/variables.sh | 31 +++-- install.sh | 37 ++++-- 8 files changed, 285 insertions(+), 253 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f457359..37a87a4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,16 @@ The following is a history of the changes made to this project. +## v2.8.5 *(in development)* + +* Added the --version and -v arguments in order to display the current project version. +* Added logging functions which in the future will offer a way to log output to files. +* Added variables which can be modified to adjust text colors used by the Bash scripts. +* The installation of PiAware is no longer required when choosing to install dump1090-fa. +* The dump1090-fa installation script to match current installation dump1090-fa instructions. +* Modified the dump1090-fa installation script so that it utilizes the new logging functions. +* The PiAware installation script now supports Ubuntu Noble Numbat. + ## v2.8.4 *(July 13th, 2024)* :rooster: ### Installers diff --git a/README.md b/README.md index c3679798..8a3f7976 100644 --- a/README.md +++ b/README.md @@ -74,8 +74,6 @@ The project currently supports the following Linux distributions. * Debian _(Bookworm and Bullseye)_ * DietPi _(Bookworm aand Bullseye)_ * Rasbperry PI OS _(Bookworm and Bullseye)_ -* Ubuntu _(Jammy Jellyfish and Focal Fossa)_ +* Ubuntu _(Jammy Jellyfish, Focal Fossa and Noble Numbat)_ _Support is available via this repository through the use of the issue tracker or discussions._ - -[Support for Ubuntu Noble Numbat is on hold due to incompatibilities with PiAware's MLAT client.](https://github.com/jprochazka/adsb-receiver/issues/575) diff --git a/bash/decoders/dump1090-fa.sh b/bash/decoders/dump1090-fa.sh index 43ba58fd..e8ec6c8f 100755 --- a/bash/decoders/dump1090-fa.sh +++ b/bash/decoders/dump1090-fa.sh @@ -9,176 +9,188 @@ source $RECEIVER_BASH_DIRECTORY/functions.sh ## BEGIN SETUP clear -echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}" +LogProjectName ${RECEIVER_PROJECT_TITLE} +LogTitleHeading "Setting up the FlightAware Dump1090 decoder" +LogTitleMessage "------------------------------------------------------------------------------" echo "" -echo -e "\e[92m Setting up dump1090-fa..." -echo "" -echo -e "\e[93m ------------------------------------------------------------------------------\e[96m" -echo "" -if ! 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; then - echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m" - echo -e " Setup has been halted at the request of the user." + +if ! whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ + --title "FlightAware Dump1090 Decoder Setup" \ + --yesno "FlightAware Dump1090 is an ADS-B, Mode S, and Mode 3A/3C demodulator and decoder that will receive and decode aircraft transponder messages received via a directly connected software defined radio, or from data provided over a network connection.\n\nWebsite: https://www.flightaware.com/\nGitHub Repository: https://github.com/flightaware/dump1090\n\nWould you like to begin the setup process now?" \ + 14 78; then +LogAlertHeading "INSTALLATION HALTED" + LogAlertMessage "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" + LogTitleMessage "------------------------------------------------------------------------------" + LogTitleHeading "FlightAware Dump1090 decoder setup halted" echo "" - read -p "Press enter to continue..." discard exit 1 fi - ## CHECK FOR PREREQUISITE PACKAGES -echo -e "\e[95m Installing packages needed to build and fulfill dependencies...\e[97m" -echo "" +LogHeading "Installing packages needed to fulfill FlightAware Dump1090 decoder dependencies" + CheckPackage build-essential -CheckPackage fakeroot CheckPackage debhelper -CheckPackage librtlsdr-dev -CheckPackage pkg-config -CheckPackage libncurses-dev +CheckPackage fakeroot CheckPackage libbladerf-dev CheckPackage libhackrf-dev CheckPackage liblimesuite-dev +CheckPackage libncurses-dev +CheckPackage librtlsdr-dev CheckPackage libsoapysdr-dev CheckPackage lighttpd +CheckPackage pkg-config echo "" ## BLACKLIST UNWANTED RTL-SDR MODULES +LogHeading "Blacklist unwanted RTL-SDR kernel modules. + +LogMessage "Blacklisting problematic kernel modules" BlacklistModules -## DOWNLOAD OR UPDATE THE DUMP1090-FA SOURCE +## CLONE OR PULL THE FLIGHTAWARE DUMP1090 DECODER SOURCE -echo -e "\e[95m Preparing the dump1090-fa Git repository...\e[97m" -echo "" -if [[ -d $RECEIVER_BUILD_DIRECTORY/dump1090-fa/dump1090 && -d $RECEIVER_BUILD_DIRECTORY/dump1090-fa/dump1090/.git ]]; then - # A directory with a git repository containing the source code already exists - 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 Updating the local dump1090-fa git repository...\e[97m" +LogHeading "Preparing the FlightAware Dump1090 Git repository" + +if [[ -d $RECEIVER_BUILD_DIRECTORY/dump1090-fa && -d $RECEIVER_BUILD_DIRECTORY/dump1090.fa/.git ]]; then + LogMessage "Entering the dump1090 git repository directory" + cd $RECEIVER_BUILD_DIRECTORY/dump1090-fa + LogMessage "Pulling the dump1090 git repository" 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/dump1090-fa - echo "" - echo -e "\e[94m Entering the dump1090-fa build directory...\e[97m" - cd $RECEIVER_BUILD_DIRECTORY/dump1090-fa 2>&1 - echo -e "\e[94m Cloning the dump1090-fa git repository locally...\e[97m" + LogMessage "Entering the ADS-B Receiver Project build directory" + cd $RECEIVER_BUILD_DIRECTORY + LogMessage "Cloning the dump1090 git repository" echo "" git clone https://github.com/flightaware/dump1090.git fi +echo "" ## BUILD AND INSTALL THE DUMP1090-FA PACKAGE -echo "" -echo -e "\e[95m Building and installing the dump1090-fa package...\e[97m" -echo "" -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 -echo "" -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 -echo "" -echo -e "\e[94m Checking that the dump1090-fa package was installed properly...\e[97m" -if [[ $(dpkg-query -W -f='${STATUS}' dump1090-fa 2>/dev/null | grep -c "ok installed") = 0 ]]; then - # If the dump1090-fa package could not be installed halt setup +LogMessage "Entering the Git repository" +cd $RECEIVER_BUILD_DIRECTORY/dump1090-fa/dump1090 + +LogMessage "Determining which distribution to build the package tree for" +case $RECEIVER_OS_CODE_NAME in + focal) + distro="buster" + ;; + bullseye | jammy) + distro="bullseye" + ;; + bookworm | noble) + distro="bookworm" + ;; +esac +LogMessage "Entering the package/${distro} directory" +cd $RECEIVER_BUILD_DIRECTORY/dump1090-fa/package/$distro +LogMessage "Building the dump1090-fa Debian package" +dpkg-buildpackage -b --no-sign + +# TODO: Figure out a better way than using a variable to determine which package to install +LogMessage "Installing the dump1090-fa Debian package" +sudo dpkg -i $RECEIVER_BUILD_DIRECTORY/dump1090-fa/dump1090/dump1090-fa_${DUMP1090_FA_VERSION}_*.deb + +LogMessage "Checking that the dump1090-fa Debian package was installed" +if [[ $(dpkg-query -W -f='${STATUS}' dump1090-fa 2>/dev/null | grep -c "ok installed") -eq 0 ]]; then echo "" - echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m" - echo -e " UNABLE TO INSTALL A REQUIRED PACKAGE." - echo -e " SETUP HAS BEEN TERMINATED!" + LogAlertHeading "INSTALLATION HALTED" echo "" - echo -e "\e[93mThe package \"dump1090-fa\" could not be installed.\e[39m" + LogAlertMessage "The dump1090-fa Debian package failed to install" + LogAlertMessage "Setup has been terminated" echo "" - echo -e "\e[93m ------------------------------------------------------------------------------" - echo -e "\e[92m Dump1090-fa setup halted.\e[39m" + LogTitleMessage "------------------------------------------------------------------------------" + LogTitleHeading "FlightAware Dump1090 decoder setup halted" echo "" read -p "Press enter to continue..." discard 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 "" + LogMessage "Creating the Debian package archive directory" + echo "" + mkdir -vp $RECEIVER_BUILD_DIRECTORY/package-archive + echo "" fi - -# Archive binary package -echo -e "\e[94m Moving the dump1090-mutability binary package into the archive directory...\e[97m" +LogMessage "Copying the dump1090-fa Debian package into the Debian package archive directory" echo "" -cp -vf $RECEIVER_BUILD_DIRECTORY/dump1090-fa/*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ 2>&1 +cp -vf $RECEIVER_BUILD_DIRECTORY/piaware_builder/*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ echo "" -## DUMP1090-FA POST INSTALLATION CONFIGURATION -# Ask for a Bing Maps API key -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 $bing_maps_key ]]; then - echo -e "\e[94m Setting the Bing Maps API Key to ${DUMP1090_BING_MAPS_KEY}...\e[97m" - ChangeConfig "BingMapsAPIKey" $bing_maps_key "/usr/share/dump1090-fa/html/config.js" -fi +## POST INSTALLATION OPERATIONS -# Download Heywhatsthat.com maximum range rings -if [[ ! -f "/usr/share/dump1090-fa/html/upintheair.json" ]]; 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 - setup_heywhatsthat="true" - - # Ask the user for the Heywhatsthat.com panorama ID - heywhatsthat_id_title="Heywhatsthat.com Panorama ID" - while [[ -z $heywhatsthat_id ]] ; do - heywhatsthat_id=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${heywhatsthat_id_title}" --nocancel --inputbox "\nEnter your Heywhatsthat.com panorama ID." 8 78 3>&1 1>&2 2>&3) - heywhatsthat_id_title="Heywhatsthat.com Panorama ID (REQUIRED)" - done +LogHeading "Performing post installation operations" - # Ask the user what altitude in meters to set the first range ring - heywhatsthat_ring_one_title="Heywhatsthat.com First Ring Altitude" - while [[ -z $heywhatsthat_ring_one ]] ; do - heywhatsthat_ring_one=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${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) - heywhatsthat_ring_one_title="Heywhatsthat.com First Ring Altitude (REQUIRED)" - done - - # Ask the user what altitude in meters to set the second range ring - heywhatsthat_ring_two_title="Heywhatsthat.com Second Ring Altitude" - while [[ -z $heywhatsthat_ring_two ]] ; do - heywhatsthat_ring_two=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${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) - heywhatsthat_ring_two_title="Heywhatsthat.com Second Ring Altitude (REQUIRED)" +LogMessage "Checking if a heywhatsthat upintheair.json file exists" +if [[ ! -f "/usr/share/dump1090-fa/html/upintheair.json" ]]; then + LogMessage "Asking the user if they want to add heywhatsthat maximum range rings" + if (whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ + --title "Setup heywhaststhat Maximum Range Rings" \ + --yesno "Maximum range rings can be added to the FlightAware Dump1090 map usings data obtained from heywhatsthat. In order to add these rings to your FlightAware dump1090 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 numbers after \"?view=\" in the URL.\n\nWould you like to add heywhatsthat maximum range rings to your map?" \ + 16 78); then + heywhatsthat_panorama_id_title="Enter the heywhatsthat Panorama ID" + while [[ -z $heywhatsthat_panorama_id ]] ; do + heywhatsthat_panorama_id=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ + --title "${heywhatsthat_panorama_id_title}" \ + --inputbox "\nPlease enter your Heywhatsthat panorama ID." \ + 8 78) + whiptail_exit_status=$? + if [[ $whiptail_exit_status == 0 ]]; then + LogAlertMessage "Setup of heywhatsthat maximum range rings was cancelled" + break + heywhatsthat_panorama_id_title="Enter the Heywhatsthat Panorama ID (REQUIRED)" done - fi - # If the Heywhatsthat.com maximum range rings are to be added download them now - if [[ "${setup_heywhatsthat}" = "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=${heywhatsthat_id}&refraction=0.25&alts=${heywhatsthat_ring_one},${heywhatsthat_ring_two}" - echo "" + if [[ $whiptail_exit_status != 0 ]]; then + LogMessage "Asking the user what the altitude is for the first ring" + heywhatsthat_ring_one_altitude_title="First heywhatsthat Ring Altitude" + while [[ -z $heywhatsthat_ring_one_altitude ]] ; do + heywhatsthat_ring_one_altitude=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ + --title "${heywhatsthat_ring_one_title}" \ + --nocancel \ + --inputbox "\nEnter the first ring's altitude in meters.\n(default 3048 meters or 10000 feet)" \ + 8 78 \ + "3048") + heywhatsthat_ring_one_altitude_title="First heywhatsthat Ring Altitude (REQUIRED)" + done + LogMessage "Asking the user what the altitude is for the second ring" + heywhatsthat_ring_two_altitude_title="Second heywhatsthat Ring Altitude" + while [[ -z $heywhatsthat_ring_two ]] ; do + heywhatsthat_ring_two_altitude=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ + --title "${heywhatsthat_ring_two_title}" \ + --nocancel \ + --inputbox "\nEnter the second ring's altitude in meters.\n(default 12192 meters or 40000 feet)" \ + 8 78 \ + "12192") + heywhatsthat_ring_two_altitude_title="Second heywhatsthat Ring Altitude (REQUIRED)" + done + + LogMessage "Downloading JSON data file assigned to panorama ID ${heywhatsthat_panorama_id}" + echo "" + sudo wget -O /usr/share/skyaware/html/upintheair.json "http://www.heywhatsthat.com/api/upintheair.json?id=${heywhatsthat_panarama_id}&refraction=0.25&alts=${heywhatsthat_ring_one_altitude},${heywhatsthat_ring_two_altitude}" + echo "" + LogMessage " + 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 +## SETUP COMPLETE + +LogMessage "Returning to ${RECEIVER_PROJECT_TITLE} root directory" +cd $RECEIVER_ROOT_DIRECTORY echo "" -echo -e "\e[93m ------------------------------------------------------------------------------" -echo -e "\e[92m Dump1090-fa setup is complete.\e[39m" +LogTitleMessage "------------------------------------------------------------------------------" +LogTitleHeading "FlightAware Dump1090 decoder setup is complete" echo "" read -p "Press enter to continue..." discard diff --git a/bash/feeders/piaware.sh b/bash/feeders/piaware.sh index 5438d284..c4e8e668 100755 --- a/bash/feeders/piaware.sh +++ b/bash/feeders/piaware.sh @@ -23,12 +23,15 @@ LogTitleHeading "Setting up the FlightAware PiAware Client" LogTitleMessage "------------------------------------------------------------------------------" echo "" -if ! 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; then +if ! 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; then LogAlertHeading "INSTALLATION HALTED" LogAlertMessage "Setup has been halted at the request of the user" echo "" LogTitleMessage "------------------------------------------------------------------------------" - LogTitleHeading "ADS-B Receiver Portal setup halted" + LogTitleHeading "FlightAware PiAware Client setup halted" echo "" exit 1 fi @@ -38,32 +41,31 @@ fi LogHeading "Installing packages needed to fulfill dependencies for FlightAware PiAware client" +CheckPackage autoconf CheckPackage build-essential -CheckPackage git -CheckPackage devscripts +CheckPackage chrpath CheckPackage debhelper -CheckPackage tcl8.6-dev -CheckPackage autoconf -CheckPackage python3-dev -CheckPackage python3-venv -CheckPackage python3-setuptools -CheckPackage zlib1g-dev -CheckPackage openssl -CheckPackage libboost-system-dev +CheckPackage devscripts +CheckPackage git +CheckPackage itcl3 +CheckPackage libboost-filesystem-dev CheckPackage libboost-program-options-dev CheckPackage libboost-regex-dev -CheckPackage libboost-filesystem-dev +CheckPackage libboost-system-dev +CheckPackage libssl-dev +CheckPackage net-tools +CheckPackage openssl CheckPackage patchelf +CheckPackage python3-dev CheckPackage python3-pip CheckPackage python3-setuptools +CheckPackage python3-venv CheckPackage python3-wheel -CheckPackage net-tools -CheckPackage tclx8.4 -CheckPackage tcllib -CheckPackage itcl3 -CheckPackage libssl-dev CheckPackage tcl-dev -CheckPackage chrpath +CheckPackage tcl8.6-dev +CheckPackage tcllib +CheckPackage tclx8.4 +CheckPackage zlib1g-dev if [[ "${RECEIVER_OS_CODE_NAME}" == "noble" ]]; then CheckPackage python3-pyasyncore @@ -72,8 +74,8 @@ fi if [[ "${RECEIVER_OS_CODE_NAME}" == "focal" ]]; then CheckPackage python3-dev else - CheckPackage tcl-tls CheckPackage python3-build + CheckPackage tcl-tls fi echo "" @@ -162,7 +164,7 @@ else cd $RECEIVER_BUILD_DIRECTORY LogMessage "Cloning the piaware_builder git repository locally" echo "" - git clone https://github.com/flightaware/piaware_builder.git + git clone https://github.com/flightaware/dump978.git fi echo "" @@ -249,4 +251,4 @@ LogTitleHeading "FlightAware PiAware client setup is complete" echo "" read -p "Press enter to continue..." discard -exit 0 \ No newline at end of file +exit 0 diff --git a/bash/functions.sh b/bash/functions.sh index a17d0616..89429ad4 100755 --- a/bash/functions.sh +++ b/bash/functions.sh @@ -1,53 +1,110 @@ #!/bin/bash -# Detect if a package is installed and if not attempt to install it +## LOGGING FUNCTIONS + +# Logs the "PROJECT TITLE" to the console +function LogProjectTitle { + echo -e "${DISPLAY_PROJECT_NAME} ${RECEIVER_PROJECT_TITLE}${DISPLAY_DEFAULT}" + echo "" +} + +# Logs a "HEADING" to the console +function LogHeading { + echo "" + echo -e "${DISPLAY_HEADING} ${1}${DISPLAY_DEFAULT}" + echo "" +} + +# Logs a "MESSAGE" to the console +function LogMessage { + echo -e "${DISPLAY_MESSAGE} ${1}${DISPLAY_DEFAULT}" +} + +# Logs an alert "HEADING" to the console +function LogAlertHeading { + echo -e "${DISPLAY_ALERT_HEADING} ${1}${DISPLAY_DEFAULT}" +} + +# Logs an alert "MESSAGE" to the console +function LogAlertMessage { + echo -e "${DISPLAY_ALERT_MESSAGE} ${1}${DISPLAY_DEFAULT}" +} + +# Logs an title "HEADING" to the console +function LogTitleHeading { + echo -e "${DISPLAY_TITLE_HEADING} ${1}${DISPLAY_DEFAULT}" +} + +# Logs an title "MESSAGE" to the console +function LogTitleMessage { + echo -e "${DISPLAY_TITLE_MESSAGE} ${1}${DISPLAY_DEFAULT}" +} + +# Logs a warning "HEADING" to the console +function LogWarningHeading { + echo -e "${DISPLAY_WARNING_HEADING} ${1}${DISPLAY_DEFAULT}" +} + +# Logs a warning "MESSAGE" to the console +function LogWarningMessage { + echo -e "${DISPLAY_WARNING_MESSAGE} ${1}${DISPLAY_DEFAULT}" +} + +function LogMessageInline { + printf "${DISPLAY_MESSAGE} ${1}${DISPLAY_DEFAULT}" +} + +function LogFalseInline { + echo -e "${DISPLAY_FALSE_INLINE} ${1}${DISPLAY_DEFAULT}" +} + +function LogTrueInline { + echo -e "${DISPLAY_TRUE_INLINE} ${1}${DISPLAY_DEFAULT}" +} + + +## CHECK IF THE SUPPLIED PACKAGE IS INSTALLED AND IF NOT ATTEMPT TO INSTALL IT + function CheckPackage { attempt=1 max_attempts=5 wait_time=5 while (( $attempt -le `(($max_attempts + 1))` )); do - - # If the maximum attempts has been reached if [[ $attempt > $max_attempts ]]; then - echo -e "\n\e[91m \e[5mINSTALLATION HALTED!\e[25m" - echo -e " UNABLE TO INSTALL A REQUIRED PACKAGE." - echo -e " SETUP HAS BEEN TERMINATED!\n" - echo -e "\e[93mThe package \"$1\" could not be installed in ${max_attempts} attempts.\e[39m\n" + LogAlertHeading "INSTALLATION HALTED" + LogAlertMessage "Unable to install a required package" + LogAlertMessage "The package $1 could not be installed in ${max_attempts} attempts" exit 1 fi - # Check if the package is already installed - printf "\e[94m Checking if the package $1 is installed..." + LogMessageInline "Checking if the package $1 is installed" if [[ $(dpkg-query -W -f='${STATUS}' $1 2>/dev/null | grep -c "ok installed") = 0 ]]; then - - # If this is not the first attempt at installing this package... if [[ $attempt > 1 ]]; then - echo -e "\e[91m \e[5m[INSTALLATION ATTEMPT FAILED]\e[25m" - echo -e "\e[94m Will attempt to Install the package $1 again in ${wait_time} seconds (ATTEMPT ${attempt} OF ${max_attempts})..." + LogAlertMessage "Inastallation attempt failed" + LogAlertMessage "Will attempt to Install the package $1 again in ${wait_time} seconds (attempt ${attempt} of ${max_attempts})" sleep $wait_time else - echo -e "\e[91m [NOT INSTALLED]" - echo -e "\e[94m Installing the package $1..." + LogFalseInline "[NOT INSTALLED]" + LogMessage "Installing the package ${1}" fi - - # Attempt to install the required package - echo -e "\e[97m" + echo "" attempt=$((attempt+1)) sudo apt-get install -y $1 - echo -e "\e[39m" + echo "" else - # The package appears to be installed - echo -e "\e[92m [OK]\e[39m" + LogTrueInline "[OK]" break fi done } -# Blacklist DVB-T drivers for RTL-SDR devices + +## BLACKLIST DVB-T DRIVERS FOR RTL-SDR DEVICES + function BlacklistModules { if [[ ! -f /etc/modprobe.d/rtlsdr-blacklist.conf || `cat /etc/modprobe.d/rtlsdr-blacklist.conf | wc -l` < 9 ]]; then - echo -en "\e[94m Blacklisting unwanted RTL-SDR kernel modules so they are not loaded...\e[97m" + LogMessage "Blacklisting unwanted RTL-SDR kernel modules so they are not loaded" sudo tee /etc/modprobe.d/rtlsdr-blacklist.conf > /dev/null <&1 1>&2 2>&3) + 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." 16 65 2 "dump1090-fa" "(FlightAware)" ON 3>&1 1>&2 2>&3) case ${DUMP1090_OPTION} in "dump1090-fa") DUMP1090_FORK="fa" @@ -165,11 +165,6 @@ if [[ ! "${DUMP1090_IS_INSTALLED}" = "true" ]] ; then esac fi -# If the FlightAware fork of dump1090 is or has been chosen to be installed PiAware must be installed. -if [[ "${DUMP1090_FORK}" = "fa" && "${DUMP1090_DO_INSTALL}" = "true" || "${DUMP1090_DO_UPGRADE}" = "true" ]]; then - FORCE_PIAWARE_INSTALL="true" -fi - # 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. @@ -416,11 +411,6 @@ else CONFIRMATION="${CONFIRMATION}\n * dump978" fi - # If PiAware is required add it to the list. - 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 while read FEEDER_CHOICE do @@ -516,7 +506,7 @@ if [[ "${RUN_AIRPLANESLIVE_SCRIPT}" = "true" ]]; then InstallAirplanesLive fi -if [[ "${RUN_PIAWARE_SCRIPT}" = "true" || "${FORCE_PIAWARE_INSTALL}" = "true" ]]; then +if [[ "${RUN_PIAWARE_SCRIPT}" = "true" ]]; then InstallPiAware fi diff --git a/bash/variables.sh b/bash/variables.sh index a7a19a58..0c316d3e 100644 --- a/bash/variables.sh +++ b/bash/variables.sh @@ -1,11 +1,22 @@ #!/bin/bash +## DISPLAY COLORS + +DISPLAY_DEFAULT="\033[0m" +DISPLAY_HEADING="\033[1;36m" +DISPLAY_MESSAGE="\033[2;36m" +DISPLAY_PROJECT_NAME="\033[1;31m" +DISPLAY_TITLE_HEADING="\033[1;32m" +DISPLAY_TITLE_MESSAGE="\033[2;32m" +DISPLAY_WARNING_HEADING="\033[1;33m" +DISPLAY_WARNING_MESSAGE="\033[2;33m" +DISPLAY_ALERT_HEADING="\033[1;31m" +DISPLAY_ALERT_MESSAGE="\033[2;31m" +DISPLAY_FALSE_INLINE="\033[2;31m" +DISPLAY_TRUE_INLINE="\033[2;32m" ## SOFTWARE VERSIONS -# The ADS-B Receiver Project -PROJECT_VERSION="2.8.4" - # FlightAware DUMP1090_FA_VERSION="9.0" DUMP978_FA_VERSION="9.0" @@ -23,17 +34,3 @@ FLIGHTRADAR24_CLIENT_VERSION="1.0.18-5" # OpenSky Network Client OPENSKY_NETWORK_CLIENT_VERSION="2.1.7-1" - - -## DISPLAY - -DISPLAY_DEFAULT = "\033[0m" -DISPLAY_HEADING = "\033[1;36m" -DISPLAY_MESSAGE = "\033[2;36m" -DISPLAY_PROJECT_NAME = "\033[1;33m" -DISPLAY_TITLE_HEADING = "\033[1;32m" -DISPLAY_TITLE_MESSAGE = "\033[2;32m" -DISPLAY_WARNING_HEADING = "\033[1;33m" -DISPLAY_WARNING_MESSAGE = "\033[2;33m" -DISPLAY_ALERT_HEADING = "\033[1;31m" -DISPLAY_ALERT_MESSAGE = "\033[2;31m" \ No newline at end of file diff --git a/install.sh b/install.sh index 947ea97a..e1a6cb5d 100755 --- a/install.sh +++ b/install.sh @@ -34,12 +34,17 @@ # # ##################################################################################### + +## ASSIGN VERSION VARIABLE + +project_version="2.8.5" + ## FUNCTIONS # Display the help message function DisplayHelp() { echo " " - echo "Usage: $0 [OPTION] [ARGUMENT] " + echo "Usage: $0 [OPTION] [ARGUMENT] " echo " " echo "-------------------------------------------------------------------------------------------" echo "Option GNU long option Description " @@ -48,6 +53,7 @@ function DisplayHelp() { echo "-d --development Skips local repository update so changes are not overwrote." echo "-h --help Shows this message. " echo "-m --mta= Specify which email MTA to use currently Exim or Postfix. " + echo "-v --version Displays the version being used. " echo "-------------------------------------------------------------------------------------------" echo " " } @@ -96,8 +102,9 @@ while [[ $# > 0 ]] ; do ;; --version | -v) # Display the version - echo $PROJECT_VERSION + echo $project_version exit 0 + ;; *) # Unknown options were set so exit echo -e "Error: Unknown option: $1" >&2 @@ -117,7 +124,7 @@ export RECEIVER_MTA=$mta project_branch="master" -export RECEIVER_PROJECT_TITLE="The ADS-B Receiver Project Preliminary Setup Process" +export RECEIVER_PROJECT_TITLE="ADS-B Receiver Installer v${project_version}" export RECEIVER_ROOT_DIRECTORY=$PWD export RECEIVER_BASH_DIRECTORY=$PWD/bash export RECEIVER_BUILD_DIRECTORY=$PWD/build @@ -126,24 +133,34 @@ export RECEIVER_BUILD_DIRECTORY=$PWD/build ## SOURCE EXTERNAL SCRIPTS source $RECEIVER_BASH_DIRECTORY/functions.sh +source $RECEIVER_BASH_DIRECTORY/variables.sh ## UPDATE PACKAGE LISTS AND INSTALL DEPENDENCIES clear -echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}\n" -echo -e "\e[92m ADS-B Receiver Project Package Dependency Check" -echo -e "\e[93m ------------------------------------------------------------------------------\e[97m\n" -echo -e "\e[94m Downloading the latest package lists for all enabled repositories and PPAs...\e[97m\n" +LogProjectTitle +LogTitleHeading "Starting ADS-B Receiver Installer package dependency check" +LogTitleMessage "------------------------------------------------------------------------------" + +LogHeading "Updating package lists for all enabled repositories and PPAs" + +LogMessage "Downloading the latest package lists for all enabled repositories and PPAs" +echo "" sudo apt-get update -echo -e "\n\e[94m Ensuring that all required packages are installed...\e[97m\n" + +LogHeading "Ensuring that all required packages are installed" + CheckPackage bc CheckPackage git CheckPackage lsb-base CheckPackage lsb-release CheckPackage whiptail -echo -e "\n\e[93m ------------------------------------------------------------------------------" -echo -e "\e[92m All required packages are installed.\e[39m\n" +echo "" + +LogTitleMessage "------------------------------------------------------------------------------" +LogTitleHeading "ADS-B Receiver Installer package dependency check complete" +echo "" read -p "Press enter to continue..." discard From 1251ae858f4641159af64512c0e8fff832d18642 Mon Sep 17 00:00:00 2001 From: jprochazka Date: Sun, 21 Jul 2024 22:04:26 -0400 Subject: [PATCH 06/26] The dump978-fa.sh script now utilizes color variables. --- bash/decoders/dump1090-fa.sh | 20 +-- bash/decoders/dump978-fa.sh | 247 +++++++++++++++++++++-------------- 2 files changed, 161 insertions(+), 106 deletions(-) diff --git a/bash/decoders/dump1090-fa.sh b/bash/decoders/dump1090-fa.sh index e8ec6c8f..7f4f2261 100755 --- a/bash/decoders/dump1090-fa.sh +++ b/bash/decoders/dump1090-fa.sh @@ -1,6 +1,6 @@ #!/bin/bash -## INCLUDE EXTERNAL SCRIPTS +## PRE INSTALLATION OPERATIONS source $RECEIVER_BASH_DIRECTORY/variables.sh source $RECEIVER_BASH_DIRECTORY/functions.sh @@ -49,7 +49,6 @@ echo "" LogHeading "Blacklist unwanted RTL-SDR kernel modules. -LogMessage "Blacklisting problematic kernel modules" BlacklistModules @@ -57,15 +56,19 @@ BlacklistModules LogHeading "Preparing the FlightAware Dump1090 Git repository" -if [[ -d $RECEIVER_BUILD_DIRECTORY/dump1090-fa && -d $RECEIVER_BUILD_DIRECTORY/dump1090.fa/.git ]]; then +if [[ -d $RECEIVER_BUILD_DIRECTORY/dump1090-fa/dump1090 && -d $RECEIVER_BUILD_DIRECTORY/dump1090.fa/dump1090/.git ]]; then LogMessage "Entering the dump1090 git repository directory" - cd $RECEIVER_BUILD_DIRECTORY/dump1090-fa + cd $RECEIVER_BUILD_DIRECTORY/dump1090-fa/dump1090 LogMessage "Pulling the dump1090 git repository" echo "" git pull else - LogMessage "Entering the ADS-B Receiver Project build directory" - cd $RECEIVER_BUILD_DIRECTORY + LogMessage "Creating the FlightAware dump1090 Project build directory" + echo "" + mkdir -vp $RECEIVER_BUILD_DIRECTORY/dump1090-fa + echo "" + LogMessage "Entering the FlightAware dump1090 Project build directory" + cd $RECEIVER_BUILD_DIRECTORY/dump1090-fa LogMessage "Cloning the dump1090 git repository" echo "" git clone https://github.com/flightaware/dump1090.git @@ -75,7 +78,9 @@ echo "" ## BUILD AND INSTALL THE DUMP1090-FA PACKAGE -LogMessage "Entering the Git repository" +LogHeading "Building the FlightAware dump1090-fa package" + +LogMessage "Entering the dump1090 Git repository" cd $RECEIVER_BUILD_DIRECTORY/dump1090-fa/dump1090 LogMessage "Determining which distribution to build the package tree for" @@ -95,7 +100,6 @@ cd $RECEIVER_BUILD_DIRECTORY/dump1090-fa/package/$distro LogMessage "Building the dump1090-fa Debian package" dpkg-buildpackage -b --no-sign -# TODO: Figure out a better way than using a variable to determine which package to install LogMessage "Installing the dump1090-fa Debian package" sudo dpkg -i $RECEIVER_BUILD_DIRECTORY/dump1090-fa/dump1090/dump1090-fa_${DUMP1090_FA_VERSION}_*.deb diff --git a/bash/decoders/dump978-fa.sh b/bash/decoders/dump978-fa.sh index 57b1bbc2..35a8a89b 100755 --- a/bash/decoders/dump978-fa.sh +++ b/bash/decoders/dump978-fa.sh @@ -1,6 +1,6 @@ #!/bin/bash -## INCLUDE EXTERNAL SCRIPTS +## PRE INSTALLATION OPERATIONS source $RECEIVER_BASH_DIRECTORY/variables.sh source $RECEIVER_BASH_DIRECTORY/functions.sh @@ -9,34 +9,94 @@ source $RECEIVER_BASH_DIRECTORY/functions.sh ## BEGIN SETUP clear -echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}" +LogProjectTitle +LogTitleHeading "Setting up the FlightAware Dump978 decoder" +LogTitleMessage "------------------------------------------------------------------------------" echo "" -echo -e "\e[92m Setting up dump978-fa..." -echo "" -echo -e "\e[93m ------------------------------------------------------------------------------\e[96m" -echo "" -if ! 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; then - echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m" - echo -e " Setup has been halted at the request of the user." + +if ! whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ + --title "FlightAware Dump978 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; then + LogAlertHeading "INSTALLATION HALTED" + LogAlertMessage "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" + LogTitleMessage "------------------------------------------------------------------------------" + LogTitleHeading "FlightAware Dump978 decoder setup halted" echo "" - read -p "Press enter to continue..." discard exit 1 fi +## GATHER REQUIRED INFORMATION FROM THE USER + +LogHeading "Gather information required to configure the ADS-B decoder and dump978-fa if needed" + +LogMessage "Checking if an ADS-B decoder is installed" +adsb_decoder_installed="false" +if [[ $(dpkg-query -W -f='${STATUS}' dump1090-fa 2>/dev/null | grep -c "ok installed") -eq 1 ]]; then + adsb_decoder_installed="true" +fi + +if [[ "${adsb_decoder_installed}" == "true" ]]; then + LogMessage "Checking if dump978-fa has been configured" + if grep -wq "driver=rtlsdr,serial=" /etc/default/dump978-fa; then + echo -e "The dump978-fa installation appears to have been configured" + else + whiptail --backtitle "FlightAware Dump978 Configuration" \ + --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 + + dump1090_device_serial_title="Enter the Dump1090 RTL-SDR Device Serial" + while [[ -z $dump1090_device_serial ]] ; do + dump1090_device_serial=$(whiptail --backtitle "FlightAware Dump978 Configuration" \ + --title "${dump1090_device_serial_title}" \ + --inputbox "\nEnter the serial number for your dump1090 RTL-SDR device." \ + 8 78) + whiptail_exit_status=$? + if [[ $whiptail_exit_status == 0 ]]; then + LogAlertHeading "INSTALLATION HALTED" + LogAlertMessage "Setup has been halted due to lack of required information" + echo "" + LogTitleMessage "------------------------------------------------------------------------------" + LogTitleHeading "FlightAware Dump978 decoder setup halted" + exit 1 + fi + dump1090_device_serial_title="Enter the Dump1090 RTL-SDR Device Serial (REQUIRED)" + done + + dump978_device_serial_title="Enter the Dump978 RTL-SDR Device Serial" + while [[ -z $dump1090_device_serial ]] ; do + dump978_device_serial=$(whiptail --backtitle "FlightAware Dump978 Configuration" \ + --title "${dump978_device_serial_title}" \ + --inputbox "\nEnter the serial number for your dump978 RTL-SDR device." \ + 8 78) + whiptail_exit_status=$? + if [[ $whiptail_exit_status == 0 ]]; then + LogAlertHeading "INSTALLATION HALTED" + LogAlertMessage "Setup has been halted due to lack of required information" + echo "" + LogTitleMessage "------------------------------------------------------------------------------" + LogTitleHeading "FlightAware Dump978 decoder setup halted" + exit 1 + fi + dump978_device_serial_title="Enter the Dump1090 RTL-SDR Device Serial (REQUIRED)" + done + fi +fi + + ## CHECK FOR PREREQUISITE PACKAGES -echo -e "\e[95m Installing packages needed to build and fulfill dependencies...\e[97m" -echo "" +LogHeading "Installing packages needed to fulfill FlightAware Dump978 decoder dependencies" + CheckPackage build-essential CheckPackage debhelper -CheckPackage libboost-system-dev +CheckPackage libboost-filesystem-dev CheckPackage libboost-program-options-dev CheckPackage libboost-regex-dev -CheckPackage libboost-filesystem-dev +CheckPackage libboost-system-dev CheckPackage libsoapysdr-dev CheckPackage soapysdr-module-rtlsdr echo "" @@ -44,136 +104,127 @@ echo "" ## BLACKLIST UNWANTED RTL-SDR MODULES +LogHeading "Blacklist unwanted RTL-SDR kernel modules" + BlacklistModules -## DOWNLOAD OR UPDATE THE DUMP978-FA SOURCE +## CLONE OR PULL THE FLIGHTAWARE DUMP978 DECODER SOURCE + +LogHeading "Preparing the FlightAware Dump978 Git repository" -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" + LogMessage "Entering the FlightAware dump978 git repository directory" + cd $RECEIVER_BUILD_DIRECTORY/dump978-fa/dump978 + LogMessage "Pulling the dump1090 git repository" 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" + LogMessage "Creating the FlightAware dump978 Project build directory" echo "" - mkdir -vp $RECEIVER_BUILD_DIRECTORY/dump978-fa + mkdir -vp $RECEIVER_BUILD_DIRECTORY/dump1090-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" + LogMessage "Entering the ADS-B Receiver Project build directory" + cd $RECEIVER_BUILD_DIRECTORY/dump978-fa + LogMessage "Cloning the FlightAware dump978 git repository" echo "" git clone https://github.com/flightaware/dump978.git fi echo "" -## BUILD AND INSTALL THE DUMP978-FA PACKAGE +## BUILD AND INSTALL THE DUMP978-FA and SKYAWARE978 PACKAGES -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" +LogHeading "Building the FlightAware dump978-fa and skyaware978 packages" + +LogMessage "Entering the dump978 Git repository" +cd $RECEIVER_BUILD_DIRECTORY/dump978-fa/dump978 + +LogMessage "Building the dump978-fa package" 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 "" + +LogMessage "Installing the dump1090-fa Debian package" 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 +LogMessage "Installing the skyaware978 Debian package" +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" +LogMessage "Checking that the dump978-fa Debian package was installed" if [[ $(dpkg-query -W -f='${STATUS}' dump978-fa 2>/dev/null | grep -c "ok installed") -eq 0 ]]; then echo "" - echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m" - echo -e " UNABLE TO INSTALL A REQUIRED PACKAGE." - echo -e " SETUP HAS BEEN TERMINATED!" + LogAlertHeading "INSTALLATION HALTED" echo "" - echo -e "\e[93mThe package \"dump978-fa\" could not be installed.\e[39m" + LogAlertMessage "The dump978-fa Debian package failed to install" + LogAlertMessage "Setup has been terminated" echo "" - echo -e "\e[93m ------------------------------------------------------------------------------" - echo -e "\e[92m Dump978-fa setup halted.\e[39m" + LogTitleMessage "------------------------------------------------------------------------------" + LogTitleHeading "FlightAware Dump978 decoder setup halted" echo "" read -p "Press enter to continue..." discard 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 "" +LogMessage "Checking that the skyaware978 Debian package was installed" +if [[ $(dpkg-query -W -f='${STATUS}' skyaware978 2>/dev/null | grep -c "ok installed") -eq 0 ]]; then + echo "" + LogAlertHeading "INSTALLATION HALTED" + echo "" + LogAlertMessage "The skyaware978 Debian package failed to install" + LogAlertMessage "Setup has been terminated" + echo "" + LogTitleMessage "------------------------------------------------------------------------------" + LogTitleHeading "FlightAware Dump978 decoder setup halted" + echo "" + read -p "Press enter to continue..." discard + exit 1 fi -# Archive binary package -echo -e "\e[94m Moving the dump978-fa binary package into the archive directory...\e[97m" +if [[ ! -d $RECEIVER_BUILD_DIRECTORY/package-archive ]]; then + LogMessage "Creating the Debian package archive directory" + echo "" + mkdir -vp $RECEIVER_BUILD_DIRECTORY/package-archive + echo "" +fi +LogMessage "Copying the dump978-fa Debian package into the Debian package archive directory" +echo "" +cp -vf $RECEIVER_BUILD_DIRECTORY/piaware_builder/*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ echo "" -cp -vf $RECEIVER_BUILD_DIRECTORY/dump978-fa/*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ 2>&1 +LogMessage "Copying the skyaware978 Debian package into the Debian package archive directory" +echo "" +cp -vf $RECEIVER_BUILD_DIRECTORY/piaware_builder/*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ 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 +if [[ "${adsb_decoder_installed}" == "true" ]]; then + + LogHeading "Configuring the ADS-B decoder and dump978-fa so they can work in tandem" + + LogMessage "Assigning RTL-SDR device with serial ${dump978_device_serial} to dump978-fa" + sudo sed -i -e "s/driver=rtlsdr/driver=rtlsdr,serial=${dump978_device_serial}/g" /etc/default/dump978-fa + LogMessage "Restarting dump978-fa...\e[97m" + sudo servicectl restart dump978-fa + + if [[ $(dpkg-query -W -f='${STATUS}' dump1090-fa 2>/dev/null | grep -c "ok installed") -eq 1 ]]; then + LogMessage "Assigning RTL-SDR device with serial ${dump1090_device_serial} to the FlightAware Dump1090 decoder" + ChangeConfig "RECEIVER_SERIAL" $dump1090_device_serial "/etc/default/dump1090-fa" + LogMessage "Restarting dump1090-fa" + sudo servicectl restart dump1090-fa 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 +LogMessage "Returning to ${RECEIVER_PROJECT_TITLE} root directory" +cd $RECEIVER_ROOT_DIRECTORY echo "" -echo -e "\e[93m ------------------------------------------------------------------------------" -echo -e "\e[92m Dump978-fa setup is complete.\e[39m" +LogTitleMessage "------------------------------------------------------------------------------" +LogTitleHeading "FlightAware Dump978 decoder setup is complete" echo "" read -p "Press enter to continue..." discard From 278fb3e895875005b4d6d920a72989991fc14d47 Mon Sep 17 00:00:00 2001 From: jprochazka Date: Sun, 21 Jul 2024 22:33:59 -0400 Subject: [PATCH 07/26] The adsbexchange.sh script now utilizes color variables. --- CHANGELOG.md | 8 ++- bash/decoders/dump1090-fa.sh | 1 - bash/decoders/dump978-fa.sh | 1 - bash/feeders/adsbexchange.sh | 97 ++++++++++++++++++++---------------- bash/feeders/piaware.sh | 5 +- 5 files changed, 59 insertions(+), 53 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 37a87a4f..8c6d2bfa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,22 +4,20 @@ The following is a history of the changes made to this project. ## v2.8.5 *(in development)* +### Installer + * Added the --version and -v arguments in order to display the current project version. * Added logging functions which in the future will offer a way to log output to files. * Added variables which can be modified to adjust text colors used by the Bash scripts. * The installation of PiAware is no longer required when choosing to install dump1090-fa. * The dump1090-fa installation script to match current installation dump1090-fa instructions. * Modified the dump1090-fa installation script so that it utilizes the new logging functions. +* Modified the dump978-fa installation script so that it utilizes the new logging functions. * The PiAware installation script now supports Ubuntu Noble Numbat. ## v2.8.4 *(July 13th, 2024)* :rooster: -### Installers - * Added the option to install the airplanes.live feeder client and web interface. - -### Portal - * Can now toggle daily data purges as well specify the number of days to keep within the portal. * Rewrote the aircraft.py script and fixed issues found with newer versions of dump1090. * Rewrote the maintenance.py script and addressed issue mentioned in an incompatible pull request. diff --git a/bash/decoders/dump1090-fa.sh b/bash/decoders/dump1090-fa.sh index 7f4f2261..9ba832cd 100755 --- a/bash/decoders/dump1090-fa.sh +++ b/bash/decoders/dump1090-fa.sh @@ -13,7 +13,6 @@ LogProjectName ${RECEIVER_PROJECT_TITLE} LogTitleHeading "Setting up the FlightAware Dump1090 decoder" LogTitleMessage "------------------------------------------------------------------------------" echo "" - if ! whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ --title "FlightAware Dump1090 Decoder Setup" \ --yesno "FlightAware Dump1090 is an ADS-B, Mode S, and Mode 3A/3C demodulator and decoder that will receive and decode aircraft transponder messages received via a directly connected software defined radio, or from data provided over a network connection.\n\nWebsite: https://www.flightaware.com/\nGitHub Repository: https://github.com/flightaware/dump1090\n\nWould you like to begin the setup process now?" \ diff --git a/bash/decoders/dump978-fa.sh b/bash/decoders/dump978-fa.sh index 35a8a89b..40fbaf16 100755 --- a/bash/decoders/dump978-fa.sh +++ b/bash/decoders/dump978-fa.sh @@ -13,7 +13,6 @@ LogProjectTitle LogTitleHeading "Setting up the FlightAware Dump978 decoder" LogTitleMessage "------------------------------------------------------------------------------" echo "" - if ! whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ --title "FlightAware Dump978 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?" \ diff --git a/bash/feeders/adsbexchange.sh b/bash/feeders/adsbexchange.sh index 1ebccee8..e7e800d5 100755 --- a/bash/feeders/adsbexchange.sh +++ b/bash/feeders/adsbexchange.sh @@ -9,58 +9,60 @@ source $RECEIVER_BASH_DIRECTORY/functions.sh ## BEGIN SETUP 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 ! 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; then - 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..." discard +LogProjectName ${RECEIVER_PROJECT_TITLE} +LogTitleHeading "Setting up the ADS-B Exchange client" +LogTitleMessage "------------------------------------------------------------------------------" +echo "" +if ! 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; then + LogAlertHeading "INSTALLATION HALTED" + LogAlertMessage "Setup has been halted at the request of the user" + echo "" + LogTitleMessage "------------------------------------------------------------------------------" + LogTitleHeading "ADS-B Exchange client setup halted" + echo "" exit 1 fi -## DOWNLOAD AND EXECUTE THE INSTALL SCRIPT +## DOWNLOAD AND EXECUTE THE ADS-B EXCHANGE CLIENT INSTALL SCRIPT -# 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 +LogHeading "Executing either the install or upgrade script" -echo -e "\e[95m Preparing to execute either the install or upgrade script...\e[97m" -echo "" +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 -# 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 + LogMessage "Creating the ADSBExchange build directory" + echo "" + mkdir -vp $RECEIVER_BUILD_DIRECTORY/adsbexchange + echo "" fi -echo -e "\e[94m Entering the ADSBExchange build directory...\e[97m" +LogMessage "Entering the ADSBExchange build directory" cd $RECEIVER_BUILD_DIRECTORY/adsbexchange -# Determine if the feeder is already installed or not +LogMessage "Determining if the installation or upgrade script should be executed" 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 -# Begin the install or upgrade process -echo -e "\e[94m Downloading the ${action_to_perform} script...\e[97m" +LogMessage "Downloading the ADS-B Exchange client ${action_to_perform} script" echo "" if [[ "${action_to_perform}" = "install" ]]; then + echo "" wget -O $RECEIVER_BUILD_DIRECTORY/adsbexchange/feed-${action_to_perform}.sh https://www.adsbexchange.com/feed.sh else + echo "" wget -O $RECEIVER_BUILD_DIRECTORY/adsbexchange/feed-${action_to_perform}.sh https://www.adsbexchange.com/feed-update.sh fi +echo "" -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" +LogMessage "Executing the ADS-B Exchange client ${action_to_perform} script" echo "" sudo bash $RECEIVER_BUILD_DIRECTORY/adsbexchange/feed-${action_to_perform}.sh echo "" @@ -68,41 +70,50 @@ echo "" ## INSTALL THE ADS-B EXCHANGE STATS PACKAGE -if whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "ADS-B Exchange Feed Setup" --yesno "ADS-B Exchange offers the option to install their stats package in order to send your stats to their site.\n\nWould you like to install the stats package now?" 12 78; then - echo -e "\e[95m Executing the ADS-B Exchange script to install their web interface...\e[97m" - echo "" - echo -e "\e[94m Downloading the stats package installation script...\e[97m" +LogHeading "Starting the ADS-B Exchange stats package setup process" + +LogMessage "Asking if the user wishes to install the ADS-B Exchange stats package" +if whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ + --title "ADS-B Exchange Feed Setup" \ + --yesno "ADS-B Exchange offers the option to install their stats package in order to send your stats to their site.\n\nWould you like to install the stats package now?" \ + 12 78; then + LogMessage "Downloading the ADS-B Exchange stats package installation script" echo "" curl -L -o $RECEIVER_BUILD_DIRECTORY/adsbexchange/axstats.sh https://adsbexchange.com/stats.sh echo "" - echo -e "\e[94m Executing the stats package installation script...\e[97m" + echo -e "Executing the ADS-B Exchange stats package installation script" echo "" sudo bash $RECEIVER_BUILD_DIRECTORY/adsbexchange/axstats.sh echo "" +else + LogMessage "The user opted out of installing the ADS-B Exchange stats package"" fi ## INSTALL THE ADS-B EXCHANGE WEB INTERFACE -if whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "ADS-B Exchange Feed Setup" --yesno "ADS-B Exchange offers the option to install an additional web interface.\n\nWould you like to install the web interface now?" 12 78; then - echo -e "\e[95m Executing the ADS-B Exchange script to install their web interface...\e[97m" - echo "" - echo -e "\e[94m Executing the ADS-B Exchange web interface installation script...\e[97m" +LogHeading "Starting the ADS-B Exchange web interface setup process" + +LogMessage "Asking if the user wishes to install the ADS-B Exchange web interface" +if whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ + --title "ADS-B Exchange Feed Setup" \ + --yesno "ADS-B Exchange offers the option to install an additional web interface.\n\nWould you like to install the web interface now?" \ + 12 78; then + echo -e "Executing the ADS-B Exchange web interface installation script" echo "" sudo bash /usr/local/share/adsbexchange/git/install-or-update-interface.sh echo "" fi -## ADS-B EXCHANGE FEED SETUP COMPLETE +## SETUP COMPLETE -# Enter into the project root directory. -echo -e "\e[94m Entering the ADS-B Receiver Project root directory...\e[97m" +LogMessage "Returning to ${RECEIVER_PROJECT_TITLE} root directory" cd $RECEIVER_ROOT_DIRECTORY echo "" -echo -e "\e[93m-------------------------------------------------------------------------------------------------------" -echo -e "\e[92m ADS-B Exchange feed setup is complete.\e[39m" +LogTitleMessage "------------------------------------------------------------------------------" +LogTitleHeading "ADS-B Exchange client client setup is complete" echo "" read -p "Press enter to continue..." discard diff --git a/bash/feeders/piaware.sh b/bash/feeders/piaware.sh index c4e8e668..4bbed549 100755 --- a/bash/feeders/piaware.sh +++ b/bash/feeders/piaware.sh @@ -19,10 +19,9 @@ source $RECEIVER_BASH_DIRECTORY/functions.sh clear LogProjectName ${RECEIVER_PROJECT_TITLE} -LogTitleHeading "Setting up the FlightAware PiAware Client" +LogTitleHeading "Setting up the FlightAware PiAware client" LogTitleMessage "------------------------------------------------------------------------------" echo "" - if ! 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?" \ @@ -31,7 +30,7 @@ if ! whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ LogAlertMessage "Setup has been halted at the request of the user" echo "" LogTitleMessage "------------------------------------------------------------------------------" - LogTitleHeading "FlightAware PiAware Client setup halted" + LogTitleHeading "FlightAware PiAware client setup halted" echo "" exit 1 fi From ca3ba03f6aedafb0646490e74516451d394d9067 Mon Sep 17 00:00:00 2001 From: jprochazka Date: Sun, 21 Jul 2024 23:06:44 -0400 Subject: [PATCH 08/26] The airplaneslive.sh script now uses new logging functions. --- CHANGELOG.md | 14 ++-- bash/feeders/adsbexchange.sh | 11 +-- bash/feeders/airplaneslive.sh | 122 +++++++++++++++++----------------- 3 files changed, 73 insertions(+), 74 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c6d2bfa..4c4fc922 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,16 +4,16 @@ The following is a history of the changes made to this project. ## v2.8.5 *(in development)* -### Installer - -* Added the --version and -v arguments in order to display the current project version. -* Added logging functions which in the future will offer a way to log output to files. -* Added variables which can be modified to adjust text colors used by the Bash scripts. +* The PiAware installation script now supports Ubuntu Noble Numbat. * The installation of PiAware is no longer required when choosing to install dump1090-fa. -* The dump1090-fa installation script to match current installation dump1090-fa instructions. +* The dump1090-fa installation script now mimics the current dump1090-fa installation instructions. +* Added logging functions which in the future will offer a way to log output to files. +* Added variables which can be modified to adjust text colors used by the bash scripts. * Modified the dump1090-fa installation script so that it utilizes the new logging functions. * Modified the dump978-fa installation script so that it utilizes the new logging functions. -* The PiAware installation script now supports Ubuntu Noble Numbat. +* Modified the ADS-B Exchange client installation script so it utilizes the new logging functions. +* Modified the airplanes.live client installation script so it utilizes the new logging functions. +* Added the --version and -v arguments in order to display the current project version. ## v2.8.4 *(July 13th, 2024)* :rooster: diff --git a/bash/feeders/adsbexchange.sh b/bash/feeders/adsbexchange.sh index e7e800d5..63b1521e 100755 --- a/bash/feeders/adsbexchange.sh +++ b/bash/feeders/adsbexchange.sh @@ -29,8 +29,9 @@ fi ## DOWNLOAD AND EXECUTE THE ADS-B EXCHANGE CLIENT INSTALL SCRIPT -LogHeading "Executing either the install or upgrade script" +LogHeading "Downloading the proper ADS-B Exchange client script" +LogMessage "Informing the user of how the installation process will work" 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." \ @@ -45,7 +46,7 @@ fi LogMessage "Entering the ADSBExchange build directory" cd $RECEIVER_BUILD_DIRECTORY/adsbexchange -LogMessage "Determining if the installation or upgrade script should be executed" +LogMessage "Determining whether the installation or upgrade script should be used" action_to_perform="install" if [[ -f /lib/systemd/system/adsbexchange-mlat.service && -f /lib/systemd/system/adsbexchange-feed.service ]]; then action_to_perform="upgrade" @@ -54,10 +55,8 @@ fi LogMessage "Downloading the ADS-B Exchange client ${action_to_perform} script" echo "" if [[ "${action_to_perform}" = "install" ]]; then - echo "" wget -O $RECEIVER_BUILD_DIRECTORY/adsbexchange/feed-${action_to_perform}.sh https://www.adsbexchange.com/feed.sh else - echo "" wget -O $RECEIVER_BUILD_DIRECTORY/adsbexchange/feed-${action_to_perform}.sh https://www.adsbexchange.com/feed-update.sh fi echo "" @@ -86,7 +85,7 @@ if whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ sudo bash $RECEIVER_BUILD_DIRECTORY/adsbexchange/axstats.sh echo "" else - LogMessage "The user opted out of installing the ADS-B Exchange stats package"" + LogMessage "The user opted out of installing the ADS-B Exchange stats package" fi @@ -103,6 +102,8 @@ if whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ echo "" sudo bash /usr/local/share/adsbexchange/git/install-or-update-interface.sh echo "" +else + LogMessage "The user opted out of installing the ADS-B Exchange web interface" fi diff --git a/bash/feeders/airplaneslive.sh b/bash/feeders/airplaneslive.sh index 8d515a4c..af78f0bf 100755 --- a/bash/feeders/airplaneslive.sh +++ b/bash/feeders/airplaneslive.sh @@ -1,63 +1,54 @@ #!/bin/bash -## INCLUDE EXTERNAL SCRIPTS +## PRE INSTALLATION OPERATIONS source $RECEIVER_BASH_DIRECTORY/variables.sh source $RECEIVER_BASH_DIRECTORY/functions.sh - -## BEGIN SETUP - clear -echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}" -echo -e "" -echo -e "\e[92m Setting up the airplanes.live feeder client..." -echo -e "" -echo -e "\e[93m ------------------------------------------------------------------------------\e[96m" -echo -e "" - - -# Confirm component installation. -if ! whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Airplanes.live Feeder Client Setup" --yesno "The airplanes.live feeder client takes data from a local dump1090 instance and shares this with airplanes.live. for more information please see their website:\n\n https://airplanes.live/how-to-feed/\n\nContinue setup by installing the airplanes.live feeder client?" 13 78 3>&1 1>&2 2>&3; then - 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 Airplanes.live feeder client setup halted.\e[39m" - echo -e "" - read -p "Press enter to continue..." discard +LogProjectName ${RECEIVER_PROJECT_TITLE} +LogTitleHeading "Setting up the Airplanes.live client" +LogTitleMessage "------------------------------------------------------------------------------" +echo "" +if ! whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ + --title "Airplanes.live Feeder Client Setup" \ + --yesno "The airplanes.live feeder client takes data from a local dump1090 instance and shares this with airplanes.live. for more information please see their website:\n\n https://airplanes.live/how-to-feed/\n\nContinue setup by installing the airplanes.live feeder client?" \ + 13 78; then + LogAlertHeading "INSTALLATION HALTED" + LogAlertMessage "Setup has been halted at the request of the user" + echo "" + LogTitleMessage "------------------------------------------------------------------------------" + LogTitleHeading "Airplanes.live client setup halted" + echo "" exit 1 fi -## START FEEDER INSTALLATION +## DOWNLOAD AND EXECUTE THE AIRPLANES.LIVE CLIENT INSTALL SCRIPT + +LogHeading "Begining the airplanes.live feeder client installation process" -echo -e "" -echo -e "\e[95m Begining the airplanes.live feeder client installation process...\e[97m" -echo -e "" +LogMessage "Informing the user of how the installation process will work" +whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ + --title "ADS-B Exchange Feed Setup" \ + --msgbox "Scripts supplied by airplanes.live 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 -# Create the component build directory if it does not exist -if [[ ! -d $RECEIVER_BUILD_DIRECTORY/airplaneslive ]]; then - echo -e "\e[94m Creating the airplanes.live feeder client build directory...\e[97m" +if [[ ! -d $RECEIVER_BUILD_DIRECTORY/adsbexchange ]]; then + LogMessage "Creating the airplanes.live build directory" echo "" mkdir -vp $RECEIVER_BUILD_DIRECTORY/airplaneslive echo "" fi +LogMessage "Entering the airplanes.live build directory" +cd $RECEIVER_BUILD_DIRECTORY/airplaneslive -# Change to the component build directory -echo -e "\e[94m Entering the airplanes.live feeder client build directory...\e[97m" -cd $RECEIVER_BUILD_DIRECTORY/airplaneslive 2>&1 +LogMessage "Downloading the airplanes.live client installation script" echo "" - -# Download the official airplanes.live feeder installation script -echo -e "\e[95m Beginning the airplanes.live feeder client installation...\e[97m" -echo -e "" - -echo -e "\e[94m Downloading the airplanes.live feeder client installation script...\e[97m" +wget -O $RECEIVER_BUILD_DIRECTORY/airplaneslive/install.sh https://raw.githubusercontent.com/airplanes-live/feed/main/install.sh echo "" -wget -v https://raw.githubusercontent.com/airplanes-live/feed/main/install.sh -echo -e "\e[94m Executing the airplanes.live feeder client installation script...\e[97m" +LogMessage "Executing the airplanes.live client installation script" echo "" sudo bash $RECEIVER_BUILD_DIRECTORY/airplaneslive/install.sh echo "" @@ -65,49 +56,56 @@ echo "" ## CHECK THE STATUS OF THE FEEDER -echo -e "\e[95m Checking if the reciver is now feeding airplanes.live...\e[97m" -echo -e "" -"\e[95m Checking for connections on ports 30004 and 31090 to IP address 78.46.234.18...\e[97m" +LogHeading "Checking if the reciver is now feeding airplanes.live" + +LogMessage "Checking for connections on ports 30004 and 31090 to IP address 78.46.234.18" netstat_output = `netstat -t -n | grep -E '30004|31090'` if [[ $netstat_output == *"78.46.234.18:30004 ESTABLISHED"* && $netstat_output == *"78.46.234.18:31090 ESTABLISHED"* ]] - "\e[95m The receiver appears to be feeding airplanes.live...\e[97m" + LogMessage "This device appears to be connected to airplanes.live" else - "\e[91m The receiver does not appear to be feeding airplanes.live at this time...\e[97m" - "\e[95m Please reboot your device and run the command ''netstat -t -n | grep -E '30004|31090' to see if a connection has been astablished.\e[97m" - "\e[95m If the issue presists supply the last 20 lines given by the following command on the airplanes.live discord.\e[97m" - "\e[95m 'sudo journalctl -u airplanes-feed --no-pager'\e[97m" - "\e[95m 'sudo journalctl -u airplanes-mlat --no-pager'\e[97m" + LogAlertMessage "The receiver does not appear to be feeding airplanes.live at this time...\e[97m" + LogAlertMessage "Please reboot your device and run the command 'netstat -t -n | grep -E '30004|31090' to see if a connection has been astablished." + LogAlertMessage "If the issue presists supply the last 20 lines given by the following command on the airplanes.live discord." + LogAlertMessage " 'sudo journalctl -u airplanes-feed --no-pager'" + LogAlertMessage " 'sudo journalctl -u airplanes-mlat --no-pager'" fi -echo "" ## INSTALL THE AIRPLANES.LIVE WEB INTERFACE -if whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Airplanes.live Web Interface Setup" --yesno "Airplanes.live offers the option to install an additional web interface.\n\nWould you like to install the web interface now?" 12 78; then - echo -e "\e[95m Begining the airplanes.live web interface installation...\e[97m" +LogHeading "Starting the airplanes.live web interface setup process" + +LogMessage "Asking if the user wishes to install the ADS-B Exchange web interface" +if whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ + --title "Airplanes.live Web Interface Setup" \ + --yesno "Airplanes.live offers the option to install an additional web interface.\n\nWould you like to install the web interface now?" \ + 12 78; then echo "" - echo -e "\e[94m Executing the airplanes.live web interface installation script...\e[97m" + LogMessage "Executing the airplanes.live web interface installation script" echo "" sudo bash sudo bash /usr/local/share/airplanes/git/install-or-update-interface.sh - echo "" +else + LogMessage "The user opted out of installing the airplanes.live web interface" fi -## POST INSTALLATION INFORMATION +## POST INSTALLATION OPERATIONS -whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Airplanes.live Feeder Setup Complete" --msgbox "Setup of the airplanes.live feeder client is now complete. You can check your feeder status at https://airplanes.live/myfeed." 12 78 +whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ + --title "Airplanes.live Client Setup Complete" \ + --msgbox "Setup of the airplanes.live client is now complete. You can check your feeder status at https://airplanes.live/myfeed." \ + 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 +LogMessage "Returning to ${RECEIVER_PROJECT_TITLE} root directory" +cd $RECEIVER_ROOT_DIRECTORY -echo -e "" -echo -e "\e[93m ------------------------------------------------------------------------------" -echo -e "\e[92m Airplanes.live feeder client setup is complete.\e[39m" -echo -e "" +echo "" +LogTitleMessage "------------------------------------------------------------------------------" +LogTitleHeading "Airplanes.live client setup is complete" +echo "" read -p "Press enter to continue..." discard exit 0 From 953284368518ee2377d3a37d319267c9b5359cd3 Mon Sep 17 00:00:00 2001 From: jprochazka Date: Sun, 21 Jul 2024 23:30:05 -0400 Subject: [PATCH 09/26] The FlightRadar24 script now uses new logging functions. --- CHANGELOG.md | 1 + bash/feeders/airplaneslive.sh | 6 +- bash/feeders/flightradar24.sh | 115 ++++++++++++++++------------------ bash/feeders/piaware.sh | 1 - 4 files changed, 58 insertions(+), 65 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c4fc922..a8418807 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ The following is a history of the changes made to this project. * Modified the dump978-fa installation script so that it utilizes the new logging functions. * Modified the ADS-B Exchange client installation script so it utilizes the new logging functions. * Modified the airplanes.live client installation script so it utilizes the new logging functions. +* Modified the FlightRadar24 client installation script so it utilizes the new logging functions. * Added the --version and -v arguments in order to display the current project version. ## v2.8.4 *(July 13th, 2024)* :rooster: diff --git a/bash/feeders/airplaneslive.sh b/bash/feeders/airplaneslive.sh index af78f0bf..2de023d2 100755 --- a/bash/feeders/airplaneslive.sh +++ b/bash/feeders/airplaneslive.sh @@ -34,7 +34,7 @@ whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ --msgbox "Scripts supplied by airplanes.live 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 -if [[ ! -d $RECEIVER_BUILD_DIRECTORY/adsbexchange ]]; then +if [[ ! -d $RECEIVER_BUILD_DIRECTORY/airplaneslive ]]; then LogMessage "Creating the airplanes.live build directory" echo "" mkdir -vp $RECEIVER_BUILD_DIRECTORY/airplaneslive @@ -45,7 +45,7 @@ cd $RECEIVER_BUILD_DIRECTORY/airplaneslive LogMessage "Downloading the airplanes.live client installation script" echo "" -wget -O $RECEIVER_BUILD_DIRECTORY/airplaneslive/install.sh https://raw.githubusercontent.com/airplanes-live/feed/main/install.sh +wget -v -O $RECEIVER_BUILD_DIRECTORY/airplaneslive/install.sh https://raw.githubusercontent.com/airplanes-live/feed/main/install.sh echo "" LogMessage "Executing the airplanes.live client installation script" @@ -54,7 +54,7 @@ sudo bash $RECEIVER_BUILD_DIRECTORY/airplaneslive/install.sh echo "" -## CHECK THE STATUS OF THE FEEDER +## CHECK THE STATUS OF THE CLIENT LogHeading "Checking if the reciver is now feeding airplanes.live" diff --git a/bash/feeders/flightradar24.sh b/bash/feeders/flightradar24.sh index 92d3b107..dff479b8 100755 --- a/bash/feeders/flightradar24.sh +++ b/bash/feeders/flightradar24.sh @@ -1,105 +1,98 @@ #!/bin/bash -## INCLUDE EXTERNAL SCRIPTS +## PRE INSTALLATION OPERATIONS source $RECEIVER_BASH_DIRECTORY/variables.sh source $RECEIVER_BASH_DIRECTORY/functions.sh - -## BEGIN SETUP - clear -echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}" -echo -e "" -echo -e "\e[92m Setting up FlightRadar24 feeder client..." -echo -e "" -echo -e "\e[93m ------------------------------------------------------------------------------\e[96m" -echo -e "" - -# Confirm component installation. -if ! 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; then - 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..." discard +LogProjectName ${RECEIVER_PROJECT_TITLE} +LogTitleHeading "Setting up the FlightRadar24 client" +LogTitleMessage "------------------------------------------------------------------------------" +echo "" + +if ! 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; then + LogAlertHeading "INSTALLATION HALTED" + LogAlertMessage "Setup has been halted at the request of the user" + echo "" + LogTitleMessage "------------------------------------------------------------------------------" + LogTitleHeading "FlightRadar24 client setup halted" + echo "" exit 1 fi -## START INSTALLATION +## DOWNLOAD AND EXECUTE THE FLIGHTRADAR24 CLIENT INSTALL SCRIPT -echo -e "" -echo -e "\e[95m Begining the FlightRadar24 feeder client installation process...\e[97m" -echo -e "" +LogHeading "Begining the FlightRadar24 client installation process" -# Create the component build directory if it does not exist if [[ ! -d $RECEIVER_BUILD_DIRECTORY/flightradar24 ]]; then - echo -e "\e[94m Creating the FlightRadar24 feeder client build directory...\e[97m" + LogMessage "Creating the FlightRadar24 build directory" echo "" mkdir -vp $RECEIVER_BUILD_DIRECTORY/flightradar24 echo "" fi +LogMessage "Entering the FlightRadar24 build directory" +cd $RECEIVER_BUILD_DIRECTORY/flightradar24 -# Change to the component build directory -echo -e "\e[94m Entering the FlightRadar24 feeder client build directory...\e[97m" -cd $RECEIVER_BUILD_DIRECTORY/flightradar24 2>&1 +LogMessage "Downloading the airplanes.live client installation script" echo "" - -# Download the official Flightradar24 installation script -echo -e "\e[95m Beginning the Flightradar24 client installation...\e[97m" -echo -e "" - -echo -e "\e[94m Downloading the Flightradar24 client installation script...\e[97m" +wget -v -O $RECEIVER_BUILD_DIRECTORY/flightradar24/install.sh https://fr24.com/install.sh echo "" -wget -v https://fr24.com/install.sh -echo -e "\e[94m Executing the Flightradar24 client installation script...\e[97m" +LogMessage "Executing the airplanes.live client installation script" echo "" sudo bash $RECEIVER_BUILD_DIRECTORY/flightradar24/install.sh echo "" -# Check that the component package was installed successfully. -echo -e "\e[94m Checking that the FlightRadar24 feeder client package was installed properly...\e[97m" +## CHECK THE STATUS OF THE CLIENT + +LogHeading "Checking if the FlightRadar24 client was installed successfully" + +echo -e "\e[94m Checking that the FlightRadar24 client package was installed" if [[ $(dpkg-query -W -f='${STATUS}' fr24feed 2>/dev/null | grep -c "ok installed") -eq 0 ]]; then - 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 "" - read -p "Press enter to continue..." CONTINUE + echo "" + LogAlertHeading "INSTALLATION HALTED" + echo "" + LogAlertMessage "FlightRadar24 package installation failed" + LogAlertMessage "Setup has been terminated" + echo "" + LogTitleMessage "------------------------------------------------------------------------------" + LogTitleHeading "FlightRadar24 client setup failed" + echo "" + read -p "Press enter to continue..." discard exit 1 fi -## COMPONENT POST INSTALL ACTIONS +## POST INSTALLATION OPERATIONS + +LogHeading "Performing post installation operations" -# If sharing to other networks alongside Flightradar24 make sure MLAT is disabled -echo -e "\e[94m Flightradar24 asks that MLAT be disabled if sharing with other networks...\e[97m" +LogMessage "Flightradar24 asks that MLAT be disabled if sharing with other networks" ChangeConfig "mlat" "no" "/etc/fr24feed.ini" ChangeConfig "mlat-without-gps" "no" "/etc/fr24feed.ini" -echo -e "\e[94m Restarting the Flightradar24 client...\e[97m" +LogMessage "Restarting the Flightradar24 client" sudo systemctl restart fr24feed +LogWarningMessage "If the Flightradar24 client is the only feeder utilizing MLAT execute the following commands to enable MLAT" +LogWarningMessage 'sudo sed -i -e "s/\(mlat *= *\).*/\1\"yes\"/" /etc/fr24feed.ini' +LogWarningMessage 'sudo sed -i -e "s/\(mlat-without-gps *= *\).*/\1\"yes\"/" /etc/fr24feed.ini' + ## 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 +LogMessage "Returning to ${RECEIVER_PROJECT_TITLE} root directory" +cd $RECEIVER_ROOT_DIRECTORY -echo -e "" -echo -e "\e[93m ------------------------------------------------------------------------------" -echo -e "\e[92m FlightRadar24 feeder client setup is complete.\e[39m" -echo -e "" +echo "" +LogTitleMessage "------------------------------------------------------------------------------" +LogTitleHeading "FlightRadar24 client setup is complete" +echo "" read -p "Press enter to continue..." discard exit 0 diff --git a/bash/feeders/piaware.sh b/bash/feeders/piaware.sh index 4bbed549..968bbe22 100755 --- a/bash/feeders/piaware.sh +++ b/bash/feeders/piaware.sh @@ -206,7 +206,6 @@ echo "" LogMessage "Checking that the FlightAware PiAware client package was installed properly" if [[ $(dpkg-query -W -f='${STATUS}' piaware 2>/dev/null | grep -c "ok installed") -eq 0 ]]; then - echo "" LogAlertHeading "INSTALLATION HALTED" echo "" LogAlertMessage "FlightAware PiAware package installation failed" From b83cd9c1cae1a747d28259b037f20ac725af5cbc Mon Sep 17 00:00:00 2001 From: jprochazka Date: Sun, 21 Jul 2024 23:54:47 -0400 Subject: [PATCH 10/26] The Fly Italy ADS-B script now uses new logging functions. --- CHANGELOG.md | 1 + bash/feeders/airplaneslive.sh | 4 +- bash/feeders/flyitalyadsb.sh | 113 ++++++++++++++++------------------ 3 files changed, 57 insertions(+), 61 deletions(-) mode change 100644 => 100755 bash/feeders/flyitalyadsb.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index a8418807..8852d152 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ The following is a history of the changes made to this project. * Modified the ADS-B Exchange client installation script so it utilizes the new logging functions. * Modified the airplanes.live client installation script so it utilizes the new logging functions. * Modified the FlightRadar24 client installation script so it utilizes the new logging functions. +* Modified the Fly Italy ADS-B client installation script so it utilizes the new logging functions. * Added the --version and -v arguments in order to display the current project version. ## v2.8.4 *(July 13th, 2024)* :rooster: diff --git a/bash/feeders/airplaneslive.sh b/bash/feeders/airplaneslive.sh index 2de023d2..b6d8293d 100755 --- a/bash/feeders/airplaneslive.sh +++ b/bash/feeders/airplaneslive.sh @@ -26,11 +26,11 @@ fi ## DOWNLOAD AND EXECUTE THE AIRPLANES.LIVE CLIENT INSTALL SCRIPT -LogHeading "Begining the airplanes.live feeder client installation process" +LogHeading "Begining the airplanes.live client installation process" LogMessage "Informing the user of how the installation process will work" whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ - --title "ADS-B Exchange Feed Setup" \ + --title "Airplanes.live Client Setup" \ --msgbox "Scripts supplied by airplanes.live 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 diff --git a/bash/feeders/flyitalyadsb.sh b/bash/feeders/flyitalyadsb.sh old mode 100644 new mode 100755 index 39888364..823b1fd5 --- a/bash/feeders/flyitalyadsb.sh +++ b/bash/feeders/flyitalyadsb.sh @@ -1,99 +1,94 @@ #!/bin/bash -## INCLUDE EXTERNAL SCRIPTS +## PRE INSTALLATION OPERATIONS source $RECEIVER_BASH_DIRECTORY/variables.sh source $RECEIVER_BASH_DIRECTORY/functions.sh - -## BEGIN SETUP - clear -echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}" -echo -e "" -echo -e "\e[92m Setting up the Fly Italy ADS-B feeder client..." -echo -e "" -echo -e "\e[93m ------------------------------------------------------------------------------\e[96m" -echo -e "" - -# Confirm component installation. -if ! whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Fly Italy ADS-B feeder client Setup" --yesno "The Fly Italy ADS-B feeder client takes data from a local dump1090 instance and shares this with Fly Italy ADS-B. for more information please see their website:\n\n https://flyitalyadsb.com/come-condividere-la-propria-antenna/\n\nContinue setup by installing the Fly Italy ADS-B feeder client?" 13 78 3>&1 1>&2 2>&3; then - 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 Fly Italy ADS-B feeder client setup halted.\e[39m" - echo -e "" - read -p "Press enter to continue..." discard +LogProjectName ${RECEIVER_PROJECT_TITLE} +LogTitleHeading "Setting up the Fly Italy ADS-B client" +LogTitleMessage "------------------------------------------------------------------------------" +echo "" + +if ! whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ + --title "Fly Italy ADS-B feeder client Setup" \ + --yesno "The Fly Italy ADS-B feeder client takes data from a local dump1090 instance and shares this with Fly Italy ADS-B. for more information please see their website:\n\n https://flyitalyadsb.com/come-condividere-la-propria-antenna/\n\nContinue setup by installing the Fly Italy ADS-B feeder client?" \ + 13 78; then + LogAlertHeading "INSTALLATION HALTED" + LogAlertMessage "Setup has been halted at the request of the user" + echo "" + LogTitleMessage "------------------------------------------------------------------------------" + LogTitleHeading "Fly Italy ADS-B client setup halted" + echo "" exit 1 fi -## START FEEDER +## DOWNLOAD AND EXECUTE THE PROPER FLY ITALY ADS-B CLIENT SCRIPT + +LogHeading "Begining the Fly Italy ADS-B client installation process" -echo -e "" -echo -e "\e[95m Begining the Fly Italy ADS-B feeder client installation process...\e[97m" -echo -e "" +LogMessage "Informing the user of how the installation process will work" +whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ + --title "Fly Italy ADS-B Client Setup" \ + --msgbox "Scripts supplied by airplanes.live 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 -# Create the component build directory if it does not exist if [[ ! -d $RECEIVER_BUILD_DIRECTORY/flyitalyadsb ]]; then - echo -e "\e[94m Creating the Fly Italy ADS-B feeder client build directory...\e[97m" + LogMessage "Creating the Fly Italy ADS-B build directory" echo "" mkdir -vp $RECEIVER_BUILD_DIRECTORY/flyitalyadsb echo "" fi +LogMessage "Entering the Fly Italy ADS-B build directory" +cd $RECEIVER_BUILD_DIRECTORY/flyitalyadsb -# Change to the component build directory -echo -e "\e[94m Entering the Fly Italy ADS-B feeder client build directory...\e[97m" -cd $RECEIVER_BUILD_DIRECTORY/flyitalyadsb 2>&1 +LogMessage "Downloading the Fly Italy ADS-B installation script" echo "" - -# Download the official Fly Italy ADS-B feeder installation script -echo -e "\e[95m Beginning the Fly Italy ADS-B feeder client installation...\e[97m" -echo -e "" - -echo -e "\e[94m Downloading the Fly Italy ADS-B feeder client installation script...\e[97m" +wget -v -O$RECEIVER_BUILD_DIRECTORY/flyitalyadsb/install.sh wget https://raw.githubusercontent.com/flyitalyadsb/mlat-client/master/scripts/install.sh echo "" -wget -v https://raw.githubusercontent.com/flyitalyadsb/fly-italy-adsb/master/install.sh - -echo -e "\e[94m Executing the Fly Italy ADS-B feeder client installation script...\e[97m" +LogMessage "Executing the Fly Italy ADS-B feeder installation script" echo "" sudo bash $RECEIVER_BUILD_DIRECTORY/flyitalyadsb/install.sh echo "" - -## INSTALL UPDATER - -if whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Install The Fly Italy ADS-B Updater" --yesno "It is recommended that the Fly Italy ADS-B updater be installed as well.\n\nWould you like to install the updater at this time?" 12 78; - # Download the official Fly Italy ADS-B feeder updater script - echo -e "\e[95m Beginning the Fly Italy ADS-B feeder updater installation...\e[97m" - echo -e "" - - echo -e "\e[94m Downloading the Fly Italy ADS-B feeder updater installation script...\e[97m" +LogMessage "Asking if the user wishes to install the Fly Italy ADS-B updater" +if whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ + --title "Install The Fly Italy ADS-B Updater" \ + --yesno "It is recommended that the Fly Italy ADS-B updater be installed as well.\n\nWould you like to install the updater at this time?" \ + 12 78; + LogMessage "Downloading the Fly Italy ADS-B updater script" echo "" - wget -v wget https://raw.githubusercontent.com/flyitalyadsb/mlat-client/master/scripts/install_updater.sh - - echo -e "\e[94m Executing the Fly Italy ADS-B feeder updater installation script...\e[97m" + wget -v -O$RECEIVER_BUILD_DIRECTORY/flyitalyadsb/install_updater.sh wget https://raw.githubusercontent.com/flyitalyadsb/mlat-client/master/scripts/install_updater.sh + echo "" + LogMessage "Executing the Fly Italy ADS-B feeder updater script" echo "" sudo bash $RECEIVER_BUILD_DIRECTORY/flyitalyadsb/install_updater.sh echo "" fi -## POST INSTALLATION INFORMATION +## POST INSTALLATION OPERATIONS + +LogHeading "Performing post installation operations" + +LogMessage "Informing user as to how to check client status" +whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ + --title "Fly Italy ADS-B Feeder Setup Complete" \ + --msgbox "To check the status of your installation vist https://flyitalyadsb.com/stato-ricevitore/.\n\nFor information on configuring your Fly Italy ADS-B feeder visit https://flyitalyadsb.com/configurazione-script/" \ + 12 78 -whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Fly Italy ADS-B Feeder Setup Complete" --msgbox "To check the status of your installation vist https://flyitalyadsb.com/stato-ricevitore/.\n\nFor information on configuring your Fly Italy ADS-B feeder visit https://flyitalyadsb.com/configurazione-script/" 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 +LogMessage "Returning to ${RECEIVER_PROJECT_TITLE} root directory" +cd $RECEIVER_ROOT_DIRECTORY -echo -e "" -echo -e "\e[93m ------------------------------------------------------------------------------" -echo -e "\e[92m Fly Italy ADS-B feeder client setup is complete.\e[39m" -echo -e "" +echo "" +LogTitleMessage "------------------------------------------------------------------------------" +LogTitleHeading "Fly Italy ADS-B client setup is complete" +echo "" read -p "Press enter to continue..." discard exit 0 From 49207905049d5d34be0d2cd8eb5ed82e31456475 Mon Sep 17 00:00:00 2001 From: jprochazka Date: Mon, 22 Jul 2024 00:17:45 -0400 Subject: [PATCH 11/26] The Opensky Network script now uses new logging functions. --- bash/decoders/dump1090-fa.sh | 1 - bash/decoders/dump978-fa.sh | 1 - bash/feeders/flyitalyadsb.sh | 1 - bash/feeders/openskynetwork.sh | 89 +++++++++++++++++++--------------- bash/feeders/piaware.sh | 4 +- 5 files changed, 50 insertions(+), 46 deletions(-) diff --git a/bash/decoders/dump1090-fa.sh b/bash/decoders/dump1090-fa.sh index 9ba832cd..7febee41 100755 --- a/bash/decoders/dump1090-fa.sh +++ b/bash/decoders/dump1090-fa.sh @@ -41,7 +41,6 @@ CheckPackage librtlsdr-dev CheckPackage libsoapysdr-dev CheckPackage lighttpd CheckPackage pkg-config -echo "" ## BLACKLIST UNWANTED RTL-SDR MODULES diff --git a/bash/decoders/dump978-fa.sh b/bash/decoders/dump978-fa.sh index 40fbaf16..ae1809e8 100755 --- a/bash/decoders/dump978-fa.sh +++ b/bash/decoders/dump978-fa.sh @@ -98,7 +98,6 @@ CheckPackage libboost-regex-dev CheckPackage libboost-system-dev CheckPackage libsoapysdr-dev CheckPackage soapysdr-module-rtlsdr -echo "" ## BLACKLIST UNWANTED RTL-SDR MODULES diff --git a/bash/feeders/flyitalyadsb.sh b/bash/feeders/flyitalyadsb.sh index 823b1fd5..5530f92c 100755 --- a/bash/feeders/flyitalyadsb.sh +++ b/bash/feeders/flyitalyadsb.sh @@ -10,7 +10,6 @@ LogProjectName ${RECEIVER_PROJECT_TITLE} LogTitleHeading "Setting up the Fly Italy ADS-B client" LogTitleMessage "------------------------------------------------------------------------------" echo "" - if ! whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ --title "Fly Italy ADS-B feeder client Setup" \ --yesno "The Fly Italy ADS-B feeder client takes data from a local dump1090 instance and shares this with Fly Italy ADS-B. for more information please see their website:\n\n https://flyitalyadsb.com/come-condividere-la-propria-antenna/\n\nContinue setup by installing the Fly Italy ADS-B feeder client?" \ diff --git a/bash/feeders/openskynetwork.sh b/bash/feeders/openskynetwork.sh index 6bd0b319..293f7683 100755 --- a/bash/feeders/openskynetwork.sh +++ b/bash/feeders/openskynetwork.sh @@ -1,77 +1,86 @@ #!/bin/bash -## INCLUDE EXTERNAL SCRIPTS +## PRE INSTALLATION OPERATIONS source $RECEIVER_BASH_DIRECTORY/variables.sh source $RECEIVER_BASH_DIRECTORY/functions.sh - -## BEGIN SETUP - clear -echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}" -echo -e "" -echo -e "\e[92m Setting up OpenSky Network feeder client..." -echo -e "" -echo -e "\e[93m ------------------------------------------------------------------------------\e[96m" -echo -e "" - -# Confirm component installation. -if ! 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; then - 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..." discard +LogProjectName ${RECEIVER_PROJECT_TITLE} +LogTitleHeading "Setting up the OpenSky Network client" +LogTitleMessage "------------------------------------------------------------------------------" +echo "" +if ! 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; then + LogAlertHeading "INSTALLATION HALTED" + LogAlertMessage "Setup has been halted at the request of the user" + echo "" + LogTitleMessage "------------------------------------------------------------------------------" + LogTitleHeading "OpenSky Network client setup halted" + echo "" exit 1 fi +## CHECK FOR PREREQUISITE PACKAGES + +LogHeading "Installing packages needed to fulfill OpenSky Network client dependencies" + +CheckPackage apt-transport-https + + ## ADD THE OPENSKY NETWORK APT REPOSITORY TO THE SYSTEM IF IT DOES NOT ALREADY EXIST -echo -e "\e[95m Setting up the OpenSky Network apt repository if it has not yet been setup...\e[97m" -echo "" +LogHeading "Setting up the OpenSky Network apt repository if it has not yet been setup...\e[97m" +LogMessage "Checking if the OpenSky Network apt repository is set up" if ! grep -q "^deb .*opensky." /etc/apt/sources.list /etc/apt/sources.list.d/*; then - echo -e "\e[94m The OpenSky Network apt repository is not set up...\e[97m" - CheckPackage apt-transport-https - echo -e "\e[94m Downloading the OpenSky Network apt repository GPG key...\e[97m" + LogMessage "The OpenSky Network apt repository is not set up" + + if [[ ! -d $RECEIVER_BUILD_DIRECTORY/openskynetwork ]]; then + LogMessage "Creating the OpenSky Network build directory" + echo "" + mkdir -vp $RECEIVER_BUILD_DIRECTORY/openskynetwork + echo "" + fi + LogMessage "Entering the OpenSky Network build directory" + cd $RECEIVER_BUILD_DIRECTORY/openskynetwork + + LogMessage "Downloading and adding the OpenSky Network apt repository GPG key" echo "" - wget -O - https://opensky-network.org/files/firmware/opensky.gpg.pub | sudo apt-key add - + wget -v -O $RECEIVER_BUILD_DIRECTORY/openskynetwork/opensky.gpg.pub https://opensky-network.org/files/firmware/opensky.gpg.pub + wget -q -O - https://opensky-network.org/files/firmware/opensky.gpg.pub | sudo apt-key add - echo "" - echo -e "\e[94m Adding the OpenSky Network apt repository...\e[97m" + LogMessage "Adding the OpenSky Network apt repository" sudo bash -c "echo deb https://opensky-network.org/repos/debian opensky custom > /etc/apt/sources.list.d/opensky.list" else - echo -e "\e[94m The OpenSky Network apt repository already exists in /etc/apt/sources.list.d/...\e[97m" + LogMessage "The OpenSky Network apt repository is already set up" fi -echo "" ## INSTALL THE OPENSKY NETWORK FEEDER PACKAGE USING APT -echo -e "\e[95m Installing the OpenSky Network feeder package...\e[97m" -echo "" +LogHeading "Installing the OpenSky Network feeder package" -echo -e "\e[94m Downloading the latest package lists for all enabled repositories and PPAs...\e[97m" +LogMessage "Downloading the latest package lists for all enabled repositories and PPAs" echo "" sudo apt-get update echo "" -echo -e "\e[94m Installing the OpenSky Network fedder package using apt...\e[97m" +LogMessage "Installing the OpenSky Network fedder package using apt" CheckPackage opensky-feeder ## 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 +LogMessage "Returning to ${RECEIVER_PROJECT_TITLE} root directory" +cd $RECEIVER_ROOT_DIRECTORY -echo -e "" -echo -e "\e[93m ------------------------------------------------------------------------------" -echo -e "\e[92m OpenSky Network feeder client setup is complete.\e[39m" -echo -e "" +echo "" +LogTitleMessage "------------------------------------------------------------------------------" +LogTitleHeading "OpenSky Network client setup is complete" +echo "" read -p "Press enter to continue..." discard exit 0 diff --git a/bash/feeders/piaware.sh b/bash/feeders/piaware.sh index 968bbe22..bdf20af4 100755 --- a/bash/feeders/piaware.sh +++ b/bash/feeders/piaware.sh @@ -38,7 +38,7 @@ fi ## CHECK FOR PREREQUISITE PACKAGES -LogHeading "Installing packages needed to fulfill dependencies for FlightAware PiAware client" +LogHeading "Installing packages needed to fulfill FlightAware PiAware client dependencies" CheckPackage autoconf CheckPackage build-essential @@ -77,8 +77,6 @@ else CheckPackage tcl-tls fi -echo "" - ## CLONE OR PULL THE TCLTLS REBUILD GIT REPOSITORY From 18b23be270fa9a1e88b6ca7b35e5124dae8e1d12 Mon Sep 17 00:00:00 2001 From: jprochazka Date: Mon, 22 Jul 2024 00:43:50 -0400 Subject: [PATCH 12/26] The PlaneFinder script now uses new logging functions. --- CHANGELOG.md | 2 + bash/feeders/piaware.sh | 2 +- bash/feeders/planefinder.sh | 154 ++++++++++++++++-------------------- 3 files changed, 71 insertions(+), 87 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8852d152..de6a5f5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,8 @@ The following is a history of the changes made to this project. * Modified the airplanes.live client installation script so it utilizes the new logging functions. * Modified the FlightRadar24 client installation script so it utilizes the new logging functions. * Modified the Fly Italy ADS-B client installation script so it utilizes the new logging functions. +* Modified the OpenSky Network client installation script so it utilizes the new logging functions. +* Modified the PlaneFinder client installation script so it utilizes the new logging functions. * Added the --version and -v arguments in order to display the current project version. ## v2.8.4 *(July 13th, 2024)* :rooster: diff --git a/bash/feeders/piaware.sh b/bash/feeders/piaware.sh index bdf20af4..c128bd54 100755 --- a/bash/feeders/piaware.sh +++ b/bash/feeders/piaware.sh @@ -137,7 +137,7 @@ if [[ "${RECEIVER_OS_CODE_NAME}" == "focal" ]]; then mkdir -vp $RECEIVER_BUILD_DIRECTORY/package-archive echo "" fi - LogMessage "Copying the FlightAware tcltls-rebuild binary package into the archive directory" + LogMessage "Copying the FlightAware tcltls-rebuild Debian package into the archive directory" echo "" cp -vf $RECEIVER_BUILD_DIRECTORY/tcltls-rebuild/*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ echo "" diff --git a/bash/feeders/planefinder.sh b/bash/feeders/planefinder.sh index ee3dec3b..f8a766e9 100755 --- a/bash/feeders/planefinder.sh +++ b/bash/feeders/planefinder.sh @@ -1,148 +1,130 @@ #!/bin/bash -## INCLUDE EXTERNAL SCRIPTS +## PRE INSTALLATION OPERATIONS source $RECEIVER_BASH_DIRECTORY/variables.sh source $RECEIVER_BASH_DIRECTORY/functions.sh - -## BEGIN SETUP - 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 "" - -# Confirm component installation -if ! 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; then - 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..." discard +LogProjectName ${RECEIVER_PROJECT_TITLE} +LogTitleHeading "Setting up the PlaneFinder client" +LogTitleMessage "------------------------------------------------------------------------------" +echo "" +if ! 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; then + LogAlertHeading "INSTALLATION HALTED" + LogAlertMessage "Setup has been halted at the request of the user" + echo "" + LogTitleMessage "------------------------------------------------------------------------------" + LogTitleHeading "PlaneFinder client setup halted" + echo "" exit 1 fi ## CHECK FOR PREREQUISITE PACKAGES -echo -e "\e[95m Installing packages needed to fulfill dependencies for PlaneFinder ADS-B Client...\e[97m" -echo -e "" +LogHeading "Installing packages needed to fulfill PlaneFinder client dependencies" + CheckPackage wget -# Some architectures require additional packages. case "${RECIEVER_CPU_ARCHITECTURE}" in "aarch64") - echo -e "\e[94m Adding support for the armhf architecture...\e[97m" sudo dpkg --add-architecture armhf CheckPackage libc6:armhf ;; esac -echo "" -## DETERMINE WHICH PACACKAGE TO INSTALL +## DOWNLOAD AND INSTALL THE PROPER PLANEFINDER CLIENT DEBIAN PACKAGE + + +LogHeading "Begining the PlaneFinder client installation process" -echo -e "\e[94m Determining the package to install...\e[97m" -BASE_DOWNLOAD_URL="http://client.planefinder.net/" + +LogMessage "Determining which Debian package to install" case "${RECIEVER_CPU_ARCHITECTURE}" in "armv7l"|"armv6l") - PACKAGE_NAME="pfclient_${PLANEFINDER_CLIENT_VERSION_ARMHF}_armhf.deb" + package_name="pfclient_${PLANEFINDER_CLIENT_VERSION_ARMHF}_armhf.deb" ;; "aarch64") - PACKAGE_NAME="pfclient_${PLANEFINDER_CLIENT_VERSION_ARM64}_armhf.deb" + package_name="pfclient_${PLANEFINDER_CLIENT_VERSION_ARM64}_armhf.deb" ;; "x86_64") - PACKAGE_NAME="pfclient_${PLANEFINDER_CLIENT_VERSION_AMD64}_amd64.deb" + package_name="pfclient_${PLANEFINDER_CLIENT_VERSION_AMD64}_amd64.deb" ;; "i386") - PACKAGE_NAME="pfclient_${PLANEFINDER_CLIENT_VERSION_I386}_i386.deb" + 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 "" - echo -e " Archetecture Detected: ${CPU_ARCHITECTURE}" - 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 + echo "" + LogAlertHeading "INSTALLATION HALTED" + echo "" + LogAlertMessage "Unsupported CPU Archetecture" + LogAlertMessage "Archetecture Detected: ${CPU_ARCHITECTURE}" + LogAlertMessage "Setup has been terminated" + echo "" + LogTitleMessage "------------------------------------------------------------------------------" + LogTitleHeading "PlaneFinder client setup failed" + echo "" + read -p "Press enter to continue..." discard exit 1 ;; esac - -## START INSTALLATION - -echo -e "" -echo -e "\e[95m Begining the PlaneFinder ADS-B Client installation process...\e[97m" -echo -e "" - -# Create the component build directory if it does not exist if [[ ! -d $RECEIVER_BUILD_DIRECTORY/planefinder ]]; then - echo -e "\e[94m Creating the PlaneFinder ADS-B Client build directory...\e[97m" + LogMessage "Creating the PlaneFinder build directory" echo "" mkdir -vp $RECEIVER_BUILD_DIRECTORY/planefinder echo "" fi -echo -e "\e[94m Entering the PlaneFinder ADS-B Client build directory...\e[97m" -cd $RECEIVER_BUILD_DIRECTORY/planefinder 2>&1 -echo "" - - -## DOWNLOAD AND INSTALL THE PACKAGE +LogMessage "Entering the PlaneFinder build directory" +cd $RECEIVER_BUILD_DIRECTORY/planefinder -echo -e "\e[95m Installing the PlaneFinder ADS-B Client package...\e[97m" -echo -e "" - -# Download the appropriate package depending on the devices architecture -echo -e "\e[94m Downloading the appropriate deb package...\e[97m" +LogMessage "Downloading the appropriate PlaneFinder client Debian package" echo "" -wget --no-check-certificate ${BASE_DOWNLOAD_URL}/${PACKAGE_NAME} -O $RECEIVER_BUILD_DIRECTORY/planefinder/${PACKAGE_NAME} +wget -v -O --no-check-certificate http://client.planefinder.net/$PACKAGE_NAME $RECEIVER_BUILD_DIRECTORY/planefinder/$PACKAGE_NAME -# Install the proper package depending on the devices architecture -echo -e "\e[94m Installing the PlaneFinder Client...\e[97m" +LogMessage "Installing the PlaneFinder Client Debian package" echo -e "" -sudo dpkg -i $RECEIVER_BUILD_DIRECTORY/planefinder/${PACKAGE_NAME} 2>&1 +sudo dpkg -i $RECEIVER_BUILD_DIRECTORY/planefinder/$package_name echo "" -# 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 "" +if [[ ! -d $RECEIVER_BUILD_DIRECTORY/package-archive ]]; then + LogMessage "Creating the package archive directory" + echo "" + mkdir -vp $RECEIVER_BUILD_DIRECTORY/package-archive + echo "" 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 "" +LogMessage "Copying the PlaneFinder client Debian package into the archive directory" +echo "" +cp -vf $RECEIVER_BUILD_DIRECTORY/planefinder/$package_name $RECEIVER_BUILD_DIRECTORY/package-archive/ +echo "" + +## POST INSTALLATION OPERATIONS -## COMPONENT POST INSTALL ACTIONS +LogHeading "Performing post installation operations" -# Display final setup instructions which cannot be handled by this script +LogMessage "Displaying the message informing the user on how to complete setup" RECEIVER_IP_ADDRESS=`ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/'` -whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "PlaneFinder ADS-B Client Setup Instructions" --msgbox "At this point the PlaneFinder ADS-B Client should be installed and running; however this script is only capable of installing the PlaneFinder ADS-B Client. There are still a few steps left which you must manually do through the PlaneFinder ADS-B Client at the following URL:\n\n http://${RECEIVER_IP_ADDRESS}:30053\n\nThe follow the instructions supplied by the PlaneFinder ADS-B Client.\n\nUse the following settings when asked for them.\n\nData Format: Beast\nTcp Address: 127.0.0.1\nTcp Port: 30005" 20 78 +whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ + --title "PlaneFinder ADS-B Client Setup Instructions" \ + --msgbox "At this point the PlaneFinder ADS-B Client should be installed and running; however this script is only capable of installing the PlaneFinder ADS-B Client. There are still a few steps left which you must manually do through the PlaneFinder ADS-B Client at the following URL:\n\n http://${RECEIVER_IP_ADDRESS}:30053\n\nThe follow the instructions supplied by the PlaneFinder ADS-B Client.\n\nUse the following settings when asked for them.\n\nData Format: Beast\nTcp Address: 127.0.0.1\nTcp Port: 30005" \ + 20 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 +LogMessage "Returning to ${RECEIVER_PROJECT_TITLE} root directory" +cd $RECEIVER_ROOT_DIRECTORY -echo -e "" -echo -e "\e[93m ------------------------------------------------------------------------------" -echo -e "\e[92m PlaneFinder ADS-B Client setup is complete.\e[39m" -echo -e "" +echo "" +LogTitleMessage "------------------------------------------------------------------------------" +LogTitleHeading "PlaneFinder client setup is complete" +echo "" read -p "Press enter to continue..." discard exit 0 From caa8f867381fa51dc2c5f84a201e4d3baa3b94b3 Mon Sep 17 00:00:00 2001 From: jprochazka Date: Mon, 22 Jul 2024 01:21:51 -0400 Subject: [PATCH 13/26] The beast-splitter script now uses new logging functions. --- CHANGELOG.md | 1 + bash/decoders/dump978-fa.sh | 1 - bash/extras/beastsplitter.sh | 183 +++++++++++++++++++++-------------- bash/feeders/adsbexchange.sh | 5 +- bash/feeders/piaware.sh | 2 - 5 files changed, 114 insertions(+), 78 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index de6a5f5b..591bb0ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ The following is a history of the changes made to this project. * Modified the Fly Italy ADS-B client installation script so it utilizes the new logging functions. * Modified the OpenSky Network client installation script so it utilizes the new logging functions. * Modified the PlaneFinder client installation script so it utilizes the new logging functions. +* Modified the beast-splitter installation script so it utilizes the new logging functions. * Added the --version and -v arguments in order to display the current project version. ## v2.8.4 *(July 13th, 2024)* :rooster: diff --git a/bash/decoders/dump978-fa.sh b/bash/decoders/dump978-fa.sh index ae1809e8..c23ed80e 100755 --- a/bash/decoders/dump978-fa.sh +++ b/bash/decoders/dump978-fa.sh @@ -196,7 +196,6 @@ echo "" ## CONFIGURATION - if [[ "${adsb_decoder_installed}" == "true" ]]; then LogHeading "Configuring the ADS-B decoder and dump978-fa so they can work in tandem" diff --git a/bash/extras/beastsplitter.sh b/bash/extras/beastsplitter.sh index 40772042..19baceb5 100755 --- a/bash/extras/beastsplitter.sh +++ b/bash/extras/beastsplitter.sh @@ -1,20 +1,19 @@ #!/bin/bash -## INCLUDE EXTERNAL SCRIPTS +## PRE INSTALLATION OPERATIONS source $RECEIVER_BASH_DIRECTORY/variables.sh source $RECEIVER_BASH_DIRECTORY/functions.sh - -## BEGIN SETUP - 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 ! 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; then +LogProjectName ${RECEIVER_PROJECT_TITLE} +LogTitleHeading "Setting up beast-splitter" +LogTitleMessage "------------------------------------------------------------------------------" +echo "" +if ! 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; then echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m" echo -e " Setup has been halted at the request of the user." echo -e "" @@ -26,111 +25,153 @@ if ! whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Beast-Splitter Se fi -## GATHER CONFIGURATION OPTIONS +## GATHER REQUIRED INFORMATION FROM THE USER -if whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Enable Beast Splitter" --defaultno --yesno "By default Beast Splitter is disabled. Would you like to enable Beast Splitter now?" 8 65; then +LogMessage "Asking user if beast-splitter should be enabled" +if whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ + --title "Enable Beast Splitter" \ + --defaultno \ + --yesno "By default Beast Splitter is disabled. Would you like to enable Beast Splitter now?" 8 65; then enable_beastsplitter="true" else enable_beastsplitter="false" fi -input_options=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Input Options for Beast Splitter" --nocancel --inputbox "Enter the option telling Beast Splitter where to read data from. You should provide one of the following either --net or --serial.\n\nExamples:\n--serial /dev/beast\n--net remotehost:remoteport" 8 78 3>&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) + +LogMessage "Asking user for the beast-splitter input option" +input_options=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ + --title "Input Options for Beast Splitter" \ + --inputbox "Enter the option telling Beast Splitter where to read data from. You should provide one of the following either --net or --serial.\n\nExamples:\n--serial /dev/beast\n--net remotehost:remoteport" \ + 8 78) +if [[ $input_options == 0 ]]; then + LogAlertHeading "INSTALLATION HALTED" + LogAlertMessage "Setup has been halted due to lack of required information" + echo "" + LogTitleMessage "------------------------------------------------------------------------------" + LogTitleHeading "beast-splitter setup halted" + exit 1 +fi + +LogMessage "Asking user for the beast-splitter output option" +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) +if [[ $output_options == 0 ]]; then + LogAlertHeading "INSTALLATION HALTED" + LogAlertMessage "Setup has been halted due to lack of required information" + echo "" + LogTitleMessage "------------------------------------------------------------------------------" + LogTitleHeading "beast-splitter setup halted" + exit 1 +fi + ## CHECK FOR PREREQUISITE PACKAGES -echo -e "\e[95m Checking that the required packages are installed...\e[97m" -echo -e "" +LogHeading "Installing packages needed to fulfill beast-splitter dependencies" + CheckPackage build-essential CheckPackage debhelper CheckPackage libboost-system-dev CheckPackage libboost-program-options-dev CheckPackage libboost-regex-dev -echo "" -## DOWNLOAD SOURCE +## CLONE OR PULL THE FLIGHTAWARE DUMP978 DECODER SOURCE -echo -e "\e[95m Downloading the beast-splitter repository from GitHub...\e[97m" -echo -e "" +LogHeading "Preparing the FlightAware Dump978 Git repository" -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 - echo -e "\e[94m Updating the local beast-splitter git repository...\e[97m" - echo -e "" - git pull 2>&1 + LogMessage "Entering the beast-splitter git repository directory" + cd $RECEIVER_BUILD_DIRECTORY/beast-splitter/beast-splitter + LogMessage "Pulling the beast-splitter git repository" + echo "" + git pull else - # A directory containing the source code does not exist in the build directory - echo -e "\e[94m Creating the beast-splitter build directory...\e[97m" + LogMessage "Creating the beast-splitter build directory" echo "" - mkdir -vp $RECEIVER_BUILD_DIRECTORY/beast-splitter 2>&1 + mkdir -vp $RECEIVER_BUILD_DIRECTORY/beast-splitter echo "" - echo -e "\e[94m Entering the beast-splitter build directory...\e[97m" - cd $RECEIVER_BUILD_DIRECTORY/beast-splitter 2>&1 - echo -e "\e[94m Cloning the beast-splitter git repository locally...\e[97m" - echo -e "" - git clone https://github.com/flightaware/beast-splitter.git 2>&1 + LogMessage "Entering the beast-splitter build directory" + cd $RECEIVER_BUILD_DIRECTORY/beast-splitter + LogMessage "Cloning the FlightAware dump978 git repository" + echo "" + git clone https://github.com/flightaware/beast-splitter.git fi -echo "" -## BUILD AND INSTALL +## BUILD AND INSTALL THE BEAST-SPLITTER PACKAGE -echo -e "\e[95m Building and installing the beast-splitter package...\e[97m" -echo -e "" +LogHeading "Building the beast-splitter package" -echo -e "\e[94m Entering the beast-splitter git repository directory...\e[97m" -cd $RECEIVER_BUILD_DIRECTORY/beast-splitter/beast-splitter 2>&1 +LogMessage "Entering the beast-splitter Git repository" +cd $RECEIVER_BUILD_DIRECTORY/beast-splitter/beast-splitter -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" +LogMessage "Building the beast-splitter package" echo "" -sudo dpkg -i beast-splitter_*.deb 2>&1 +dpkg-buildpackage -b echo "" -# Archive binary package +LogMessage "Installing the beast-splitter Debian package" +sudo dpkg -i $RECEIVER_BUILD_DIRECTORY/beast-splitter/beast-splitter_*.deb + +LogMessage "Checking that the beast-splitter Debian package was installed" +if [[ $(dpkg-query -W -f='${STATUS}' beast-splitter 2>/dev/null | grep -c "ok installed") -eq 0 ]]; then + echo "" + LogAlertHeading "INSTALLATION HALTED" + echo "" + LogAlertMessage "The beast-splitter Debian package failed to install" + LogAlertMessage "Setup has been terminated" + echo "" + LogTitleMessage "------------------------------------------------------------------------------" + LogTitleHeading "beast-splitter setup halted" + echo "" + read -p "Press enter to continue..." discard + exit 1 +fi + if [[ ! -d $RECEIVER_BUILD_DIRECTORY/package-archive ]]; then - echo -e "\e[94m Creating package archive directory...\e[97m" + LogMessage "Creating the Debian package archive directory" echo "" - mkdir -vp $RECEIVER_BUILD_DIRECTORY/package-archive 2>&1 + mkdir -vp $RECEIVER_BUILD_DIRECTORY/package-archive echo "" fi -echo -e "\e[94m Moving the beast-splitter package into the archive directory...\e[97m" +LogMessage "Copying the beast-splitter Debian package into the Debian package archive directory" echo "" -cp -vp $RECEIVER_BUILD_DIRECTORY/beast-splitter/*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ 2>&1 +cp -vf $RECEIVER_BUILD_DIRECTORY/beast-splitter/*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ echo "" -## CONFIGURE BEAST SPLITTER +## CONFIGURATION + +LogHeading "Configuring beast-splitter" + +LogMessage "Setting ENABLED to ${enable_beastsplitter}" +ChangeConfig "ENABLED" "${enable_beastsplitter}" "/etc/default/beast-splitter" +LogMessage "Setting INPUT_OPTIONS to ${input_options}" +ChangeConfig "INPUT_OPTIONS" "${input_options}" "/etc/default/beast-splitter" +LogMessage "Setting OUTPUT_OPTIONS to ${output_options}" +ChangeConfig "OUTPUT_OPTIONS" "${output_options}" "/etc/default/beast-splitter" -echo -e "\e[94m Configuring beast-splitter...\e[97m" -ChangeConfig "ENABLED" $enable_beastsplitter "/etc/default/beast-splitter" -ChangeConfig "INPUT_OPTIONS" $input_options "/etc/default/beast-splitter" -ChangeConfig "OUTPUT_OPTIONS" $output_options "/etc/default/beast-splitter" +if [[ "${enable_beastsplitter}" == "true" ]]; then + LogMessage "Starting the beast-splitter process" + sudo systemctl start beast-splitter +else + LogMessage "Making sure beast-splitter is not running" + sudo systemctl stop beast-splitter +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 +LogMessage "Returning to ${RECEIVER_PROJECT_TITLE} root directory" +cd $RECEIVER_ROOT_DIRECTORY -echo -e "" -echo -e "\e[93m ------------------------------------------------------------------------------" -echo -e "\e[92m beast-splitter setup is complete.\e[39m" -echo -e "" -if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]]; then - read -p "Press enter to continue..." discard -fi +echo "" +LogTitleMessage "------------------------------------------------------------------------------" +LogTitleHeading "beast-splitter setup is complete" +echo "" +read -p "Press enter to continue..." discard exit 0 diff --git a/bash/feeders/adsbexchange.sh b/bash/feeders/adsbexchange.sh index 63b1521e..7bae5407 100755 --- a/bash/feeders/adsbexchange.sh +++ b/bash/feeders/adsbexchange.sh @@ -1,13 +1,10 @@ #!/bin/bash -### INCLUDE EXTERNAL SCRIPTS +## PRE INSTALLATION OPERATIONS source $RECEIVER_BASH_DIRECTORY/variables.sh source $RECEIVER_BASH_DIRECTORY/functions.sh - -## BEGIN SETUP - clear LogProjectName ${RECEIVER_PROJECT_TITLE} LogTitleHeading "Setting up the ADS-B Exchange client" diff --git a/bash/feeders/piaware.sh b/bash/feeders/piaware.sh index c128bd54..7f41035f 100755 --- a/bash/feeders/piaware.sh +++ b/bash/feeders/piaware.sh @@ -140,9 +140,7 @@ if [[ "${RECEIVER_OS_CODE_NAME}" == "focal" ]]; then LogMessage "Copying the FlightAware tcltls-rebuild Debian package into the archive directory" echo "" cp -vf $RECEIVER_BUILD_DIRECTORY/tcltls-rebuild/*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ - echo "" fi - fi From 28719e728d9cb9de543250832c1ca98b68ce12a2 Mon Sep 17 00:00:00 2001 From: jprochazka Date: Mon, 22 Jul 2024 01:29:55 -0400 Subject: [PATCH 14/26] Removed image creation and setup support. --- CHANGELOG.md | 1 + bash/image.sh | 235 ------------------------------------ bash/init.sh | 13 -- bash/tools/image_setup.sh | 230 ----------------------------------- bash/tools/portal_backup.sh | 63 ++-------- 5 files changed, 12 insertions(+), 530 deletions(-) delete mode 100755 bash/image.sh delete mode 100755 bash/tools/image_setup.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index 591bb0ab..72702eac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ The following is a history of the changes made to this project. * Modified the PlaneFinder client installation script so it utilizes the new logging functions. * Modified the beast-splitter installation script so it utilizes the new logging functions. * Added the --version and -v arguments in order to display the current project version. +* Removed scripting used for image setup. ## v2.8.4 *(July 13th, 2024)* :rooster: diff --git a/bash/image.sh b/bash/image.sh deleted file mode 100755 index e2fc58a8..00000000 --- a/bash/image.sh +++ /dev/null @@ -1,235 +0,0 @@ -#!/bin/bash - -##################################################################################### -# ADS-B RECEIVER # -##################################################################################### -# # -# This script is used to complete the setup of the Raspbian image files made # -# available to the public by the projects maintainer(s). # -# # -# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # -# # -# Copyright (c) 2015-2017, 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 - -# Assign the Lighthttpd document root directory to a variable. -RAWDOCUMENTROOT=`/usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf -p | grep server.document-root` -DOCUMENTROOT=`sed 's/.*"\(.*\)"[^"]*$/\1/' <<< ${RAWDOCUMENTROOT}` - -## WELCOME MESSAGE - -whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "ADS-B Receiver Project Image Setup" --msgbox "Thank you for choosing to use the ADS-B Receiver Project image.\n\nDuring this setup process the preinstalled dump1090-mutability installation will be configured and the ADS-B Project Web Portal will be installed. If you would like to add additional features to your receiver simply execute ./install.sh again after this initial setup process has been completed." 13 78 - -## ASK TO UPDATE THE OPERATING SYSTEM - -if (whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "ADS-B Receiver Project Image Setup" --yesno "The image comes with the latest updates to Raspbian as of it's release. However updates may have been released for the operating system since the image was released. This being said it is highly recommended you allow the script to check for additional updates now in order to ensure you are in fact running the latest software available.\n\nWould you like the script to check for and install updates now?" 13 78) then - 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" - echo -e "" - sudo apt-get update - sudo apt-get -y dist-upgrade - echo -e "" - echo -e "\e[93m ------------------------------------------------------------------------------" - echo -e "\e[92m Your operating system should now be up to date.\e[39m" - echo -e "" - if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then - read -p "Press enter to continue..." CONTINUE - fi -fi - -## CONFIGURE DUMP1090 - -clear -echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}" -echo -e "" -echo -e "\e[92m Configure dump1090..." -echo -e "\e[93m ------------------------------------------------------------------------------\e[96m" -echo -e "" - -# If dump1090-mutability is installed... - - -if [[ $(dpkg-query -W -f='${STATUS}' dump1090-mutability 2>/dev/null | grep -c "ok installed") -eq 1 ]] ; 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 for the receiver's latitude. - 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 - - # Ask the user for the receiver's longitude. - 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 receeiver's longitude.\n(Example: XX.XXXXXXX)" 9 78 3>&1 1>&2 2>&3) - RECEIVER_LONGITUDE_TITLE="Receiver Longitude (REQUIRED)" - done - - echo -e "\e[94m Setting the receiver's latitude to ${RECEIVER_LATITUDE}...\e[97m" - ChangeConfig "LAT" ${RECEIVER_LATITUDE} "/etc/default/dump1090-mutability" - echo -e "\e[94m Setting the receiver's longitude to ${RECEIVER_LONGITUDE}...\e[97m" - ChangeConfig "LON" ${RECEIVER_LONGITUDE} "/etc/default/dump1090-mutability" - - # Ask if dump1090-mutability should bind on all IP addresses. - if (whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Bind Dump1090-mutability To All IP Addresses" --defaultno --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) 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" - ChangeConfig "NET_BIND_ADDRESS" "127.0.0.1" "/etc/default/dump1090-mutability" - fi - - # Reload dump1090-mutability to ensure all changes take effect. - echo -e "\e[94m Reloading dump1090-mutability...\e[97m" - echo -e "" - sudo service dump1090-mutability force-reload -fi - -# Download Heywhatsthat.com maximum range rings if the user wishes them to be displayed. -if [[ ! -f "/usr/share/dump1090-mutability/html/upintheair.json" ]] || [[ ! -f "/usr/share/dump1090-fa/html/upintheair.json" ]] ; then - if (whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Heywhatsthat.com Maximum Range Rings" --yesno "Maximum range rings can be added to dump1090-mutability usings 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 - HEYWHATSTHATID_TITLE="Heywhatsthat.com Panorama ID" - while [[ -z "${HEYWHATSTHATID}" ]] ; do - HEYWHATSTHATID=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${HEYWHATSTHATID_TITLE}" --nocancel --inputbox "\nEnter your Heywhatsthat.com panorama ID." 8 78 3>&1 1>&2 2>&3) - HEYWHATSTHATID_TITLE="Heywhatsthat.com Panorama ID (REQUIRED)" - done - HEYWHATSTHATRINGONE_TITLE="Heywhatsthat.com First Ring Altitude" - while [[ -z "${HEYWHATSTHATRINGONE}" ]] ; do - HEYWHATSTHATRINGONE=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${HEYWHATSTHATRINGONE_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) - HEYWHATSTHATRINGONE_TITLE="Heywhatsthat.com First Ring Altitude (REQUIRED)" - done - HEYWHATSTHATRINGTWO_TITLE="Heywhatsthat.com Second Ring Altitude" - while [[ -z "${HEYWHATSTHATRINGTWO}" ]] ; do - HEYWHATSTHATRINGTWO=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${HEYWHATSTHATRINGTWO_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) - HEYWHATSTHATRINGTWO_TITLE="Heywhatsthat.com Second Ring Altitude (REQUIRED)" - done - echo -e "\e[94m Downloading JSON data pertaining to the supplied panorama ID...\e[97m" - echo -e "" - if [[ $(dpkg-query -W -f='${STATUS}' dump1090-mutability 2>/dev/null | grep -c "ok installed") -eq 1 ]] ; then - HTMLPATH="/usr/share/dump1090-mutability/html/upintheair.json" - else - HTMLPATH="/usr/share/dump1090-fa/html/upintheair.json" - fi - sudo wget -O ${HTMLPATH} "http://www.heywhatsthat.com/api/upintheair.json?id=${HEYWHATSTHATID}&refraction=0.25&alts=${HEYWHATSTHATRINGONE},${HEYWHATSTHATRINGTWO}" - fi -else - echo -e "\e[94m Heywhatsthat.com maximum range rings setup skipped..." -fi - -# Dump1090 configuration is now complete. -echo -e "" -echo -e "\e[93m ------------------------------------------------------------------------------" -echo -e "\e[92m Dump1090 configuration complete.\e[39m" -echo -e "" -if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then - read -p "Press enter to continue..." CONTINUE -fi - - -# CONFIGURE PIAWARE IF NEEDED - -if [[ $(dpkg-query -W -f='${STATUS}' dump1090-fa 2>/dev/null | grep -c "ok installed") -eq 1 ]] ; then - clear - echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}" - echo -e "" - echo -e "\e[92m Configure PiAware..." - echo -e "\e[93m ------------------------------------------------------------------------------\e[96m" - echo -e "" - - # Confirm if the user is able to claim their PiAware instance online. - FLIGHTAWARE_LOCAL_CREDENTIALS=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Claim Your PiAware Device" --yesno "Although it is possible to configure your FlightAware credentials locally, these will be stored in plaintext which represents a security risk that should be avoided.\n\nFlightAware recommends claiming your feeder online using the following page:\n\n http://flightaware.com/adsb/piaware/claim\n\nWill you be able to access the FlightAware website from the same public IP address as the feeder will be sending data from?" 16 78 3>&1 1>&2 2>&3) - - if [[ "${FLIGHTAWARE_LOCAL_CREDENTIALS}" -eq "1" ]] ; then - # Ask for the users FlightAware login. - FLIGHTAWARE_LOGIN=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Your FlightAware Login" --nocancel --inputbox "\nEnter your FlightAware login.\nLeave this blank to manually claim your PiAware device." 9 78 3>&1 1>&2 2>&3) - if [[ ! "${FLIGHTAWARE_LOGIN}" = "" ]] ; then - # If the user supplied their FlightAware login continue with the device claiming process. - FLIGHTAWARE_PASSWORD1_TITLE="Your FlightAware Password" - while [[ -z "${FLIGHTAWARE_PASSWORD1}" ]] ; do - FLIGHTAWARE_PASSWORD1=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${FLIGHTAWARE_PASSWORD1_TITLE}" --nocancel --passwordbox "\nEnter your FlightAware password." 8 78 3>&1 1>&2 2>&3) - done - FLIGHTAWARE_PASSWORD2_TITLE="Confirm Your FlightAware Password" - while [[ -z "${FLIGHTAWARE_PASSWORD2}" ]] ; do - FLIGHTAWARE_PASSWORD2=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${FLIGHTAWARE_PASSWORD2_TITLE}" --nocancel --passwordbox "\nConfirm your FlightAware password." 8 78 3>&1 1>&2 2>&3) - done - while [[ ! "${FLIGHTAWARE_PASSWORD1}" = "${FLIGHTAWARE_PASSWORD2}" ]] ; do - FLIGHTAWARE_PASSWORD1="" - FLIGHTAWARE_PASSWORD2="" - # Display an error message if the passwords did not match. - whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Claim Your PiAware Device" --msgbox "Passwords did not match.\nPlease enter your password again." 9 78 - FLIGHTAWARE_PASSWORD1_TITLE="Your FlightAware Password (REQUIRED)" - while [[ -z "${FLIGHTAWARE_PASSWORD1}" ]] ; do - FLIGHTAWARE_PASSWORD1=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${FLIGHTAWARE_PASSWORD1_TITLE}" --nocancel --passwordbox "\nEnter your FlightAware password." 8 78 3>&1 1>&2 2>&3) - done - FLIGHTAWARE_PASSWORD2_TITLE="Confirm Your FlightAware Password (REQUIRED)" - while [[ -z "${FLIGHTAWARE_PASSWORD2}" ]] ; do - FLIGHTAWARE_PASSWORD2=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${FLIGHTAWARE_PASSWORD2_TITLE}" --nocancel --passwordbox "\nConfirm your FlightAware password." 8 78 3>&1 1>&2 2>&3) - done - done - else - # Display a message to the user stating they need to manually claim their device. - whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Claim Your PiAware Device" --msgbox "Please supply your FlightAware login in order to claim this device, after supplying this you will ask you to enter your password for verification.\n\nIf you decide not to provide a login and password at this time you should still be able to claim your feeder by visting the following site:\n\n http://flightaware.com/adsb/piaware/claim" 13 78 - fi - fi - - # PiAware configuration is now complete. - echo -e "" - echo -e "\e[93m ------------------------------------------------------------------------------" - echo -e "\e[92m PiAware configuration complete.\e[39m" - echo -e "" - if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then - read -p "Press enter to continue..." CONTINUE - fi -fi - -## SETUP THE ADS-B RECEIVER PROJECT WEB PORTAL - -chmod +x ${RECEIVER_BASH_DIRECTORY}/portal/install.sh -${RECEIVER_BASH_DIRECTORY}/portal/install.sh -if [[ $? -ne 0 ]] ; then - exit 1 -fi - -## FINALIZE IMAGE SETUP - -# remove the "image" file. -rm -f image - -whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "ADS-B Receiver Project Image Setup" --msgbox "Image setup is now complete. If you have any questions or comments on the project let us know on our website.\n\n https://www.adsbreceiver.net\n\nRemember to install additional features simply run ./install.sh again." 12 78 - -exit 0 diff --git a/bash/init.sh b/bash/init.sh index 1f7e14f0..6cdceac9 100755 --- a/bash/init.sh +++ b/bash/init.sh @@ -1,18 +1,5 @@ #!/bin/bash -## CHECK IF THIS IS THE FIRST RUN USING AN IMAGE RELEASE - -if [[ -f $RECEIVER_ROOT_DIRECTORY/image ]] ; then - chmod +x $RECEIVER_BASH_DIRECTORY/image.sh - $RECEIVER_BASH_DIRECTORY/image.sh - if [[ $? != 0 ]] ; then - echo -e "\n\n \e[91m IMAGE SETUP HAS BEEN TERMINATED.\e[39m\n" - exit 1 - fi - exit 0 -fi - - ## INCLUDE EXTERNAL SCRIPTS source $RECEIVER_BASH_DIRECTORY/functions.sh diff --git a/bash/tools/image_setup.sh b/bash/tools/image_setup.sh deleted file mode 100755 index ff869edc..00000000 --- a/bash/tools/image_setup.sh +++ /dev/null @@ -1,230 +0,0 @@ -#!/bin/bash - -##################################################################################### -# ADS-B RECEIVER # -##################################################################################### -# # -# This script is meant only to create offical Raspbian releases for this project. # -# # -# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # -# # -# Copyright (c) 2015-2016 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. # -# # -# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # - - - ################################################################ - ## THIS SCRIPT IS ONLY MEANT FOR RASPBIAN IMAGE PREPERATION ## - ################################################################ - # # - # This script must be ran from the projects root directory. # - # # - # pi@darkstar: ./bash/tools/image_setup.sh # - # # - ################################################################ - - -clear - -## 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 - -echo -e "" -echo -e "\e[91m The ADS-B Receiver Project Image Preparation Script\e[97m" -echo -e "" - -## UPDATE REPOSITORY LISTS AND OPERATING SYSTEM - -echo -e "\e[95m Updating repository lists and operating system...\e[97m" -echo -e "" -sudo apt-get update -sudo apt-get -y dist-upgrade - -## INSTALL DUMP1090 - -echo -e "" -echo -e "\e[95m Installing prerequisite packages...\e[97m" -echo -e "" -CheckPackage git -CheckPackage curl -CheckPackage build-essential -CheckPackage debhelper -CheckPackage cron -CheckPackage rtl-sdr -CheckPackage librtlsdr-dev -CheckPackage libusb-1.0-0-dev -CheckPackage pkg-config -CheckPackage lighttpd -CheckPackage fakeroot -CheckPackage bc - -## SETUP RTL-SDR RULES - -echo -e "\e[95m Setting up RTL-SDR udev rules...\e[97m" -sudo curl --http1.1 https://raw.githubusercontent.com/osmocom/rtl-sdr/master/rtl-sdr.rules --output /etc/udev/rules.d/rtl-sdr.rules -sudo service udev restart -BlacklistModules - -# Ask which version of dump1090 to install. -DUMP1090OPTION=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Choose Dump1090 Version" --menu "Which version of dump1090 is to be installed?" 12 65 2 "dump1090-mutability" "(Mutability)" "dump1090-fa" "(FlightAware)" 3>&1 1>&2 2>&3) - -case ${DUMP1090OPTION} in - "dump1090-mutability") - echo -e "\e[95m Installing dump1090-mutability...\e[97m" - echo -e "" - - # Dump1090-mutability - echo -e "" - echo -e "\e[95m Installing dump1090-mutability...\e[97m" - echo -e "" - mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/dump1090-mutability - cd ${RECEIVER_BUILD_DIRECTORY}/dump1090-mutability 2>&1 - git clone https://github.com/mutability/dump1090.git - cd ${RECEIVER_BUILD_DIRECTORY}/dump1090-mutability/dump1090 2>&1 - dpkg-buildpackage -b - cd ${RECEIVER_BUILD_DIRECTORY}/dump1090-mutability 2>&1 - sudo dpkg -i dump1090-mutability_1.15~dev_*.deb - ;; - "dump1090-fa") - echo -e "\e[95m Installing dump1090-fa and PiAware...\e[97m" - echo -e "" - - # Install prerequisite packages. - echo -e "\e[95m Installing additional dump1090-fa and PiAware prerequisite packages...\e[97m" - echo -e "" - CheckPackage dh-systemd - CheckPackage libncurses5-dev - CheckPackage cmake - CheckPackage doxygen - CheckPackage libtecla-dev - CheckPackage help2man - CheckPackage pandoc - CheckPackage tcl8.6-dev - CheckPackage autoconf - CheckPackage python3-dev - CheckPackage python3-venv - CheckPackage virtualenv - CheckPackage zlib1g-dev - CheckPackage tclx8.4 - CheckPackage tcllib - CheckPackage tcl-tls - CheckPackage itcl3 - CheckPackage net-tools - - # bladeRF - echo "" - echo -e "\e[95m Installing bladeRF...\e[97m" - echo "" - mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/bladeRF - cd ${RECEIVER_BUILD_DIRECTORY}/bladeRF 2>&1 - git clone https://github.com/Nuand/bladeRF.git - cd ${RECEIVER_BUILD_DIRECTORY}/bladeRF/bladeRF 2>&1 - dpkg-buildpackage -b - cd ${RECEIVER_BUILD_DIRECTORY}/bladeRF 2>&1 - sudo dpkg -i libbladerf1_*.deb - sudo dpkg -i libbladerf-dev_*.deb - sudo dpkg -i libbladerf-udev_*.deb - - # Dump1090-fa - echo -e "" - echo -e "\e[95m Installing dump1090-fa...\e[97m" - echo -e "" - mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/dump1090-fa - cd ${RECEIVER_BUILD_DIRECTORY}/dump1090-fa 2>&1 - git clone https://github.com/flightaware/dump1090.git - cd ${RECEIVER_BUILD_DIRECTORY}/dump1090-fa/dump1090 2>&1 - dpkg-buildpackage -b - cd ${RECEIVER_BUILD_DIRECTORY}/dump1090-fa 2>&1 - sudo dpkg -i dump1090-fa_*.deb - - # PiAware - cd ${RECEIVER_BUILD_DIRECTORY} 2>&1 - git clone https://github.com/flightaware/piaware_builder.git - cd ${RECEIVER_BUILD_DIRECTORY}/piaware_builder 2>&1 - ./sensible-build.sh jessie - cd ${RECEIVER_BUILD_DIRECTORY}/piaware_builder/package-jessie 2>&1 - dpkg-buildpackage -b - sudo dpkg -i ${RECEIVER_BUILD_DIRECTORY}/piaware_builder/piaware_*.deb - ;; - *) - # Nothing selected. - exit 1 - ;; -esac - -## INSTALL THE BASE PORTAL PREREQUISITES PACKAGES - -echo -e "" -echo -e "\e[95m Installing packages needed by the ADS-B Receiver Project Web Portal...\e[97m" -echo -e "" -CheckPackage lighttpd -CheckPackage collectd-core -CheckPackage rrdtool -CheckPackage libpython2.7 -CheckPackage php7.0-cgi -CheckPackage php7.0-json - -## PREVIOUS LOCALE SCRIPTING THAT SET LOCALE NO LONGER WORKS PROPERLY ON STRETCH. -## The scripting setting this using this script has been removed for now. -## We will manually set this using rasp-config when creating the script in the meantime. -## Later I will look into automating this but time is short on the v2.6.0 release. - -## TOUCH THE IMAGE FILE - -echo -e "\e[95m Touching the \"image\" file...\e[97m" -cd ${RECEIVER_ROOT_DIRECTORY} 2>&1 -touch image - -## CHANGE THE PASSWORD FOR THE USER PI - -echo -e "\e[95m Changing the password for the user pi...\e[97m" -echo "pi:adsbreceiver" | sudo chpasswd - -## ENABLE SSH - -echo -e "\e[95m Touching the \"ssh\" file...\e[97m" -sudo touch /boot/ssh -echo -e "\e[95m Reconfiguring openssh-server...\e[97m" -sudo rm -f /etc/ssh/ssh_host_* && sudo dpkg-reconfigure openssh-server - -## CLEAR BASH HISTORY - -history -c && history -w - -## DONE - -echo -e "" -echo -e "\e[91m Image preparation completed.)\e[39m" -echo -e "\e[91m Device will be shut down in 5 seconds.\e[39m" -echo -e "" - -sleep 5 -sudo halt - -exit 0 diff --git a/bash/tools/portal_backup.sh b/bash/tools/portal_backup.sh index b41f4ae0..ff094e27 100644 --- a/bash/tools/portal_backup.sh +++ b/bash/tools/portal_backup.sh @@ -1,38 +1,5 @@ #!/bin/bash -##################################################################################### -# ADS-B RECEIVER # -##################################################################################### -# # -# This script was created to allow users to backup their portal data. At this # -# time this script has not been integrated into the current collection of # -# scripts. However this script, possibly in a modified form, will be integrated # -# for simplified use by those who set up their receivers using this project. # -# # -# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # -# # -# 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 BACKUPDATE=$(date +"%Y-%m-%d-%H%M%S") @@ -43,64 +10,58 @@ RAWDOCUMENTROOT=`/usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf -p | grep ser LIGHTTPDDOCUMENTROOT=`sed 's/.*"\(.*\)"[^"]*$/\1/' <<< ${RAWDOCUMENTROOT}` COLLECTD_RRD_DIRECTORY="/var/lib/collectd/rrd" + ## BEGIN THE BACKUP PROCESS clear -echo -e "\n\e[91m ADSB Receiver Project Maintenance" +echo -e "\n\e[91m ADS-B Portal Maintenance" echo -e "" -echo -e "\e[92m Backing up portal data..." +echo -e "\e[92m Backing up portal data" echo -e "\e[93m ------------------------------------------------------------------------------\e[97m" echo -e "" echo -e "\e[95m Backing up current portal data...\e[97m" echo -e "" + ## PREPARE TO BEGIN CREATING BACKUPS -# Get the database type used. echo -e "\e[94m Declare the database engine being used...\e[97m" DATABASEENGINE=`grep 'db_driver' ${LIGHTTPDDOCUMENTROOT}/classes/settings.class.php | tail -n1 | cut -d\' -f2` -echo -e "\e[94m Declare whether or not the advnaced portal features were installed...\e[97m" +echo -e "\e[94m Declare whether or not the advanaced portal features were installed...\e[97m" -# Decide if the advanced portal features were installed or not. -echo -e "\e[94m Declare whether or not the advnaced portal features were installed...\e[97m" +echo -e "\e[94m Declare whether or not the advanaced portal features were installed...\e[97m" if [[ "${DATABASEENGINE}" = "xml" ]] ; then ADVANCED=FALSE else ADVANCED=TRUE fi -# Get the path to the SQLite database if SQLite is used for the database. if [[ "${DATABASEENGINE}" = "sqlite" ]] ; then DATABASEPATH=`grep 'db_host' ${LIGHTTPDDOCUMENTROOT}/classes/settings.class.php | tail -n1 | cut -d\' -f2` fi -# Assign the MySQL login credentials to variables if a MySQL database is being used. if [[ "${DATABASEENGINE}" = "mysql" ]] ; then MYSQLDATABASE=`grep 'db_database' ${LIGHTTPDDOCUMENTROOT}/classes/settings.class.php | tail -n1 | cut -d\' -f2` MYSQLUSERNAME=`grep 'db_username' ${LIGHTTPDDOCUMENTROOT}/classes/settings.class.php | tail -n1 | cut -d\' -f2` MYSQLPASSWORD=`grep 'db_password' ${LIGHTTPDDOCUMENTROOT}/classes/settings.class.php | tail -n1 | cut -d\' -f2` fi -# Check that the backup directory exists. echo -e "\e[94m Checking that the directory ${BACKUPSDIRECTORY} exists...\e[97m" if [[ ! -d "${BACKUPSDIRECTORY}" ]] ; then - # Create the backups directory. echo -e "\e[94m Creating the directory ${BACKUPSDIRECTORY}...\e[97m" mkdir -vp ${BACKUPSDIRECTORY} fi -# Check that the temporary directory exists. echo -e "\e[94m Checking that the directory ${TEMPORARY_DIRECTORY} exists...\e[97m" if [[ ! -d "${TEMPORARY_DIRECTORY}" ]] ; then - # Create the tmp directory. echo -e "\e[94m Creating the directory ${TEMPORARY_DIRECTORY}...\e[97m" mkdir -vp ${TEMPORARY_DIRECTORY} fi + ## BACKUP THE COLLECTD RRD FILES BY EXPORTING THEM TO XML. -# Export the collectd round robin database files to the temporary directory as XML files. RRD_FILE_LIST=`find ${COLLECTD_RRD_DIRECTORY} -name '*.rrd'` if [[ -z "${RRD_FILE_LIST}" ]]; then echo -e "\e[94m No RRD file found in ${COLLECTD_RRD_DIRECTORY}...\e[97m" @@ -117,10 +78,10 @@ else done fi + ## BACKUP PORTAL USING LITE FEATURES AND XML FILES if [[ "${ADVANCED}" = "FALSE" ]] ; then - # Copy the portal XML data files to the temporary directory. echo -e "\e[94m Checking that the directory ${TEMPORARY_DIRECTORY}/var/www/html/data/ exists...\e[97m" if [[ ! -d "${TEMPORARY_DIRECTORY}/var/www/html/data/" ]] ; then mkdir -vp ${TEMPORARY_DIRECTORY}/var/www/html/data/ @@ -129,18 +90,18 @@ if [[ "${ADVANCED}" = "FALSE" ]] ; then sudo cp -R /var/www/html/data/*.xml ${TEMPORARY_DIRECTORY}/var/www/html/data/ else + ## BACKUP PORTAL USING ADVANCED FEATURES AND A SQLITE DATABASE if [[ "${DATABASEENGINE}" = "sqlite" ]] ; then - # Copy the portal SQLite database file to the temporary directory. echo -e "\e[94m Backing up the SQLite database file to ${TEMPORARY_DIRECTORY}/var/www/html/data/portal.sqlite...\e[97m" sudo cp -R ${DATABASEPATH} ${TEMPORARY_DIRECTORY}/var/www/html/data/portal.sqlite fi + ## BACKUP PORTAL USING ADVANCED FEATURES AND A MYSQL DATABASE if [[ "${DATABASEENGINE}" = "mysql" ]] ; then - # Dump the current MySQL database to a .sql text file. echo -e "\e[94m Dumping the MySQL database ${MYSQLDATABASE} to the file ${TEMPORARY_DIRECTORY}/${MYSQLDATABASE}.sql...\e[97m" mysqldump -u${MYSQLUSERNAME} -p${MYSQLPASSWORD} ${MYSQLDATABASE} > ${TEMPORARY_DIRECTORY}/${MYSQLDATABASE}.sql fi @@ -148,16 +109,14 @@ fi ## COMPRESS AND DATE THE BACKUP ARCHIVE -# Create the backup archive. echo -e "\e[94m Compressing the backed up files...\e[97m" echo -e "" tar -zcvf ${BACKUPSDIRECTORY}/adsb-receiver_data_${BACKUPDATE}.tar.gz ${TEMPORARY_DIRECTORY} echo -e "" - -# Remove the temporary directory. echo -e "\e[94m Removing the temporary backup directory...\e[97m" sudo rm -rf ${TEMPORARY_DIRECTORY} + ## BACKUP PROCESS COMPLETE echo -e "\e[32m" From 99642de229f6ecdb03b82c9cff88c0369e3b166f Mon Sep 17 00:00:00 2001 From: jprochazka Date: Mon, 22 Jul 2024 02:04:59 -0400 Subject: [PATCH 15/26] The Duck DNS script now uses new logging functions. --- CHANGELOG.md | 1 + bash/decoders/dump978-fa.sh | 6 +- bash/extras/duckdns.sh | 128 ++++++++++++++++-------------------- bash/feeders/piaware.sh | 5 +- 4 files changed, 64 insertions(+), 76 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 72702eac..226cb753 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ The following is a history of the changes made to this project. * Modified the OpenSky Network client installation script so it utilizes the new logging functions. * Modified the PlaneFinder client installation script so it utilizes the new logging functions. * Modified the beast-splitter installation script so it utilizes the new logging functions. +* Modified the Duck DNS installation script so it utilizes the new logging functions. * Added the --version and -v arguments in order to display the current project version. * Removed scripting used for image setup. diff --git a/bash/decoders/dump978-fa.sh b/bash/decoders/dump978-fa.sh index c23ed80e..f60c5098 100755 --- a/bash/decoders/dump978-fa.sh +++ b/bash/decoders/dump978-fa.sh @@ -53,8 +53,7 @@ if [[ "${adsb_decoder_installed}" == "true" ]]; then --title "${dump1090_device_serial_title}" \ --inputbox "\nEnter the serial number for your dump1090 RTL-SDR device." \ 8 78) - whiptail_exit_status=$? - if [[ $whiptail_exit_status == 0 ]]; then + if [[ $dump1090_device_serial == 0 ]]; then LogAlertHeading "INSTALLATION HALTED" LogAlertMessage "Setup has been halted due to lack of required information" echo "" @@ -71,8 +70,7 @@ if [[ "${adsb_decoder_installed}" == "true" ]]; then --title "${dump978_device_serial_title}" \ --inputbox "\nEnter the serial number for your dump978 RTL-SDR device." \ 8 78) - whiptail_exit_status=$? - if [[ $whiptail_exit_status == 0 ]]; then + if [[ $dump978_device_serial == 0 ]]; then LogAlertHeading "INSTALLATION HALTED" LogAlertMessage "Setup has been halted due to lack of required information" echo "" diff --git a/bash/extras/duckdns.sh b/bash/extras/duckdns.sh index f9490dac..96bc6024 100755 --- a/bash/extras/duckdns.sh +++ b/bash/extras/duckdns.sh @@ -1,134 +1,120 @@ #!/bin/bash -## INCLUDE EXTERNAL SCRIPTS +## PRE INSTALLATION OPERATIONS source $RECEIVER_BASH_DIRECTORY/variables.sh source $RECEIVER_BASH_DIRECTORY/functions.sh - -## BEGIN SETUP - clear -echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}" +LogProjectName ${RECEIVER_PROJECT_TITLE} +LogTitleHeading "Setting up Duck DNS" +LogTitleMessage "------------------------------------------------------------------------------" echo "" -echo -e "\e[92m Setting up Duck DNS..." -echo -e "\e[93m ------------------------------------------------------------------------------\e[96m" -echo "" -if ! 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; then - echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m" - echo -e " Setup has been halted at the request of the user." +if ! 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; then + LogAlertHeading "INSTALLATION HALTED" + LogAlertMessage "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" + LogTitleMessage "------------------------------------------------------------------------------" + LogTitleHeading "Duck DNS setup halted" echo "" - read -p "Press enter to continue..." discard exit 1 fi -echo -e "\e[95m Setting up Duck DNS on this device...\e[97m" -echo "" - ## CHECK FOR PREREQUISITE PACKAGES -# Check that the required packages are installed -echo -e "\e[95m Installing packages needed to build and fulfill dependencies...\e[97m" -echo "" +LogHeading "Installing packages needed to fulfill PlaneFinder client dependencies" + CheckPackage cron CheckPackage curl -exho "" -## CONFIRM SETTINGS +## GATHER REQUIRED INFORMATION FROM THE USER -# Ask for the user sub domain to be assigned to this device +LogHeading "Gather information required to configure Duck DNS support" + +LogMessage "Asking the user for the sub domain to be assigned to this device" domain_title="Duck DNS Sub Domain" while [[ -z $domain ]] ; do - domain=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title $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) + domain=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ + --title $domain_title \ + --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) + if [[ $domain == 0 ]]; then + LogAlertHeading "INSTALLATION HALTED" + LogAlertMessage "Setup has been halted due to lack of required information" + echo "" + LogTitleMessage "------------------------------------------------------------------------------" + LogTitleHeading "Duck DNS decoder setup halted" + exit 1 + fi domain_title="Duck DNS Sub Domain (REQUIRED)" done -# Ask for the Duck DNS token to be assigned to this receiver +LogMessage "Asking the user for the Duck DNS token" token_title="Duck DNS Token" while [[ -z "${DUCKDNS_TOKEN}" ]] ; do - token=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title $token_title --nocancel --inputbox "\nPlease enter your Duck DNS token." 8 78 3>&1 1>&2 2>&3) + token=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ + --title $token_title \ + --inputbox "\nPlease enter your Duck DNS token." \ + 8 78) + if [[ $domain == 0 ]]; then + LogAlertHeading "INSTALLATION HALTED" + LogAlertMessage "Setup has been halted due to lack of required information" + echo "" + LogTitleMessage "------------------------------------------------------------------------------" + LogTitleHeading "Duck DNS setup halted" + exit 1 + fi token_title="Duck DNS Token (REQUIRED)" done -## PROJECT BUILD DIRECTORY +## CREATE THE DUCK DNS SCRIPT -# 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 +LogHeading "Creating the Duck DNS script" -# Create a component directory within the build directory if it does not already exist if [[ ! -d $RECEIVER_BUILD_DIRECTORY/duckdns ]]; then - echo -e "\e[94m Creating the directory ${RECEIVER_BUILD_DIRECTORY}/duckdns...\e[97m" + LogMessage "Creating the Duck DNS build directory" echo "" - mkdir -vp $RECEIVER_BUILD_DIRECTORY/duckdns 2>&1 + mkdir -vp $RECEIVER_BUILD_DIRECTORY/duckdns echo "" fi - -## CREATE SCRIPT - -# Create then set permissions on the file duck.sh -echo -e "\e[94m Creating the Duck DNS update script...\e[97m" +LogMessage "Creating the Duck DNS update script" tee $RECEIVER_BUILD_DIRECTORY/duckdns/duck.sh > /dev/null <&1 +chmod -v 700 $RECEIVER_BUILD_DIRECTORY/duckdns/duck.sh echo "" - -## ADD TO CRON - -echo -e "\e[94m Adding the DuckDNS cron file...\e[97m" +LogMessage "Creating the Duck DNS cron file" sudo tee /etc/cron.d/duckdns_ip_address_update > /dev/null </dev/null 2>&1 EOF echo "" - -## START SCRIPTS - -echo -e "\e[95m Starting Duck DNS...\e[97m" -echo "" - -# Kill any currently running instance - pid=`ps -efww | grep -w "duck.sh " | awk -vpid=$$ '$2 != pid { print $2 }'` - if [[ -n $pid ]]; then - echo -e "\e[94m Killing the duck.sh process...\e[97m" - echo "" - sudo kill $pid 2>&1 - sudo kill -9 $pid 2>&1 - echo "" - fi -done - -# Run the Duck DNS update script for the first time -echo -e "\e[94m Executing the Duck DNS update script...\e[97m" +LogMessage "Executing the Duck DNS update script" echo "" -$RECEIVER_BUILD_DIRECTORY/duckdns/duck.sh 2>&1 +$RECEIVER_BUILD_DIRECTORY/duckdns/duck.sh echo "" ## 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 +LogMessage "Returning to ${RECEIVER_PROJECT_TITLE} root directory" +cd $RECEIVER_ROOT_DIRECTORY echo "" -echo -e "\e[93m ------------------------------------------------------------------------------" -echo -e "\e[92m Duck DNS setup is complete.\e[39m" +LogTitleMessage "------------------------------------------------------------------------------" +LogTitleHeading "Duck DNS setup is complete" echo "" read -p "Press enter to continue..." discard diff --git a/bash/feeders/piaware.sh b/bash/feeders/piaware.sh index 7f41035f..05793819 100755 --- a/bash/feeders/piaware.sh +++ b/bash/feeders/piaware.sh @@ -231,7 +231,10 @@ fi LogHeading "Performing post installation operations" LogMessage "Displaying the message informing the user on how to claim their device" -whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Claiming Your PiAware Device" --msgbox "FlightAware requires you claim your feeder online using the following URL:\n\n http://flightaware.com/adsb/piaware/claim\n\nTo claim your device simply visit the address listed above." 12 78 +whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ + --title "Claiming Your PiAware Device" \ + --msgbox "FlightAware requires you claim your feeder online using the following URL:\n\n http://flightaware.com/adsb/piaware/claim\n\nTo claim your device simply visit the address listed above." \ + 12 78 ## SETUP COMPLETE From 062cd7ec3a3948fef2000fd4e90b95a999d7ac52 Mon Sep 17 00:00:00 2001 From: jprochazka Date: Mon, 22 Jul 2024 02:33:33 -0400 Subject: [PATCH 16/26] The main.sh script now uses new logging functions. --- CHANGELOG.md | 11 +- bash/init.sh | 101 ++++++++++++------ .../current_total-aircraft_with-positions.py | 77 ------------- build/display/fonts/alert.ttf | Bin 49432 -> 0 bytes 4 files changed, 68 insertions(+), 121 deletions(-) delete mode 100644 build/display/current_total-aircraft_with-positions.py delete mode 100644 build/display/fonts/alert.ttf diff --git a/CHANGELOG.md b/CHANGELOG.md index 226cb753..cdcf04cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,16 +9,7 @@ The following is a history of the changes made to this project. * The dump1090-fa installation script now mimics the current dump1090-fa installation instructions. * Added logging functions which in the future will offer a way to log output to files. * Added variables which can be modified to adjust text colors used by the bash scripts. -* Modified the dump1090-fa installation script so that it utilizes the new logging functions. -* Modified the dump978-fa installation script so that it utilizes the new logging functions. -* Modified the ADS-B Exchange client installation script so it utilizes the new logging functions. -* Modified the airplanes.live client installation script so it utilizes the new logging functions. -* Modified the FlightRadar24 client installation script so it utilizes the new logging functions. -* Modified the Fly Italy ADS-B client installation script so it utilizes the new logging functions. -* Modified the OpenSky Network client installation script so it utilizes the new logging functions. -* Modified the PlaneFinder client installation script so it utilizes the new logging functions. -* Modified the beast-splitter installation script so it utilizes the new logging functions. -* Modified the Duck DNS installation script so it utilizes the new logging functions. +* All installation scripts now utilize the new logging functions. * Added the --version and -v arguments in order to display the current project version. * Removed scripting used for image setup. diff --git a/bash/init.sh b/bash/init.sh index 6cdceac9..4d8045f9 100755 --- a/bash/init.sh +++ b/bash/init.sh @@ -1,92 +1,125 @@ #!/bin/bash -## INCLUDE EXTERNAL SCRIPTS +## PRE EXECUTION OPERATIONS +source $RECEIVER_BASH_DIRECTORY/variables.sh source $RECEIVER_BASH_DIRECTORY/functions.sh -## DISPLAY WELCOME SCREEN +## DISPLAY THE WELCOME SCREEN -if ! 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; then - # Setup has been halted by the user. - echo -e "\n\e[91m \e[5mSETUP HALTED!\e[25m" - echo -e " Setup has been halted at the request of the user.\e[37m\n" - read -p "Press enter to continue..." discard +LogHeading "Displaying the welcome message" + +LogMessage "Displaying the welcome message to the user" +if ! 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; then + LogAlertHeading "INSTALLATION HALTED" + LogAlertMessage "Setup has been halted at the request of the user" exit 1 fi -## ATTEMPT TO UPDATE THE REPOSITORY +## ATTEMPT TO CHANGE AND/OR UPDATE THE REPOSITORY -# Skip update if the development flag was set or the selected branch is not present in origin if [[ $RECEIVER_DEVELOPMENT_MODE != "true" ]]; then current_branch=`git rev-parse --abbrev-ref HEAD` + clear - echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}\n" - echo -e "\e[92m Fetching the latest version of the '${RECEIVER_PROJECT_BRANCH}' branch." - echo -e "\e[93m -----------------------------------------------------------------------------\e[97m\n" + LogProjectName ${RECEIVER_PROJECT_TITLE} + LogTitleHeading "Fetching the latest version of the ${RECEIVER_PROJECT_BRANCH} branch" + LogTitleMessage "------------------------------------------------------------------------------" + echo "" + + LogHeading "Checking out and updating the appropriate branch" - # Ask if the user wishes to back up this branch if core files have been changed if [[ `git status --porcelain --untracked-files=no` && `git ls-remote --heads https://github.com/jprochazka/adsb-receiver.git refs/heads/master | wc -l` = 1 ]]; then - if whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Stash Changes To Branch '${current_branch}'" --defaultno --yesno "There appears to be changes to the current branch. In order to switch to or fetch the '${current_branch}' branch these changes will need to be stashed. Would you like to stash these changes now?" 14 78; then - echo -e "\e[94m Stashing changes to the ${current_branch} branch...\e[97m\n" + if whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ + --title "Stash Changes To Branch ${current_branch}" \ + --defaultno \ + --yesno "There appears to be changes to the current branch. In order to switch to or fetch the ${current_branch} branch these changes will need to be stashed. Would you like to stash these changes now?" \ + 14 78; then + LogMessage "Stashing changes made to the ${current_branch} branch" git stash echo "" else - echo -e " \e[91m SETUP HAS BEEN TERMINATED.\e[39m\n" + LogAlertHeading "INSTALLATION HALTED" + LogAlertMessage "Setup has been halted at the request of the user" exit 1 fi fi - # Checkout the appropriate branch if [[ "${current_branch}" != "${RECEIVER_PROJECT_BRANCH}" ]]; then - echo -e "\e[94m Switching to branch ${RECEIVER_PROJECT_BRANCH}...\e[97m\n" + LogMessage "Switching to branch ${RECEIVER_PROJECT_BRANCH}" git checkout $RECEIVER_PROJECT_BRANCH fi - # Fetch the most recent version of the branch from origin and reset any changes if [[ `git ls-remote --heads https://github.com/jprochazka/adsb-receiver.git refs/heads/$RECEIVER_PROJECT_BRANCH | wc -l` = 1 ]]; then - echo -e "\n\e[94m Fetching branch ${RECEIVER_PROJECT_BRANCH} from origin...\e[97m" + LogMessage "Fetching branch ${RECEIVER_PROJECT_BRANCH} from origin" + echo "" git fetch origin - echo -e "\e[94m Performing hard reset of branch ${RECEIVER_PROJECT_BRANCH} so it matches origin/${RECEIVER_PROJECT_BRANCH}...\e[97m\n" + echo "" + LogMessage "Performing hard reset of branch ${RECEIVER_PROJECT_BRANCH} so it matches origin/${RECEIVER_PROJECT_BRANCH}" + echo "" git reset --hard origin/$RECEIVER_PROJECT_BRANCH else - echo -e "\e[94m The '${RECEIVER_PROJECT_BRANCH}' does not appear to be in origin...\e[97m" + LogMessage "The branch ${RECEIVER_PROJECT_BRANCH} does not appear to be in origin" fi - echo -e "\n\e[93m -----------------------------------------------------------------------------" - echo -e "\e[92m Finished fetching the latest version the '${RECEIVER_PROJECT_BRANCH}' branch.\e[39m\n" + LogTitleMessage "-----------------------------------------------------------------------------" + LogTitleHeading "Finished fetching the latest version the '${RECEIVER_PROJECT_BRANCH}' branch." + echo "" read -p "Press enter to continue..." discard fi ## ASK IF OPERATING SYSTEM SHOULD BE UPDATED -if 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; then +LogHeading "Performing operating system updates if so desired" + +LogMessage "Asking the user if they wish to update the operating system" +if 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; then clear - echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}\n" - echo -e "\e[92m Downloading and installing the latest updates for your operating system." - echo -e "\e[93m ------------------------------------------------------------------------\e[97m\n" + LogProjectName ${RECEIVER_PROJECT_TITLE} + LogTitleHeading "Downloading and installing the latest updates for your operating system" + LogTitleMessage "------------------------------------------------------------------------------" + echo "" + LogMessage "Updating the operating system using apt-get" + echo "" sudo apt-get -y dist-upgrade - echo -e "\n\e[93m ------------------------------------------------------------------------" - echo -e "\e[92m Your operating system should now be up to date.\e[39m\n" + echo "" + LogTitleMessage "------------------------------------------------------------------------" + LogTitleHeading "Your operating system should now be up to date" + echo "" read -p "Press enter to continue..." discard fi ## EXECUTE BASH/MAIN.SH +LogHeading "Executing the script bash/main.sh" + +LogMessage "Adding execute permissions to bash/main" chmod +x $RECEIVER_BASH_DIRECTORY/main.sh + +LogMessage "Executing bash/main" bash $RECEIVER_BASH_DIRECTORY/main.sh if [[ $? -ne 0 ]] ; then - echo -e "\e[91m ANY FURTHER SETUP AND/OR INSTALLATION REQUESTS HAVE BEEN TERMINIATED\e[39m\n" + LogAlertHeading "ANY FURTHER SETUP AND/OR INSTALLATION REQUESTS HAVE BEEN TERMINIATED" exit 1 fi + ## INSTALLATION COMPLETE -# Display the installation complete message box -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 "\n\e[91m Installation complete.\n" +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 +LogProjectName "Installation complete" exit 0 diff --git a/build/display/current_total-aircraft_with-positions.py b/build/display/current_total-aircraft_with-positions.py deleted file mode 100644 index a4375a11..00000000 --- a/build/display/current_total-aircraft_with-positions.py +++ /dev/null @@ -1,77 +0,0 @@ -##################################################################################### -# ADS-B RECEIVER # -##################################################################################### -# # -# A set of scripts created to automate the process of installing the software # -# needed to setup a Mode S decoder as well as feeders which are capable of # -# sharing your ADS-B results with many of the most popular ADS-B aggregate sites. # -# # -# Project Hosted On GitHub: https://github.com/jprochazka/adsb-receiver # -# # -# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # -# # -# Copyright (c) 2015 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. # -# # -# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # - -import json -import datetime - -from oled.device import ssd1306, sh1106 -from oled.render import canvas -from PIL import ImageDraw, ImageFont -from time import time, sleep - - -with open('/run/dump1090-mutability/aircraft.json') as aircraft_json: - aircraft_data = json.load(aircraft_json) - - -def date_and_time(): - now = datetime.datetime.now() - return now.strftime("%m/%d/%Y %I:%M %p") - -def aircraft_total(): - return len(aircraft_data['aircraft']) - -def aircraft_with_positions(): - with_positions = 0 - for aircraft in aircraft_data['aircraft']: - if 'seen_pos' in aircraft: - with_positions += 1 - return with_positions - - -def stats(oled): - font = ImageFont.load_default() - font2 = ImageFont.truetype('fonts/alert.ttf', 12) - font3 = ImageFont.truetype('fonts/alert.ttf', 36) - with canvas(oled) as draw: - draw.text((0, 0), date_and_time(), font=font2, fill=255) - draw.text((0, 14), "Total / With Positions", font=font2, fill=255) - draw.text((0, 28), str(aircraft_total()) + "/" + str(aircraft_with_positions()), font=font3, fill=255) - -def main(): - oled = ssd1306(port=1, address=0x3C) - stats(oled) - -if __name__ == "__main__": - main() diff --git a/build/display/fonts/alert.ttf b/build/display/fonts/alert.ttf deleted file mode 100644 index f07f9530072a4f4555c99ba0603bf02a21edec1f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 49432 zcmeIbdAwa!efPi4JdgLBd+wOrDG4MYxk<F zc8F8uac-MhTWRWJaVVverHa(H6nU(*HnnP<9<;)FKJV|^>+F4V0C`^e`t|wacapu= z+H0@9)^}dt^<8W4>r&3SmQGpMJny0l&wk&hUh=EDIH=O!e(HtmH(vR%mt5;y>eqCA z`7?Gs<>Je}bM>z{mpf0#LswpZ#s2sHVBfLMO}t;%qgTG*z)a?N*Kuy)B-I~%-u|nv zKk%{bYHRsjYIE<^SKPec^<2rhPZo8*dG&QKdfsc^_Nhx$|03t!dgz*~u7BZai}&2? zTxG3ujTc|D?~1Fwp1$mE^*^QhTdq+-@y6UsbglYs;hO6YyzsbxaI19vuyg4fFaKb}rN1f8)&uu6*r( zOgQ%^`&H+y`)}H}{|jp_{Jff`zhw^E=qNt*4ZnR^>r zbN$iW%hI3Fb;+eE)lbi)ztPW&CV$Ok?q${z+3@>-m3+XR?HW4j(fwt5PIPh^U1w5% znR=7UxorC5>D%?#>wTK~C%4i4ka~$d zF2BpQPbo{?r{gs`guNYKP|87>Qumv2p0e}}y1w7vvwERE?a)SaoxU-;4t2Na*?EYkHy(0}?SrFu3EC)B=!Yrqxi1H-@hGVY}pl&25f4}BR9^nHJ#EPBp;U1i{sI06pV zZUnEj722RK<$^1~X|RbF24{57@J;p^U;>|`>7;u`%dK%6hHKPU`jhJK1h>j?SDj2* z$Fp^OP#Uz;KVxkI6Euq828Y45U@>^PN4u(PG$9pkJa6<4_X8dQ?x;8Y@MNAPygsDo67mx0O{(7qQu=M*y=nLM^LB6F zeco>U&fD%U$m_}{%ADu3zK*U2cl5-0oAmg0tE&8VYmA4_)AQ8Rc~Cv7N9FU*+qHZ5 zdaJTsIr|Oj2_F4)N}ab|KpMExG5}7ws(ZNDcSV=)KPtOW=s)7huBdax&Q(`ZzUIpP zA4&H)H(W*MrmO1QvUA(j`v2udTwUjmYv|my^Qdd~e<&;3(s|6zRjTu=E~H>UHPo#)+n|9`s$H=*+iJFj$;%CB-${qMVD+_cWe z+Ih8Gru-VWy#GD7*3QSd8RgfxS)JG0dC|@Fzw0)*d7U@91)Vq9`FOXY{~fp4t<-so zowvGG%5QVW^uO&+aL4L=qMf(9)ykjb*7X0=oowe*+*;*Nb;s$v!_GV1y8gG^X>PsF zr@KX+ciH(2x1s+{cc$B@^I3L2+ig<*9Cv*G8}3{??{=G&KhJH^`6+H||3BOwJ3rNJ zQ~rE+g3eE~^9An2{@2}wZoAGG+4<@2B;}vsPVWD^d!{=@=Zo#U*PW{Tv)qpU5qF85 zpY3)kf2li7=jYh@GIx6a-`wSHm(EwXGjx8gov(Cf_P^$?a%bth&(6d46Or2lsF7AKXy~NHhb$gY6nR}Mb zFSqk6+$H`0)dmd zf4#d>=U=k(8{Ad>2i+UpKAqp>o~QGh?fe#Zb^o8-FS~1W{uMj_s=HSCx4P%|A8>DT zKcn-n+4ilkZlg__o=l8gq z`+x85a0hh$A9jAPyG8l;xfk@m=-zMV54fLG{)6s?I)BK$sQ-8F!*>2{cdPQh<9=S} z-?j50_u~Hj?)ThFbpD8)f8V`S`H#An^}pc$z`b1OKeY45+$)s7)4j5PpZg;_A9lZ> z{2#kl>HKj!|4;Yo{^#8%+-*AliF=LCciH)q?zR2Txlg%Y)cMnP{*1d_`9F29>;J90 z+s=RHUa$N;?w54_bN7b+z3wmU{Fm;H%Kw#nlg@u_=g+z~_y5NIjeCpE_qt!!`ETv~ zIrl65&$`dMU)A|OJAc8wRr&kf+xma){?5){bibzj-@9Me`5)YG^#98Jqn#gczp4B` zxq~`CXy-4vxA*_jJ>=e@^Z&B*m)$#+|7Z8E{$IGSxOeOPFLwT_`z_`F)xD?x=k9BE z{x^4r@<-hN(D~o({B`%<{ypwL-1~I?hI_xx-?a0$+z0x9=Kj-tQ0H&k`8)1I%752= zxPQ0%o}It%ep~tf?S4n+hu!b?|J41!&OdaAl>aaHdpiHf&X2f{^grVsb-%B3-+feP zC%fz1hfB4b%Vl!eY&Mt6=2A-YmeYlD*=#14$)_@T<A6%Uo66e-ZR&YlXY)B#%V#p#La|uRTSGiZU#g-4)zUAQS5mFkxT9Rk`ctpDViAb4 zSyyg&Sbb;eR85B;Ibcm^@;MJ{&ckXI)IbDlZUAdKlT8m`%_+xYz?v%v)?%qt$?J*- zb%301pnmAub)bV3y%wxY&v>gmGnHY7DODwB^9E}!Uy=Zo%9UEdYJ;&Dz*EH{DNUAiYBt*vG%nL>TZO7v7Bl#{+DO3_ zmcUx{cXTEvSc||~e0*4oOJR+kS9kV24`)2ARi@$^WWK^5tALldqPl>M&oC_-D)I zJh#jGd04BZY`Ihx7fQuUzL3#VG^R@SydExR3#EoQ)@Zi7Rn;z)gmx(-!73Gtl`7R~ zvZmAc_>?f_5?EEJip{o%$aR-jTt%cQmxXa9qdsfO+5d7);1nu_TBcAd*TA(Zk;+vo z;+rbyCp)8Gt(>!~Vx^K1?`n3THhEs)7i*PVvD^@4n(a=nrrPClPDe)Q=~u6bG-N9c zwL3MnTqKpqN$`Y+YL+YQ4&ao_Zfv3Is>Mo49aKw|Y`IcuRH|I)Xy_=^ij8csQE8N9 zUFsE4r&cX+pP%$fzeXirRee2Pk-5)C&#RK2uZoF{YQ9uy3#pNAZ=#{v6&WGbrPFFv z1?8&9RH?M|$jr=w1VV^bvT9p}s@UxrG!-{_Ox@Ls>Zw-MDO;{pTFTk~TB}wQq{UXY z*s8SzX0cv_lhvZiBUsg%9?093I?fg=*_K^Yi&dTn)>buNskMvcVz)Ow-Ll&Ge65zP zRcJ;9+O8MuN?qqlm0a5{YNZ;_BRcI`p;GUbD#hOT zoP+1dakZc>va`WYW1S3cGd36m1`=+TwS@G+ODZ)y*54xIQ6=lS!}vyxlyY( zn$21>S8voh$~BrA>>8a$qfu^`I=OPE(Wyy#+7hW^Th;YzwwlcX6xIWUCXdvbja<2w z>+o!|S+?h!61YyYSZj=xtL5>jW%Hd*qu7w}HX6A`P0iF*pa<1tv!~PQ)r%5uE^}&I zEy)T@E(4-Q!_97JxmKBenk^4&S5W9euy%En+m&vv+--Dg#cFk=Ax^eiz}n&`z0$AS zEVlHF9&Z9G&o`TDv(arfTGd>&+w!nhC#IG!bi0jWvso-Qn!u`xDyX*_5?h0H?b;2s zY7$meoLb%xM1pn2))6;S6^~nDMmyhV)qBd>|5i`nR65mOzS?W`>ZPiBl^yD|D=KgE zDAG%hq}l0=j5J3I%}#SdIs4z4=yW=@UTvaK zo9Ik5%hhVHBRkX^si}N~U%4#8=z+3bHAhAYwPs<$E=Fo2JU>z`R3}Et&Caq~qdL2= zYTbltcRFPqg^oJybX3qB=~Pv9ncCg9?UZJ<&{3|SwntR6GqSJ>a5^2gZdcFs>Z9$^ z?r5()S{NB^PmlISM@M_z(a~ug_3_4Zp*}r2-L43#QR&{es_Q;K>6L!dqm`bX(c`0q zdb`GIQ~gvh(i?3mH={>RK6zKWSr}EW zpte=0imTRifoRliJa^oUH^(|-y)m7NonB}8*ccbRvEFhW&B^BSVsm+Kd8gWJPW7tI z>f~5cV5-vCSXJcc=z*$Tb;ibu%}$Z$^=s;RHPY0>W7SS?q1kS(TC;x3^5s3%7K_G; zy$-FYK%J|}v3Z?NJMCPlB9}$AJ=W`~;+pk<)9bk{=TExH)_8YZzwUUkGv1veYd>pv^hA+P$Hr&p#=B$VO|`H>kDPt>`BGJSD5`B0s^Yp$*8I3T@fp)@x;@pKoSd5O zO_jzbdkd4(Q@WU(np~KioNUju7fS7g$%S6MGcr3Vn>jPxR{7Mle$p%b7AEV{s;|eV zO6^{0foG@GCeKfgltvb&>%GaUA=tu zgfwAcd9&MGvAk<{mn~l|3D$4*@}?E2jdFLQ96hf}`^J@SWp93Zetv#odcL}BetP}< z0v9^g>*yUjw!Ye1KfivuJvO#_zSV0VyU^o4zg8RSuAgr$sJlfP7^ILioV<+xB^Mdv3=iBo#LaIxr3kxckUYH+KlbiL(l~>(3JyxApuBx_G*qWc; zai&3|1p|eO{gHWrU(0Y)woXE1JD)nNdo%8fDw%Whif68HD;2{$MzPD)idn98$0<&^ z-YqINxlu96;}whC;x$1d z6_;%*9@|kIc2seIF*mN5>!hHVR*ZGIdOuB()zcM=JVPEHoVvJ8! zZ1HLC0>u+Aa!*$b@tKMp?p4h268CJy37_LGQ*7`G;qV?E{&$DsQU3SdD1E%-eS;hC zSKRQ`is#*`*xk=6?&cJ+dzrglak7^x|89%RzshRA*u8e}lv9-Lb-Ma3Ma@u5rmnxkr%I8G!8Kq~59+wH;-*F#P)ax^fXWc8lKAvH6jEG<9L>iqs2J zFHOBAeRukSna<3_%(9uenUyn(Gbhe`cy_MeSDQ29#!hkJIil>l+#yBTd|USq+WNk= zbwTQKwe^yyt&y3rnW>o>YwLtTTPdybeOkvqgHZo(`(Nt+qvB+)|L6Tr>EFkd`*8p5 z{qg?hN7eJApL^szkGzGN{2toz(1{OS{-rl}p72@ZwNDf}@UZvRVYa|P=m1Mk4G0!(k z9^NM|zFjflUog(X)hms^`y@%%NQVA@{y_Erclo0bvRk|RPFFhr;@?Z9-mv%1RR7g? zx?R(MBpa5w>^aBX=~8QFX3n^F*P+zqx=628!RlG%GHYkfJd{~+<^>ne@141Q=Js>0 zx_#!%nQN}N>QHutrMj{2_Py(84!H|2zET4 z?&yLYQGqC-HbjXt?o7S>d^M(Ies+?A`Pund!MS&r`Yx^Aec{Dt2+~;~Ek7~ID+5GS zw<_=}M)KNEiRASsL-NLxB6)KF=@OE+1alLTxBnYSKC*=5ohK%FcYuhX9u@dqBYE$q zMDnpGL-O$_Me>OOq)SLXDVQf9`P6?S$)^(}m)X11b=FAO*SN!MOK~k-q`YRz>a0

jJ#y5gQG61mox7Vd-TBRX z;DhLOWY3->#*c%0_=zujM8EWah9mN#zv}6impcR9@@l-RPU<=U7C-?CV7M0~1p0M# z4ZT1J1ZqkFtf3V8P=8dZ(FaZ&eVUM?nV?Uag0!cP)yPwjr{J)}H*0V;)fO<(K0E-n zBB{zD8h|MpVV0-CDJk_l8>aGRW$b+ai8?qJ2mb^h4ceEGg@;`yVRu~ zl}rRx&fmz{4YUtX^GeYg=!N(qMWk?!`=9`Q03E3TbgsM5hxs42p%~c+L;^a2E8tiM zN}&NAa9vg!XhGV3!0SpXp(WCrO=ya#336cUw+xyB84@&YOUF>8eg0yi+j zC*Z^uP>wC&IbC;<|)U*ag7z@8Y{;0qXP?C1T8Im4*1-rpq(gaQP6VvL5)Z> zYz#We#(F5yf)<04Rc~RSLE0)R0~(;kz_gWbsto8bK0t?!4|diDqsY!;WT0a~)nS6Ynjl!bQ1kWObVxCp0QB5#0Vsl($f*KQv z8bkUW4Yo!l*a@2hD-lqDMH>RENyA_Ta@bT@O}#OtAV{4_Y03(e#QT6^ba&H;^72DA z6?8T$iq2p_jO|Jvy;Y`9$vp_ekp$n-rxEud&!3Eq_>BD66)*dFbqjq_SU|!PKnfW@ zxJGA?#*qQNBh`;}qz0{O33_KJ$Rym31_cdo3#-x|+{vQs2|xscYzmK+NFt8K5Gf+r zHk>0XpW61wgL~ME8~a=Zb@69lDhy=dAb!TIyp5;Yy~=nh)KGc2l~V!)SCauA^Fk~;1)_^{+eS@L;UT-7eGNubNi;cv5(FJ6#DXohNC_8%B>WTuQ zfkwEx=$Pzt4+1-1fOf}mpt}$u+{;xbu~(7C0*n0LKTn>$kRDEHU>CF16R!7 z2uX7qnYq9E6ii$GjG#>*(O=3JsLptv$+(bl-YfE z1RRi2Kily1mi(y$ToSHRN=KB^87X5IwgOFFTg5bhf zKqJb5mvZ3bI`|dvlkzYl!<=)?SjF?x1DX!a&|>lO9xl4Ygbcq4vd|S`Y$JwJkm)wP zO#xhNi5Dj?l603>J;(|8fC0+^7lNP$%yN240h4q>*9^IgJR^)Zm|RI?&dz?`i=;-g zIq|{#dI{z>rZ#4r&8e_H4ETqW>xqSb z>wVk=%-+&{*3%{{BM8%h4TEa-MS0okU{qAUo$*%)0TPD5T2!M9Pym|@{!tF0061ohfYWs_6aWPx6C&ga zR8LB1f~0&(&Nt?8M8%ju`)N2ZcffQnb(>tFh`Q-HX<}krHLIu<-1*cYPv2mt>7F^D zIVVbyJIdfQG=$I0v5+n7cwH$nia|myp((NfYJd)EpolS|ysMOQY+^u_c0m=H!8X$V zlv3_bE9L$&rS!L4DecTCrQcbl^gE}NcIOBD8}e6%{Qro>@yyF1Qi84N=&%{Ry6>nq7}Tq}hom3{=n5#t{^^iyicC>V zrX_=?U_eJOK|yLsv5)8`_Al6P=6Uqph*Dsq4*Cqa>dFTx1}0#`XWiPJ?appqv3Yj$ zY!~tofq;~91~etv#thVqlE{iIlGwEcBYccY4xFM=Pw}+OL=y`7z>n9C2qEy8F}Ec# zCsj8;L1{)YiV;~z*~yl|9{7hcg6bsllkd~Jn?3gp-(OkG3=cnn>_tLU+m z__UQkh7Pfb^^-jsxtIddxfq6LH$}gJZc*GZ^0+iOO7;kH3IltDQxr2TxHCM&1QOve zkU~MEIyaE2p-5&j+Le!D*;rV0q2&shPxYi2gVq3{3;w1Sn}{)36jk#KBqXJN!i?KX za=>6{hM9~U!!U@N)8lz5m&W+*n0NXXbu`O~;u{ugn{>-l%Y5H6%x`qeB>JWitjm-d zWQ;0 zaM-q=!80tS6I{>~EyyU37J@@tWk@$E-UD?RQ?ZPl$*3` za(ntmp5sT46RU*x3LO@QQp(^1N03mwJhad3u~Ik<$GHzpzy(gPPztB1k0etLjktzJ zTtg%3L8FdRXtYWx5&_Mi6Df3}KfFcyn^#Kx1*Mc9qm=Svl~RATQp(pVrTjRh@MfJ- ztiYmD;N2Ld$14S{ElPoFt5V?DrW8J%pp28tghWBKAQMOIj-$qL-mVm)u>f0vJ+aA|AP3XHF}wh%jwdj#az@r;m0~-g zSXc~hs2qb0N3o@F63TUz(jFXz18|gf;2_V#!GcmaNPXr2)Q6LKrOW{+hoe2ENIzVq z4qQe5;VNycP|7nal`beq-EWfQartB#dNnSU8S;&QtnfRPI{fQnW@F6~a_!Of1HKow9t`s^a`3U~l zV(zzV{avm06x{*ktJcwLb%`oW(JOfQ- zpv15S3UpCb3QC|tiU?Ak1Ran79dThY0;q^&Kn2kR6+|6ToW{5g2FcBEnZZ+O&+}X! zkl3ODlAm!Z3O_JV`oU6uTWXtATuxrm*+NAlB(5Ce2;By*z!AXB4=5FTMLgk`6sVE4 zF3N4yB}b84Qpog>Rnb7+&j2F*w1vFqOpo(j`LK z61TP*w>*z*_S!X1aljtqk>{6C{%@oiw1H+Nr9tZ+pJqeOWxNIx$HY-oJY{C{(1~F< zt1bd9=@L3(yfKJq24Tr$JR2j1@q%Fd-nw9}rTXjVAtX`C9nlP&5p-3u0%;vpHL7=IWIXTt{6Tm1# zSr}zlCuclHjmMP6YYWjp7+aqqa}@cE@#q>+S_NUFg|{D28p%W_A;Q$7Uh; z*ew`M9c)*SUWO_F=NW7e&tOiGXm5jv?4#v=yup#PVMZq;+g1p@jWG)}7#GAfjUKkZ zjiJ#5O}whO=fbDhI|sD9y7NLI-DE?i>F1Ew98J4pl0-9ED*$a!E+a_TN6eA{HGk9Z zWs@m{k=iHv5xsG6P*J1B0E>_7gL-OUA0oRqSV71!;k0I@yo0v%J&+@^s~OjzE$!2y z2lfw*sQV+j#q1aSMFIWGxCP%QTRr1-mI&9u+!@iA*=A0uueYfI;v#SGYxh_`vUpq9U=4j>CS3362=fJUSqsKtzF(o+8{t$Psox z0ToCNn2;K!12hB&hnO^2U98P)Hv@A;$AVJjHm%a(efA>?pbjKEb)WLcJVq{#hY#k? zsc4@fFAllxM@eGk6!fz{qou(x`t|O%bZ84*!6q*J@X0+6OSdT~m7DffuLvz4G1Pn|) z2UxHku)=W7q=EJIR781GFHzklPvQwuja_GDU9nL_+o=EOJrN6FPr}Z4Kloq0Y-eqF z@G2kHg+Tx-0&)lt^lmBza1cP2F%i%gnMG)@*zub2(B7t@klxU)xyY5XAqT~QqA(Il z(|HgGh7o{3stq`$a0F@s7<~=Q#A9V$7S83kslgB(U3G%oF zc+9_v@Ixbk1!@MEU_Mhkm`)iA08=rm+{5~Fjafy;;#ts;)rzgZmj@I-3{qHo<~Z0X zLwRHhgdr*7&2xapbAX2UGcd8A!{#{>x2=*s#10~F5RnO? zA!a6boMiEBKa~i7Q2U%1b@A2X_eH`gbj4F0%`K=CCO1ozbqUp>I3@)ZL8_1d##}5I zXd!WEZm?)vqhizrO|Aoqu?7##*<&gnmX7!ri_lIe4P)t&F&2u4Q2{MxM1abG#qa|{ zbcs=+91sByW&;i>K21ky{PK~=Dxa{R5d!M!!c!LF@?$JzAx}eu_Cr8viL%8PHG}kX zpdHXOOtd^BgIvZ@tE96Q_D#TYHp!zm1Q?iL$$Y>$>w|fr`oMNvnrboL~^6uk=s246)n2~0h$8@ zFa-IaT_8c!fdq(P9j7WGgQ+Che>hsIJb_Sc5Cq7Atf z(eMzPxp;LsW*OuRx*QMycz`kKQ(D$Fy2;o8faoj;wN-}W)Kh8;JWA2yrqZCt=&#pc z>9UxO55n}YAZhbXh~&&N(L7PoXU;RHNZuqET1RHieGHrkQNwsOH4b<|bK|c@cvih_ zYlXH~SewX}w+rw$SYwM;#ep2u$ha!RkQS~X1cZVR^uQPcv69?{Tfs75@UR4Mm*;HY zRSNNV9`5pdun-WGa)?KN!8?cR)Qh=3WT#^yNMMMi4!N6=+hFrUeG%G3n9dO2U?)J- zBH-!}(QfE|M){)Bqyea9G)#a{WGGHn+HZar#Hr?p2aLwsM;=$q^Q8XLd$9S80YC&aK*~M1 z8mtFgqYTwVu7Q$kpoHp7Hf_S>Nz7{jHt=bdU_VdP*a&L0Q*3&$E*N=Me10H!Jx(n{ zkMv+h7|(3tH$8!m5pcw~?3ZoCQ>nf8-BPz{EG5bp&F*;vrmmKmnSnEsll8L^1xW1O zFPo+bw&(>Act$89@D7;Z71vOR6l%c3_`R5+aVhDdl_E4@GYo)`0K?=CglIlA4X}tj zgvYMZ6+pArrblvVFt5m2o4j1gfmuh9Y=14oREkJ=5w^8t)q|)H1m2K zvchNhm{A^67J@~Tpru!9dI&E~qadIONofk#0F4HH&)vlhCo8OL zii&jGAS4_?+4K}XnqL_4FwDtb4c2_%z^|InAR+{x=$sV%NWll(8Ur6-XeA+zy~Ycn zNFA`kGH{^_$bov1-5%g6?`3fUlEpl!1;lD^gedI-fKuKwAS1ayy9_ORK_XDSL!r6?x^7M_!(0BZ9 zS#oSPr5f_s;@E=PVEPl8A~UWK4vPbVyl6ISFU7@X6kCC)nGp@PVz4jzSwJ59z(9sw z0MdA0^pFQK1acBWILclfy-;CtZ$g7ZU_O*$9$~L^#r>@BJvsiHdZ`6u1SkfYt7~j_ zWgz8IpRu;agA$H{52Wx&L61VE5)MOaew=_N%#{$c&z!fViTs!}hnQ|Wcm6LA<4@yT z6L?MFl$eNR)Cwz1*mRTqVi;-OrWQa8lQyB=wb}=GROvERA z(_%=|tROa}BBNRlWJXTWZALomOc=~#b@U%<=t4ZE9cDsNOsR&=MPgsg@O=T;>X7{i zz8XVJ(xxoMJVcC!u#9ON2~*O1psnEG;UAa}&7g2O;AsS-Ob50eUvl7s{l15hy$s-t zegD7rz!;0+8v+U6hW0VU{EA+A8aS1VRREvYqlf_VP7@##+ztR^-1agbdsl4ZAl4o{ zD@h#Qrv97%5shgz_g0VNPvyG_F(#3M$K%%$^%Y9+8q`1s)rIeOW8D}@hSBf!uP%K~VOCK&U0hB7q!Os>3y z54-q&rDl56{6BS@S5pWVU2-4&p(`_JN-?SE5g?#*fWXv0x$Bfb^oWi~i?AA+jhcVU zD8T^XeWqw%(9O`we|j)E_xJu_uw{|yipPneZHhzh@5b?ej{{@{ucF|!aDja@U{mzn z7`!4M3Bt5R^C;Oj)?{w*+(bW^bG2#Zq7o=3dspT3c5;P7s$%9IZxMW24W^!?I5;-z&n{xJdB zgu_PkE)poem=Z0gX(LRu2g!Vec;Dhfo<_;<#o%9>NGOGa&;$(w2H=6ifgTNAGjsqO zatVE)De!?yOrIgH4+RT`t)4pcGh@njs2zKvpE0kF~hu$GK`IKRZa_`ih^5J2<6t6nc)ds&kzeW&`Q`cKx)Ar{cPTu#hzbJ-@p-sGbQtNKQ3_XP zmBQ7z!AxN&96CpUJNdR-QhJRU$u|;d90J(3AT^HVWR=i}qdWnWq-Y~DAP+Jy3}yzV zA!c~nAdL!uG{}H-Pbpz<5Qac32G9lw(A+0xow!A`MJE`$M?@(fB4KIHX49I7X3jgoPeMVju(}JG=PFMfP*y1 zA+6Lyf2h|UaArtvhTdV1CO)x?k+koq2$TXKC<})G0sul(71cqEFg$b)P(g`puas2B z+ZkxLsmt;Jew4Q`=2S85mm?wqF0sQ#qtpmA@?$<4TG7Z*dthflf7!F9H%V$5^YtCg zOI2`4nY(n{>kF{wHS-1(h^Bg0)w8Oux2o9!#44`#0`Xi{&t>%-cVc8&k*NtGEI9}U z>lFI~kyHl?#t+_T4o;aivHVou;|XH`ijMdo z9-u_|Fja>>`8ZKIyV|Zr77pG# zkAKjSl}_)s3}QObmzDgC+jj+H=_=l@G8Eg5O`zYf!X6~+N^*}6ZhH!hKOz49gP21I z43RDyv((Q|!Xe;fB9|l)%1e22Y=NA}KJ^e@8&d{;Smd$9o?|@T#v3UxQpP1c4hqOJ zHiRH01`9iaj9XVq(E}p%VKo}31S9KT1&A2Kt3&M4((YVL2Eq;PG$|X*n@8MT(2lXz zzpKFbhlr4-)e$%ao&gxw7&KO15gV*5Gywsu4r13F;2zJ@;%~13I`$gbrYBm>>oCtYR>@I!S%ME+f z;3rYjB|8ICeqqkP0TFyjd^Oku74R;SR0v}Z<-p4|aB|IH%QXWoY>fA*MFJm7NEGdl z&1D>JIIPzNd_WOeKtII8{7AJ6EN}sA;8dU^Gy@K}I;!AfN)a@fMGZ1K6QLCiiIMtg zy9mY#p62d;9~uUed4Oa`@wA`XJ48M%Kzx&E{ky#!YK!w=ghwIJKQIikheCiESW?c8 z08*$8m0N=meQ3v46fn~O9Y?<51ARu2vpUN*Bm0hE1rBLy(&XLmVM9pU?vNK*UP(q zD{2<~*P)G#ui=061Lsu|+?K_F!P&lyvNUQNEZmbCl@7~_`gdTE4nTlhOq}s?8Ld#O zPx~Q@F-sy5?}LlxgsI~_<&$q;$=np=T&48dWy*a^hukkVNTxIo(pz(v?yR{T%ABv` zavl41yj;hdbmVR4fG3b*IXsotQ~Ihtj@!M;Jf!1WI@Bi3q}5DX&7{>#TFs=@Oxl{k z)?!c4GU$SxM$AAmEE-d%t}-Myj*<>d#h+kkS9|IM;vu?dIW`qlM4Yj$Xf^#oWN*h} z0vDqFhDPL1hiRp!wGDLAKWQK9J8=BNp4QlRdh~C)DOJmg663)U5!1JTad!_X<3nS1 zC#5?^eC|BmjX7JTV}*_lI*iBUb?<0C z11J0kHsFFsT;ojA7UKyXKV!-&r5&a4k1>w>OeVR{WRh|wlhk7(*-^?wl5!@J)SppG z{aK}qQFBVUe~eP@uU5+aHA;bFtx~9doKoa+ol@XjuM~M%RJuaxMx_f%H$~USN7tK` zg7+4s)ZeO<_O>ady%Usj|3szS->#H?Pf|)hCo8QeJw+)xaB6hDQ}m(yw5a@arL?y2e#CJ)CmWYOSAP;>@XOT7*6Z`4Tpx}%|LF{V_ zK?a*yYRvi_cUBO6%4Eq*EiLd(JP;%0VG-iBp!_Nw8+0%%fI6`WP)CHyIzS(F9#=Y; zFscr1upG%yf;gd^1ZHRhvC1j!DQzl6yogO8PCS>4N5BrmX$n ze}~fTN_Q$nOt^Qt(&LmOCiIDT>{5CbaTQsE;NWWBWm)!}hH)mNyvBNa8JKw)t4XbB z4B8r{)L~IsKZ_t(juZZ#`N%%TpbN`{JGw9ngd3;~&IC(_J|?V6Q9b!O{JlSysmU&_ z)F)A$tZq5=g+ckVWQ$kY-`vv|IP{)DG>6N4&+K#0Vt#M-7At&!#9OYz@)?$X2@mpM zeb6$*1$HAQj24IqB%YBtE!V*w+8JFVDu^3ahx=HWp3*s`gt6uaS~%p1M?s%hEu$@} zalz1_H}p#Q&{z70f_}+ByeVCz>#E(Ae^+Ez|ZSw>wpw!B}S7$6H=fpxXYkg zQJ#B{iWHKJC`E%H3w6*MNW*$+0N>8B9B4(!5+ zF?SsiWj$4;&{9(TS3h@UuVFOoN5qx$VQ;cO<~J8oTJPeMgDAAB`MO#k-zI0KA^7+{ zga7ct;s##Fw9O`ZSJ&F)3l*w2_&x(Wy^dPWm8`Ak?z$QRvC=8&2;V=(BpO6DHL3@u?JY$}95V|t^ zGuo_5QpO{wJ;g^;AYh92fS>Vj(8i)~!&^sBocMbkNemz*eDc5vECWgGKqziYf5QCX zmSP|JPNTjY_)gz$O>+fiq^5B&LkIbcP-gHBS_gw537jNlP!HONF7VPDGEY9pIfFTM z8MJ8&pAf0QC*)a75#^X7$}vau&7cnFmMf(_%oFX*D&@I&RV9hP>2LI6L2RUZcs0F* z-xKerWZ~D(<^ZCg#z})&0YOG_6uhAnFNc%`OMoE^Mv5s4h+=zDdWIm7# zL6$lo3!)Rs2m9Mro}tM;Ea*pki@0WN&*tz)ZEc8_k zl!uQ1%P<0v0N7O?fwjLr5G`-o;27C&Vne)ZCkjVIj#2_bdmcFrzlnQVxbeOcG4ga? zOMm7I5i62kRPlP5ir$g)Z&HGge^nK!$BvPf1q{@yC;0VZa z4`gWrr-3#=II9$-c?N{32g0dd0w zNnv3FmMcw0&s>}Gz`x2@l_ue^J+Et?v~buM#Q}}DZk<- zmcd2u@&PSmZ#@ z7i815KB%4Ba?7-}g~fD*H{{NzUL|nQXaAk4uqM)T|0yZaC^%xaosl^vI_B%KJS#*# zFNjHD0FXm?2yVnzinMSaGl%rVdqpFuh|O+nhvOG!FcI(^D~nbdp_I}^K`BEE_s~>? z6oCc=1QCtp9)iqs@EvUiBzw=g%UH~&=}q=gB(bxb(ScWF%(NBe)P2h9zs+RC%iuHl z7@dEw%3H+KJq43~DgFbNnS7;_9L*;5`~g9b(iV}mFkt*exSMo}qfa33_FB>Koa z1$0OmO=%aArZ4o7_G3#K4P!CIqsd2HFcdY2Po zzs0{l{53eD#udqf1A})k^k=(Rqt3W5h0H@C)3l7|nh6h!I$zR?gVk?@%tIm5w2T)- zsE(zD5Evq!4;GdopKAyJH{IE zpqrLy7*_mup_%r-Bdz(tZ>E?e=zABMyUSI4^j4irqJ^sW$^AFL6%>YA$!~xot0Bry z-^gRpF{WiIo#M^zGd&#$p?+1q13RP^5hc)tcl19-RL1to&k;FF+s`Il}BR^Si5^Sov6QWxMUO@6Gytof!6JAw5Z2pR zUmody|=XP?kUntDYmmhm9`c<%Bbs2(g4bfQwQxT-R& zA}K50IJ7{HHxWbvRSF-S!Rue9YrK_Lxwr^kM8P|>BV{_49o%1dW#d4UHBY?m}c z9}a_{;zc-(Fn9<@A_HquY-`$*-LTfzNM*d-v9b#Hqra}nD&Lb>%kvU%D}M!vn7&fw z*986F-9(B24xXUxs3+H$Iiw_xI!3GbvGxyn`9u3~qe-oa4UJ=KVX$p`Rf?Sm<_Wuj zfN%{k*k}ZPeG2 z?lGBj>HV66;UC%?pJB})d}Ahdb1|U7kfJ>dR%j1IjQ1)IMIVx2B{8vJLo50!N?mQ( z;HdVX3yh$z6lv4bgHahK0Y}hY#u3}7=wFtETL}GZPClQ-4#1YkuBM;SpXoDa?_h`{ zNbbeIjWPek!Mv@tL~}xoh4D!EhzVR)Y%mwJUaEVgTI;8WQAa4#gE7F z$b^~VduP%tEqm#h+=e}|ip>1zyB5L^Hr8}>z13*$h_)GtMP9H#WhetH!e0ZdBF>^pa1?TLAChxTpc<7T581f~*J%s? zHm4MI;y(Tn<#-d6<4sT={G=IO^Zcw*>dh&o-n>%gTnkDmU#XPxRfAc|5VfO8NlgBD zZvyK}%pc=5L&OSS9y%nsi^+fvlp|_zy{vRrsaY^RgV_LXU!w&)M3*Ew9H9 zdpO)a=f?(oFMJ}Dfv}{>|59JvR(ev=SN)!hVwAG24g!+)lL5#ndpw=HTxWdC?3X)2b7Aj(k5JfANyxFMMaU zVpM4eYauIOmGqp`-T5R7!~2KE6|rQ%J9`h&d(P271KS4Q#yNubEW7Ze*I{M(Sche; z@&AjzZ{p*l@%IQOQ@g!Ak|tVo0v@1)g!6G$GrBH_R+#f3QRpDLfeun1z92D}ed@y( z>LXc5B6>%CCb`sSIHw-rM(Tz68j?r7I5s-8bz^8_MzrTD9>2XR$4LiY(fmny13K^qT>#{tj3-~%@(E(0I5 zN8m`|(WKJ+yEvpz^QZM)(Ayfd8FUgQ(&m*sWb=<`Z7sHt z@oN@QjmXiq_yU58Ho`$$y-{jCm_U!Z~|<$POKbCT^UCq{r@Q z#5;w3^+6manm)!`KDZVlmFWi z_FDF%-}IkoVPB54&f{Wy-fwfyH+oL<#yy-y{r_({4G`!W5`eA&y!W~lD-noBB>$JZ z*@GT`pcf*6VZemHDWnwyvC)Ls*vS`Q150C`N@hLpG8LPj;8wAB@AHADnM*V#t#tUV z?A>GD64uG~`+Wn7^eN)fkuS!VX?l`&;3o29Uusku{IZO|2!4R1Lk1a> zj_5(u4aUI)?$Z$sGRTZ5rK6rwI-(v99(H7z=&f(zp*i7g8gt?ZpY>$F*`LWI#k+2P ze#xwb$hB>z@@8CTBx|Yv=I!|>p|AiFQrHMqbe4W*Ok~Dj41HA_@S(ejhbnOmniZwc zoondLHT0$)^oE{VYhgZDGrF-90sW8==*NR-66OVvxQ4M@(=c?QK};UeY3Rc|Y4BHD zL=)!WMi;&oXj30iNJQa-n2Pb~ZE@R5C?Qp+3A)7Z)xXix#r|f3XaZB5I>l7tg)j(U z^TJ>NaKY|D1g8qY@(r zLu0!z5^lzEzXas{K=2CsXLC!HRq9GkN(30Ut63c_9o7a=S@su0U3^_?T zlo!g82Ff9VT9y)g2v7cCd(VENGe0%LXjyvhN8`f3V zy?*`L^%tzaYq7d`+u}VNUcTY$$8S4+*YW3X-n0407PqCdW#g6uTkhKO<*mhS&269E zcK-< zxbyCv_wRi0w3nXtnbZF2w1-ZAbk`SmegBNrXFPo7C(c@X*0!^Dops(>A31yU?76eo zo&DfB&p+q>b8p)1c3&)7Hr?G8ae}UxP@+$qJG%1uwCwqFqkKl@=GrKqRh^eb`J5Yb zzZ~WBlB5qs`J$x%q`-JeGJlshJMMU+pwdg>RWe8#O!y)DXTRp--DUVn`) z_3u$$JL1xlQNHNf>61@idHT!+`>vYVdELI74$Pc$!-0J_-LUV#%$YadaA4-joAzCC zK=+>eqM1FL4qR}{4L5AMY37oB*I#k%btlFpJFdC$07dJr+IQ*F)-E|`&lwk8dcnS{ zZ@KP@n>MUlTwL6~|3x?5yj``_rS>n2~F|&t0W-r@KzMo7@5A&v7>>KXk|0*N|o+&SJ-`?d#-zt z&U>_6b3kp~qFOg7f0N2CQN8O`^IElh;$zm?;jU4;2L`p)36g#8(kF!N5<#~|FAQCz zdcc0Q`n*oP+~hXs-K0hPw_R@#zDOlE%fa_}dMslcp9uS8524MChRm`STrAvSo-^bR75XMN(xu$FGa6*3vPwjcZ}Y# zTdS_u>2Gi^3jK{D{PFsu&s+5OxVPzVJ)bD_PjV-_Q}hPj4p}k$a~xu{gl!#o5WLia zAJvxU%myG0@6xStH=&vBl)eeSOnb6t^!C-9o0o{3F0cCx3By_LY_Z{7x7(fPo+5TU zRj+P7P3*W(YyA9AmBpK@Q6B{<}M z&%NILz59Ll5%(JR2kxWpW9|>#SKS}G_qbQNSG)h|-s*01Z*Z@3x4RFxJKVoY>wm$0 z+kMBq&ArzBr+bI{p!=TtuKT|GExk$lHTU*Z)_ukOODgAn$$i58iTj3ovwOEzcK^-& zhh8RqmxT3diQIMW#qJfkbvN8{-F4YBZn^2k!YwykySTV>SAGA!o36d_sw?-Q()+G5 Q7Vvk^cx^SMIZ5XK01CMO)Bpeg From 9b474c19393bb029a627de5ac031d5a4815f46f2 Mon Sep 17 00:00:00 2001 From: jprochazka Date: Mon, 22 Jul 2024 02:52:36 -0400 Subject: [PATCH 17/26] A handful of fixes. --- bash/decoders/dump1090-fa.sh | 2 +- bash/extras/beastsplitter.sh | 2 +- bash/extras/duckdns.sh | 2 +- bash/feeders/adsbexchange.sh | 2 +- bash/feeders/airplaneslive.sh | 2 +- bash/feeders/flightradar24.sh | 2 +- bash/feeders/flyitalyadsb.sh | 2 +- bash/feeders/openskynetwork.sh | 2 +- bash/feeders/piaware.sh | 2 +- bash/feeders/planefinder.sh | 2 +- bash/init.sh | 8 ++++++-- bash/main.sh | 6 +++--- 12 files changed, 19 insertions(+), 15 deletions(-) diff --git a/bash/decoders/dump1090-fa.sh b/bash/decoders/dump1090-fa.sh index 7febee41..54299deb 100755 --- a/bash/decoders/dump1090-fa.sh +++ b/bash/decoders/dump1090-fa.sh @@ -9,7 +9,7 @@ source $RECEIVER_BASH_DIRECTORY/functions.sh ## BEGIN SETUP clear -LogProjectName ${RECEIVER_PROJECT_TITLE} +LogProjectTitle LogTitleHeading "Setting up the FlightAware Dump1090 decoder" LogTitleMessage "------------------------------------------------------------------------------" echo "" diff --git a/bash/extras/beastsplitter.sh b/bash/extras/beastsplitter.sh index 19baceb5..cc2a9e7b 100755 --- a/bash/extras/beastsplitter.sh +++ b/bash/extras/beastsplitter.sh @@ -6,7 +6,7 @@ source $RECEIVER_BASH_DIRECTORY/variables.sh source $RECEIVER_BASH_DIRECTORY/functions.sh clear -LogProjectName ${RECEIVER_PROJECT_TITLE} +LogProjectTitle LogTitleHeading "Setting up beast-splitter" LogTitleMessage "------------------------------------------------------------------------------" echo "" diff --git a/bash/extras/duckdns.sh b/bash/extras/duckdns.sh index 96bc6024..5f1329d4 100755 --- a/bash/extras/duckdns.sh +++ b/bash/extras/duckdns.sh @@ -6,7 +6,7 @@ source $RECEIVER_BASH_DIRECTORY/variables.sh source $RECEIVER_BASH_DIRECTORY/functions.sh clear -LogProjectName ${RECEIVER_PROJECT_TITLE} +LogProjectTitle LogTitleHeading "Setting up Duck DNS" LogTitleMessage "------------------------------------------------------------------------------" echo "" diff --git a/bash/feeders/adsbexchange.sh b/bash/feeders/adsbexchange.sh index 7bae5407..746d7f08 100755 --- a/bash/feeders/adsbexchange.sh +++ b/bash/feeders/adsbexchange.sh @@ -6,7 +6,7 @@ source $RECEIVER_BASH_DIRECTORY/variables.sh source $RECEIVER_BASH_DIRECTORY/functions.sh clear -LogProjectName ${RECEIVER_PROJECT_TITLE} +LogProjectTitle LogTitleHeading "Setting up the ADS-B Exchange client" LogTitleMessage "------------------------------------------------------------------------------" echo "" diff --git a/bash/feeders/airplaneslive.sh b/bash/feeders/airplaneslive.sh index b6d8293d..fddb4d33 100755 --- a/bash/feeders/airplaneslive.sh +++ b/bash/feeders/airplaneslive.sh @@ -6,7 +6,7 @@ source $RECEIVER_BASH_DIRECTORY/variables.sh source $RECEIVER_BASH_DIRECTORY/functions.sh clear -LogProjectName ${RECEIVER_PROJECT_TITLE} +LogProjectTitle LogTitleHeading "Setting up the Airplanes.live client" LogTitleMessage "------------------------------------------------------------------------------" echo "" diff --git a/bash/feeders/flightradar24.sh b/bash/feeders/flightradar24.sh index dff479b8..e23c11af 100755 --- a/bash/feeders/flightradar24.sh +++ b/bash/feeders/flightradar24.sh @@ -6,7 +6,7 @@ source $RECEIVER_BASH_DIRECTORY/variables.sh source $RECEIVER_BASH_DIRECTORY/functions.sh clear -LogProjectName ${RECEIVER_PROJECT_TITLE} +LogProjectTitle LogTitleHeading "Setting up the FlightRadar24 client" LogTitleMessage "------------------------------------------------------------------------------" echo "" diff --git a/bash/feeders/flyitalyadsb.sh b/bash/feeders/flyitalyadsb.sh index 5530f92c..200fdfc9 100755 --- a/bash/feeders/flyitalyadsb.sh +++ b/bash/feeders/flyitalyadsb.sh @@ -6,7 +6,7 @@ source $RECEIVER_BASH_DIRECTORY/variables.sh source $RECEIVER_BASH_DIRECTORY/functions.sh clear -LogProjectName ${RECEIVER_PROJECT_TITLE} +LogProjectTitle LogTitleHeading "Setting up the Fly Italy ADS-B client" LogTitleMessage "------------------------------------------------------------------------------" echo "" diff --git a/bash/feeders/openskynetwork.sh b/bash/feeders/openskynetwork.sh index 293f7683..1cd585d3 100755 --- a/bash/feeders/openskynetwork.sh +++ b/bash/feeders/openskynetwork.sh @@ -6,7 +6,7 @@ source $RECEIVER_BASH_DIRECTORY/variables.sh source $RECEIVER_BASH_DIRECTORY/functions.sh clear -LogProjectName ${RECEIVER_PROJECT_TITLE} +LogProjectTitle LogTitleHeading "Setting up the OpenSky Network client" LogTitleMessage "------------------------------------------------------------------------------" echo "" diff --git a/bash/feeders/piaware.sh b/bash/feeders/piaware.sh index 05793819..6432f361 100755 --- a/bash/feeders/piaware.sh +++ b/bash/feeders/piaware.sh @@ -18,7 +18,7 @@ source $RECEIVER_BASH_DIRECTORY/variables.sh source $RECEIVER_BASH_DIRECTORY/functions.sh clear -LogProjectName ${RECEIVER_PROJECT_TITLE} +LogProjectTitle LogTitleHeading "Setting up the FlightAware PiAware client" LogTitleMessage "------------------------------------------------------------------------------" echo "" diff --git a/bash/feeders/planefinder.sh b/bash/feeders/planefinder.sh index f8a766e9..4d4693b9 100755 --- a/bash/feeders/planefinder.sh +++ b/bash/feeders/planefinder.sh @@ -6,7 +6,7 @@ source $RECEIVER_BASH_DIRECTORY/variables.sh source $RECEIVER_BASH_DIRECTORY/functions.sh clear -LogProjectName ${RECEIVER_PROJECT_TITLE} +LogProjectTitle LogTitleHeading "Setting up the PlaneFinder client" LogTitleMessage "------------------------------------------------------------------------------" echo "" diff --git a/bash/init.sh b/bash/init.sh index 4d8045f9..3778a097 100755 --- a/bash/init.sh +++ b/bash/init.sh @@ -27,7 +27,7 @@ if [[ $RECEIVER_DEVELOPMENT_MODE != "true" ]]; then current_branch=`git rev-parse --abbrev-ref HEAD` clear - LogProjectName ${RECEIVER_PROJECT_TITLE} + LogProjectTitle LogTitleHeading "Fetching the latest version of the ${RECEIVER_PROJECT_BRANCH} branch" LogTitleMessage "------------------------------------------------------------------------------" echo "" @@ -52,7 +52,9 @@ if [[ $RECEIVER_DEVELOPMENT_MODE != "true" ]]; then if [[ "${current_branch}" != "${RECEIVER_PROJECT_BRANCH}" ]]; then LogMessage "Switching to branch ${RECEIVER_PROJECT_BRANCH}" + echo "" git checkout $RECEIVER_PROJECT_BRANCH + echo "" fi if [[ `git ls-remote --heads https://github.com/jprochazka/adsb-receiver.git refs/heads/$RECEIVER_PROJECT_BRANCH | wc -l` = 1 ]]; then @@ -84,7 +86,7 @@ if whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ --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; then clear - LogProjectName ${RECEIVER_PROJECT_TITLE} + LogProjectTitle LogTitleHeading "Downloading and installing the latest updates for your operating system" LogTitleMessage "------------------------------------------------------------------------------" echo "" @@ -109,7 +111,9 @@ chmod +x $RECEIVER_BASH_DIRECTORY/main.sh LogMessage "Executing bash/main" bash $RECEIVER_BASH_DIRECTORY/main.sh if [[ $? -ne 0 ]] ; then + echo "" LogAlertHeading "ANY FURTHER SETUP AND/OR INSTALLATION REQUESTS HAVE BEEN TERMINIATED" + echo "" exit 1 fi diff --git a/bash/main.sh b/bash/main.sh index c51a5f2d..1bef5205 100755 --- a/bash/main.sh +++ b/bash/main.sh @@ -139,7 +139,7 @@ if [[ $(dpkg-query -W -f='${STATUS}' dump1090-fa 2>/dev/null | grep -c "ok insta DUMP1090_IS_INSTALLED="true" # Check if a newer version can be installed. 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 + 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" @@ -153,7 +153,7 @@ fi # If no dump1090 fork is installed then attempt to install one. if [[ ! "${DUMP1090_IS_INSTALLED}" = "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." 16 65 2 "dump1090-fa" "(FlightAware)" ON 3>&1 1>&2 2>&3) + DUMP1090_OPTION=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Choose Dump1090 Version To Install" --nocancel --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." 16 65 2 "dump1090-fa" "(FlightAware)" ON 3>&1 1>&2 2>&3) case ${DUMP1090_OPTION} in "dump1090-fa") DUMP1090_FORK="fa" @@ -171,7 +171,7 @@ if [[ $(dpkg-query -W -f='${STATUS}' dump978-fa 2>/dev/null | grep -c "ok instal DUMP978_FORK="fa" DUMP978_IS_INSTALLED="true" 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 + 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" From 6c88cd0476e383bb61506449ddb7920f863e3ff9 Mon Sep 17 00:00:00 2001 From: jprochazka Date: Mon, 22 Jul 2024 17:57:59 -0400 Subject: [PATCH 18/26] Added file logging. --- .gitignore | 3 ++ CHANGELOG.md | 4 +- bash/decoders/dump1090-fa.sh | 81 ++++++++++++++++++---------------- bash/decoders/dump978-fa.sh | 20 ++++----- bash/extras/beastsplitter.sh | 14 +++--- bash/extras/duckdns.sh | 4 +- bash/feeders/adsbexchange.sh | 8 ++-- bash/feeders/airplaneslive.sh | 4 +- bash/feeders/flightradar24.sh | 4 +- bash/feeders/flyitalyadsb.sh | 6 +-- bash/feeders/openskynetwork.sh | 8 ++-- bash/feeders/piaware.sh | 39 +++++++++------- bash/feeders/planefinder.sh | 8 ++-- bash/functions.sh | 34 +++++++++++++- bash/init.sh | 16 ++++--- bash/main.sh | 3 +- build/.gitignore | 15 ------- install.sh | 35 +++++++++++---- 18 files changed, 182 insertions(+), 124 deletions(-) create mode 100644 .gitignore delete mode 100644 build/.gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..df354f0c --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +logs/ +build/package-archive +build/dump1090* diff --git a/CHANGELOG.md b/CHANGELOG.md index cdcf04cc..0bff24bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,9 +7,9 @@ The following is a history of the changes made to this project. * The PiAware installation script now supports Ubuntu Noble Numbat. * The installation of PiAware is no longer required when choosing to install dump1090-fa. * The dump1090-fa installation script now mimics the current dump1090-fa installation instructions. -* Added logging functions which in the future will offer a way to log output to files. +* All scripts excluding those related to the portal now utilize the new logging functions. +* Logging to the logs directory is enabled by default but can be disabled with --no-log or -n. * Added variables which can be modified to adjust text colors used by the bash scripts. -* All installation scripts now utilize the new logging functions. * Added the --version and -v arguments in order to display the current project version. * Removed scripting used for image setup. diff --git a/bash/decoders/dump1090-fa.sh b/bash/decoders/dump1090-fa.sh index 54299deb..73814a2c 100755 --- a/bash/decoders/dump1090-fa.sh +++ b/bash/decoders/dump1090-fa.sh @@ -12,11 +12,11 @@ clear LogProjectTitle LogTitleHeading "Setting up the FlightAware Dump1090 decoder" LogTitleMessage "------------------------------------------------------------------------------" -echo "" if ! whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ --title "FlightAware Dump1090 Decoder Setup" \ --yesno "FlightAware Dump1090 is an ADS-B, Mode S, and Mode 3A/3C demodulator and decoder that will receive and decode aircraft transponder messages received via a directly connected software defined radio, or from data provided over a network connection.\n\nWebsite: https://www.flightaware.com/\nGitHub Repository: https://github.com/flightaware/dump1090\n\nWould you like to begin the setup process now?" \ 14 78; then +echo "" LogAlertHeading "INSTALLATION HALTED" LogAlertMessage "Setup has been halted at the request of the user" echo "" @@ -32,6 +32,7 @@ LogHeading "Installing packages needed to fulfill FlightAware Dump1090 decoder d CheckPackage build-essential CheckPackage debhelper +CheckPackage devscripts CheckPackage fakeroot CheckPackage libbladerf-dev CheckPackage libhackrf-dev @@ -45,7 +46,7 @@ CheckPackage pkg-config ## BLACKLIST UNWANTED RTL-SDR MODULES -LogHeading "Blacklist unwanted RTL-SDR kernel modules. +LogHeading "Blacklist unwanted RTL-SDR kernel modules." BlacklistModules @@ -54,24 +55,23 @@ BlacklistModules LogHeading "Preparing the FlightAware Dump1090 Git repository" -if [[ -d $RECEIVER_BUILD_DIRECTORY/dump1090-fa/dump1090 && -d $RECEIVER_BUILD_DIRECTORY/dump1090.fa/dump1090/.git ]]; then +if [[ -d $RECEIVER_BUILD_DIRECTORY/dump1090-fa/dump1090 && -d $RECEIVER_BUILD_DIRECTORY/dump1090-fa/dump1090/.git ]]; then LogMessage "Entering the dump1090 git repository directory" cd $RECEIVER_BUILD_DIRECTORY/dump1090-fa/dump1090 LogMessage "Pulling the dump1090 git repository" echo "" - git pull + git pull 2>&1 | tee -a $RECEIVER_LOG_FILE else LogMessage "Creating the FlightAware dump1090 Project build directory" echo "" - mkdir -vp $RECEIVER_BUILD_DIRECTORY/dump1090-fa + mkdir -v $RECEIVER_BUILD_DIRECTORY/dump1090-fa 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" LogMessage "Entering the FlightAware dump1090 Project build directory" cd $RECEIVER_BUILD_DIRECTORY/dump1090-fa LogMessage "Cloning the dump1090 git repository" echo "" - git clone https://github.com/flightaware/dump1090.git + git clone https://github.com/flightaware/dump1090.git 2>&1 | tee -a $RECEIVER_LOG_FILE fi -echo "" ## BUILD AND INSTALL THE DUMP1090-FA PACKAGE @@ -86,20 +86,24 @@ case $RECEIVER_OS_CODE_NAME in focal) distro="buster" ;; - bullseye | jammy) + bullseye|jammy|bookworm|noble) distro="bullseye" ;; - bookworm | noble) - distro="bookworm" - ;; esac -LogMessage "Entering the package/${distro} directory" -cd $RECEIVER_BUILD_DIRECTORY/dump1090-fa/package/$distro +LogMessage "Preparing to build dump1090-fa for ${distro}" +echo "" +./prepare-build.sh $distro 2>&1 | tee -a $RECEIVER_LOG_FILE +echo "" +LogMessage "Entering the package-${distro} directory" +cd $RECEIVER_BUILD_DIRECTORY/dump1090-fa/dump1090/package-$distro LogMessage "Building the dump1090-fa Debian package" -dpkg-buildpackage -b --no-sign - +echo "" +dpkg-buildpackage -b --no-sign 2>&1 | tee -a $RECEIVER_LOG_FILE +echo "" LogMessage "Installing the dump1090-fa Debian package" -sudo dpkg -i $RECEIVER_BUILD_DIRECTORY/dump1090-fa/dump1090/dump1090-fa_${DUMP1090_FA_VERSION}_*.deb +echo "" +sudo dpkg -i $RECEIVER_BUILD_DIRECTORY/dump1090-fa/dump1090/dump1090-fa_$DUMP1090_FA_VERSION_*.deb 2>&1 | tee -a $RECEIVER_LOG_FILE +echo "" LogMessage "Checking that the dump1090-fa Debian package was installed" if [[ $(dpkg-query -W -f='${STATUS}' dump1090-fa 2>/dev/null | grep -c "ok installed") -eq 0 ]]; then @@ -119,13 +123,12 @@ fi if [[ ! -d $RECEIVER_BUILD_DIRECTORY/package-archive ]]; then LogMessage "Creating the Debian package archive directory" echo "" - mkdir -vp $RECEIVER_BUILD_DIRECTORY/package-archive + mkdir -v $RECEIVER_BUILD_DIRECTORY/package-archive 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" fi LogMessage "Copying the dump1090-fa Debian package into the Debian package archive directory" echo "" -cp -vf $RECEIVER_BUILD_DIRECTORY/piaware_builder/*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ -echo "" +cp -vf $RECEIVER_BUILD_DIRECTORY/dump1090-fa/dump1090/*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ 2>&1 | tee -a $RECEIVER_LOG_FILE ## POST INSTALLATION OPERATIONS @@ -137,50 +140,54 @@ if [[ ! -f "/usr/share/dump1090-fa/html/upintheair.json" ]]; then LogMessage "Asking the user if they want to add heywhatsthat maximum range rings" if (whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ --title "Setup heywhaststhat Maximum Range Rings" \ - --yesno "Maximum range rings can be added to the FlightAware Dump1090 map usings data obtained from heywhatsthat. In order to add these rings to your FlightAware dump1090 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 numbers after \"?view=\" in the URL.\n\nWould you like to add heywhatsthat maximum range rings to your map?" \ + --yesno "Maximum range rings can be added to the FlightAware Dump1090 map usings data obtained from heywhatsthat. In order to add these rings to your FlightAware dump1090 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 numbers after ?view= in the URL.\n\nWould you like to add heywhatsthat maximum range rings to your map?" \ 16 78); then + LogMessage "Asking the user for the heywhatsthat panarama ID" heywhatsthat_panorama_id_title="Enter the heywhatsthat Panorama ID" while [[ -z $heywhatsthat_panorama_id ]] ; do heywhatsthat_panorama_id=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ --title "${heywhatsthat_panorama_id_title}" \ - --inputbox "\nPlease enter your Heywhatsthat panorama ID." \ + --inputbox "Please enter your Heywhatsthat panorama ID." \ 8 78) whiptail_exit_status=$? if [[ $whiptail_exit_status == 0 ]]; then LogAlertMessage "Setup of heywhatsthat maximum range rings was cancelled" break - heywhatsthat_panorama_id_title="Enter the Heywhatsthat Panorama ID (REQUIRED)" + fi + heywhatsthat_panorama_id_title="Enter the Heywhatsthat Panorama ID [REQUIRED]" done if [[ $whiptail_exit_status != 0 ]]; then LogMessage "Asking the user what the altitude is for the first ring" heywhatsthat_ring_one_altitude_title="First heywhatsthat Ring Altitude" while [[ -z $heywhatsthat_ring_one_altitude ]] ; do heywhatsthat_ring_one_altitude=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ - --title "${heywhatsthat_ring_one_title}" \ - --nocancel \ - --inputbox "\nEnter the first ring's altitude in meters.\n(default 3048 meters or 10000 feet)" \ - 8 78 \ - "3048") - heywhatsthat_ring_one_altitude_title="First heywhatsthat Ring Altitude (REQUIRED)" + --title "${heywhatsthat_ring_one_altitude_title}" \ + --nocancel \ + --inputbox "Enter the first ring's altitude in meters.\n(default 3048 meters or 10000 feet)" \ + 8 78 \ + "3048") + heywhatsthat_ring_one_altitude_title="First heywhatsthat Ring Altitude [REQUIRED]" done LogMessage "Asking the user what the altitude is for the second ring" heywhatsthat_ring_two_altitude_title="Second heywhatsthat Ring Altitude" - while [[ -z $heywhatsthat_ring_two ]] ; do + while [[ -z $heywhatsthat_ring_two_altitude ]] ; do heywhatsthat_ring_two_altitude=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ - --title "${heywhatsthat_ring_two_title}" \ - --nocancel \ - --inputbox "\nEnter the second ring's altitude in meters.\n(default 12192 meters or 40000 feet)" \ - 8 78 \ - "12192") - heywhatsthat_ring_two_altitude_title="Second heywhatsthat Ring Altitude (REQUIRED)" + --title "${heywhatsthat_ring_two_altitude_title}" \ + --nocancel \ + --inputbox "Enter the second ring's altitude in meters.\n(default 12192 meters or 40000 feet)" \ + 8 78 \ + "12192") + heywhatsthat_ring_two_altitude_title="Second heywhatsthat Ring Altitude [REQUIRED]" done LogMessage "Downloading JSON data file assigned to panorama ID ${heywhatsthat_panorama_id}" echo "" - sudo wget -O /usr/share/skyaware/html/upintheair.json "http://www.heywhatsthat.com/api/upintheair.json?id=${heywhatsthat_panarama_id}&refraction=0.25&alts=${heywhatsthat_ring_one_altitude},${heywhatsthat_ring_two_altitude}" + sudo wget -v -O /usr/share/skyaware/html/upintheair.json "http://www.heywhatsthat.com/api/upintheair.json?id=${heywhatsthat_panarama_id}&refraction=0.25&alts=${heywhatsthat_ring_one_altitude},${heywhatsthat_ring_two_altitude}" 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" - LogMessage " + LogMessage "Heywhatsthat configuration complete" fi + else + LogMessage "Heywhatsthat maximum range rings was skipped" fi fi diff --git a/bash/decoders/dump978-fa.sh b/bash/decoders/dump978-fa.sh index f60c5098..856e8de6 100755 --- a/bash/decoders/dump978-fa.sh +++ b/bash/decoders/dump978-fa.sh @@ -40,7 +40,7 @@ fi if [[ "${adsb_decoder_installed}" == "true" ]]; then LogMessage "Checking if dump978-fa has been configured" if grep -wq "driver=rtlsdr,serial=" /etc/default/dump978-fa; then - echo -e "The dump978-fa installation appears to have been configured" + LogMessage "The dump978-fa installation appears to have been configured" else whiptail --backtitle "FlightAware Dump978 Configuration" \ --title "RTL-SDR Dongle Assignments" \ @@ -114,17 +114,17 @@ if [[ -d $RECEIVER_BUILD_DIRECTORY/dump978-fa/dump978 && -d $RECEIVER_BUILD_DIRE cd $RECEIVER_BUILD_DIRECTORY/dump978-fa/dump978 LogMessage "Pulling the dump1090 git repository" echo "" - git pull + git pull 2>&1 | tee -a $RECEIVER_LOG_FILE else LogMessage "Creating the FlightAware dump978 Project build directory" echo "" - mkdir -vp $RECEIVER_BUILD_DIRECTORY/dump1090-fa + mkdir -v $RECEIVER_BUILD_DIRECTORY/dump1090-fa 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" LogMessage "Entering the ADS-B Receiver Project build directory" cd $RECEIVER_BUILD_DIRECTORY/dump978-fa LogMessage "Cloning the FlightAware dump978 git repository" echo "" - git clone https://github.com/flightaware/dump978.git + git clone https://github.com/flightaware/dump978.git 2>&1 | tee -a $RECEIVER_LOG_FILE fi echo "" @@ -138,13 +138,13 @@ cd $RECEIVER_BUILD_DIRECTORY/dump978-fa/dump978 LogMessage "Building the dump978-fa package" echo "" -dpkg-buildpackage -b +dpkg-buildpackage -b 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" LogMessage "Installing the dump1090-fa Debian package" -sudo dpkg -i $RECEIVER_BUILD_DIRECTORY/dump978-fa/dump978-fa_${DUMP978_FA_VERSION}_*.deb +sudo dpkg -i $RECEIVER_BUILD_DIRECTORY/dump978-fa/dump978-fa_${DUMP978_FA_VERSION}_*.deb 2>&1 | tee -a $RECEIVER_LOG_FILE LogMessage "Installing the skyaware978 Debian package" -sudo dpkg -i $$RECEIVER_BUILD_DIRECTORY/dump978-fa/skyaware978_${DUMP978_FA_VERSION}_*.deb +sudo dpkg -i $$RECEIVER_BUILD_DIRECTORY/dump978-fa/skyaware978_${DUMP978_FA_VERSION}_*.deb 2>&1 | tee -a $RECEIVER_LOG_FILE LogMessage "Checking that the dump978-fa Debian package was installed" if [[ $(dpkg-query -W -f='${STATUS}' dump978-fa 2>/dev/null | grep -c "ok installed") -eq 0 ]]; then @@ -179,16 +179,16 @@ fi if [[ ! -d $RECEIVER_BUILD_DIRECTORY/package-archive ]]; then LogMessage "Creating the Debian package archive directory" echo "" - mkdir -vp $RECEIVER_BUILD_DIRECTORY/package-archive + mkdir -v $RECEIVER_BUILD_DIRECTORY/package-archive 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" fi LogMessage "Copying the dump978-fa Debian package into the Debian package archive directory" echo "" -cp -vf $RECEIVER_BUILD_DIRECTORY/piaware_builder/*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ +cp -vf $RECEIVER_BUILD_DIRECTORY/piaware_builder/*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" LogMessage "Copying the skyaware978 Debian package into the Debian package archive directory" echo "" -cp -vf $RECEIVER_BUILD_DIRECTORY/piaware_builder/*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ +cp -vf $RECEIVER_BUILD_DIRECTORY/piaware_builder/*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" diff --git a/bash/extras/beastsplitter.sh b/bash/extras/beastsplitter.sh index cc2a9e7b..55228446 100755 --- a/bash/extras/beastsplitter.sh +++ b/bash/extras/beastsplitter.sh @@ -87,17 +87,17 @@ if [[ -d $RECEIVER_BUILD_DIRECTORY/beast-splitter/beast-splitter && -d $RECEIVER cd $RECEIVER_BUILD_DIRECTORY/beast-splitter/beast-splitter LogMessage "Pulling the beast-splitter git repository" echo "" - git pull + git pull 2>&1 | tee -a $RECEIVER_LOG_FILE else LogMessage "Creating the beast-splitter build directory" echo "" - mkdir -vp $RECEIVER_BUILD_DIRECTORY/beast-splitter + mkdir -v $RECEIVER_BUILD_DIRECTORY/beast-splitter 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" LogMessage "Entering the beast-splitter build directory" cd $RECEIVER_BUILD_DIRECTORY/beast-splitter LogMessage "Cloning the FlightAware dump978 git repository" echo "" - git clone https://github.com/flightaware/beast-splitter.git + git clone https://github.com/flightaware/beast-splitter.git 2>&1 | tee -a $RECEIVER_LOG_FILE fi @@ -110,11 +110,11 @@ cd $RECEIVER_BUILD_DIRECTORY/beast-splitter/beast-splitter LogMessage "Building the beast-splitter package" echo "" -dpkg-buildpackage -b +dpkg-buildpackage -b 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" LogMessage "Installing the beast-splitter Debian package" -sudo dpkg -i $RECEIVER_BUILD_DIRECTORY/beast-splitter/beast-splitter_*.deb +sudo dpkg -i $RECEIVER_BUILD_DIRECTORY/beast-splitter/beast-splitter_*.deb 2>&1 | tee -a $RECEIVER_LOG_FILE LogMessage "Checking that the beast-splitter Debian package was installed" if [[ $(dpkg-query -W -f='${STATUS}' beast-splitter 2>/dev/null | grep -c "ok installed") -eq 0 ]]; then @@ -134,12 +134,12 @@ fi if [[ ! -d $RECEIVER_BUILD_DIRECTORY/package-archive ]]; then LogMessage "Creating the Debian package archive directory" echo "" - mkdir -vp $RECEIVER_BUILD_DIRECTORY/package-archive + mkdir -v $RECEIVER_BUILD_DIRECTORY/package-archive 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" fi LogMessage "Copying the beast-splitter Debian package into the Debian package archive directory" echo "" -cp -vf $RECEIVER_BUILD_DIRECTORY/beast-splitter/*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ +cp -vf $RECEIVER_BUILD_DIRECTORY/beast-splitter/*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" diff --git a/bash/extras/duckdns.sh b/bash/extras/duckdns.sh index 5f1329d4..b6070300 100755 --- a/bash/extras/duckdns.sh +++ b/bash/extras/duckdns.sh @@ -80,7 +80,7 @@ LogHeading "Creating the Duck DNS script" if [[ ! -d $RECEIVER_BUILD_DIRECTORY/duckdns ]]; then LogMessage "Creating the Duck DNS build directory" echo "" - mkdir -vp $RECEIVER_BUILD_DIRECTORY/duckdns + mkdir -v $RECEIVER_BUILD_DIRECTORY/duckdns 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" fi @@ -91,7 +91,7 @@ EOF LogMessage "Adding execute permissions for only this user to the Duck DNS update script" echo "" -chmod -v 700 $RECEIVER_BUILD_DIRECTORY/duckdns/duck.sh +chmod -v 700 $RECEIVER_BUILD_DIRECTORY/duckdns/duck.sh 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" LogMessage "Creating the Duck DNS cron file" diff --git a/bash/feeders/adsbexchange.sh b/bash/feeders/adsbexchange.sh index 746d7f08..4ab4dee0 100755 --- a/bash/feeders/adsbexchange.sh +++ b/bash/feeders/adsbexchange.sh @@ -37,7 +37,7 @@ whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ if [[ ! -d $RECEIVER_BUILD_DIRECTORY/adsbexchange ]]; then LogMessage "Creating the ADSBExchange build directory" echo "" - mkdir -vp $RECEIVER_BUILD_DIRECTORY/adsbexchange + mkdir -v $RECEIVER_BUILD_DIRECTORY/adsbexchange 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" fi LogMessage "Entering the ADSBExchange build directory" @@ -52,9 +52,9 @@ fi LogMessage "Downloading the ADS-B Exchange client ${action_to_perform} script" echo "" if [[ "${action_to_perform}" = "install" ]]; then - wget -O $RECEIVER_BUILD_DIRECTORY/adsbexchange/feed-${action_to_perform}.sh https://www.adsbexchange.com/feed.sh + wget -v -O $RECEIVER_BUILD_DIRECTORY/adsbexchange/feed-${action_to_perform}.sh https://www.adsbexchange.com/feed.sh 2>&1 | tee -a $RECEIVER_LOG_FILE else - wget -O $RECEIVER_BUILD_DIRECTORY/adsbexchange/feed-${action_to_perform}.sh https://www.adsbexchange.com/feed-update.sh + wget -v -O $RECEIVER_BUILD_DIRECTORY/adsbexchange/feed-${action_to_perform}.sh https://www.adsbexchange.com/feed-update.sh 2>&1 | tee -a $RECEIVER_LOG_FILE fi echo "" @@ -75,7 +75,7 @@ if whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ 12 78; then LogMessage "Downloading the ADS-B Exchange stats package installation script" echo "" - curl -L -o $RECEIVER_BUILD_DIRECTORY/adsbexchange/axstats.sh https://adsbexchange.com/stats.sh + wget -v -O $RECEIVER_BUILD_DIRECTORY/adsbexchange/axstats.sh https://adsbexchange.com/stats.sh 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" echo -e "Executing the ADS-B Exchange stats package installation script" echo "" diff --git a/bash/feeders/airplaneslive.sh b/bash/feeders/airplaneslive.sh index fddb4d33..eae4f005 100755 --- a/bash/feeders/airplaneslive.sh +++ b/bash/feeders/airplaneslive.sh @@ -37,7 +37,7 @@ whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ if [[ ! -d $RECEIVER_BUILD_DIRECTORY/airplaneslive ]]; then LogMessage "Creating the airplanes.live build directory" echo "" - mkdir -vp $RECEIVER_BUILD_DIRECTORY/airplaneslive + mkdir -v $RECEIVER_BUILD_DIRECTORY/airplaneslive 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" fi LogMessage "Entering the airplanes.live build directory" @@ -45,7 +45,7 @@ cd $RECEIVER_BUILD_DIRECTORY/airplaneslive LogMessage "Downloading the airplanes.live client installation script" echo "" -wget -v -O $RECEIVER_BUILD_DIRECTORY/airplaneslive/install.sh https://raw.githubusercontent.com/airplanes-live/feed/main/install.sh +wget -v -O $RECEIVER_BUILD_DIRECTORY/airplaneslive/install.sh https://raw.githubusercontent.com/airplanes-live/feed/main/install.sh 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" LogMessage "Executing the airplanes.live client installation script" diff --git a/bash/feeders/flightradar24.sh b/bash/feeders/flightradar24.sh index e23c11af..46efc76d 100755 --- a/bash/feeders/flightradar24.sh +++ b/bash/feeders/flightradar24.sh @@ -32,7 +32,7 @@ LogHeading "Begining the FlightRadar24 client installation process" if [[ ! -d $RECEIVER_BUILD_DIRECTORY/flightradar24 ]]; then LogMessage "Creating the FlightRadar24 build directory" echo "" - mkdir -vp $RECEIVER_BUILD_DIRECTORY/flightradar24 + mkdir -v $RECEIVER_BUILD_DIRECTORY/flightradar24 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" fi LogMessage "Entering the FlightRadar24 build directory" @@ -40,7 +40,7 @@ cd $RECEIVER_BUILD_DIRECTORY/flightradar24 LogMessage "Downloading the airplanes.live client installation script" echo "" -wget -v -O $RECEIVER_BUILD_DIRECTORY/flightradar24/install.sh https://fr24.com/install.sh +wget -v -O $RECEIVER_BUILD_DIRECTORY/flightradar24/install.sh https://fr24.com/install.sh 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" LogMessage "Executing the airplanes.live client installation script" diff --git a/bash/feeders/flyitalyadsb.sh b/bash/feeders/flyitalyadsb.sh index 200fdfc9..e1754428 100755 --- a/bash/feeders/flyitalyadsb.sh +++ b/bash/feeders/flyitalyadsb.sh @@ -37,7 +37,7 @@ whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ if [[ ! -d $RECEIVER_BUILD_DIRECTORY/flyitalyadsb ]]; then LogMessage "Creating the Fly Italy ADS-B build directory" echo "" - mkdir -vp $RECEIVER_BUILD_DIRECTORY/flyitalyadsb + mkdir -v $RECEIVER_BUILD_DIRECTORY/flyitalyadsb 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" fi LogMessage "Entering the Fly Italy ADS-B build directory" @@ -45,7 +45,7 @@ cd $RECEIVER_BUILD_DIRECTORY/flyitalyadsb LogMessage "Downloading the Fly Italy ADS-B installation script" echo "" -wget -v -O$RECEIVER_BUILD_DIRECTORY/flyitalyadsb/install.sh wget https://raw.githubusercontent.com/flyitalyadsb/mlat-client/master/scripts/install.sh +wget -v -O $RECEIVER_BUILD_DIRECTORY/flyitalyadsb/install.sh wget https://raw.githubusercontent.com/flyitalyadsb/mlat-client/master/scripts/install.sh 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" LogMessage "Executing the Fly Italy ADS-B feeder installation script" echo "" @@ -59,7 +59,7 @@ if whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ 12 78; LogMessage "Downloading the Fly Italy ADS-B updater script" echo "" - wget -v -O$RECEIVER_BUILD_DIRECTORY/flyitalyadsb/install_updater.sh wget https://raw.githubusercontent.com/flyitalyadsb/mlat-client/master/scripts/install_updater.sh + wget -v -O $RECEIVER_BUILD_DIRECTORY/flyitalyadsb/install_updater.sh wget https://raw.githubusercontent.com/flyitalyadsb/mlat-client/master/scripts/install_updater.sh 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" LogMessage "Executing the Fly Italy ADS-B feeder updater script" echo "" diff --git a/bash/feeders/openskynetwork.sh b/bash/feeders/openskynetwork.sh index 1cd585d3..f06986a8 100755 --- a/bash/feeders/openskynetwork.sh +++ b/bash/feeders/openskynetwork.sh @@ -42,7 +42,7 @@ if ! grep -q "^deb .*opensky." /etc/apt/sources.list /etc/apt/sources.list.d/*; if [[ ! -d $RECEIVER_BUILD_DIRECTORY/openskynetwork ]]; then LogMessage "Creating the OpenSky Network build directory" echo "" - mkdir -vp $RECEIVER_BUILD_DIRECTORY/openskynetwork + mkdir -v $RECEIVER_BUILD_DIRECTORY/openskynetwork 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" fi LogMessage "Entering the OpenSky Network build directory" @@ -50,8 +50,8 @@ if ! grep -q "^deb .*opensky." /etc/apt/sources.list /etc/apt/sources.list.d/*; LogMessage "Downloading and adding the OpenSky Network apt repository GPG key" echo "" - wget -v -O $RECEIVER_BUILD_DIRECTORY/openskynetwork/opensky.gpg.pub https://opensky-network.org/files/firmware/opensky.gpg.pub - wget -q -O - https://opensky-network.org/files/firmware/opensky.gpg.pub | sudo apt-key add - + wget -v -O $RECEIVER_BUILD_DIRECTORY/openskynetwork/opensky.gpg.pub https://opensky-network.org/files/firmware/opensky.gpg.pub 2>&1 | tee -a $RECEIVER_LOG_FILE + wget -q -O - https://opensky-network.org/files/firmware/opensky.gpg.pub | sudo apt-key add - 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" LogMessage "Adding the OpenSky Network apt repository" sudo bash -c "echo deb https://opensky-network.org/repos/debian opensky custom > /etc/apt/sources.list.d/opensky.list" @@ -66,7 +66,7 @@ LogHeading "Installing the OpenSky Network feeder package" LogMessage "Downloading the latest package lists for all enabled repositories and PPAs" echo "" -sudo apt-get update +sudo apt-get update 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" LogMessage "Installing the OpenSky Network fedder package using apt" CheckPackage opensky-feeder diff --git a/bash/feeders/piaware.sh b/bash/feeders/piaware.sh index 6432f361..8455cd7d 100755 --- a/bash/feeders/piaware.sh +++ b/bash/feeders/piaware.sh @@ -89,13 +89,17 @@ if [[ "${RECEIVER_OS_CODE_NAME}" == "focal" ]]; then cd $RECEIVER_BUILD_DIRECTORY/tcltls-rebuild LogMessage "Updating the local tcltls-rebuild git repository" echo "" - git pull + git pull 2>&1 | tee -a $RECEIVER_LOG_FILE else - LogMessage "Entering the ADS-B Receiver Project build directory" - cd $RECEIVER_BUILD_DIRECTORY + LogMessage "Creating the tcltls-rebuild build directory" + echo "" + mkdir -v $RECEIVER_BUILD_DIRECTORY/tcltls-rebuild 2>&1 | tee -a $RECEIVER_LOG_FILE + echo "" + LogMessage "Entering the tcltls-rebuild build directory" + cd $RECEIVER_BUILD_DIRECTORY/tcltls-rebuild LogMessage "Cloning the tcltls-rebuild git repository locally" echo "" - git clone https://github.com/flightaware/tcltls-rebuild + git clone https://github.com/flightaware/tcltls-rebuild 2>&1 | tee -a $RECEIVER_LOG_FILE fi echo "" @@ -110,11 +114,11 @@ if [[ "${RECEIVER_OS_CODE_NAME}" == "focal" ]]; then cd $RECEIVER_BUILD_DIRECTORY/tcltls-rebuild/tcltls-1.7.22 LogMessage "Building the tcltls-rebuild package" echo "" - dpkg-buildpackage -b + dpkg-buildpackage -b 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" LogMessage "Installing the tcltls-rebuild package" echo "" - sudo dpkg -i $RECEIVER_BUILD_DIRECTORY/tcltls-rebuild/tcl-tls_1.7.22-2+fa1_*.deb + sudo dpkg -i $RECEIVER_BUILD_DIRECTORY/tcltls-rebuild/tcl-tls_1.7.22-2+fa1_*.deb 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" LogMessage "Checking that the FlightAware tcltls-rebuild package was installed properly" @@ -134,12 +138,12 @@ if [[ "${RECEIVER_OS_CODE_NAME}" == "focal" ]]; then if [[ ! -d $RECEIVER_BUILD_DIRECTORY/package-archive ]]; then LogMessage "Creating the package archive directory" echo "" - mkdir -vp $RECEIVER_BUILD_DIRECTORY/package-archive + mkdir -v $RECEIVER_BUILD_DIRECTORY/package-archive 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" fi LogMessage "Copying the FlightAware tcltls-rebuild Debian package into the archive directory" echo "" - cp -vf $RECEIVER_BUILD_DIRECTORY/tcltls-rebuild/*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ + cp -vf $RECEIVER_BUILD_DIRECTORY/tcltls-rebuild/*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ 2>&1 | tee -a $RECEIVER_LOG_FILE fi fi @@ -153,13 +157,17 @@ if [[ -d $RECEIVER_BUILD_DIRECTORY/piaware_builder && -d $RECEIVER_BUILD_DIRECTO cd $RECEIVER_BUILD_DIRECTORY/piaware_builder LogMessage "Updating the local piaware_builder git repository" echo "" - git pull + git pull 2>&1 | tee -a $RECEIVER_LOG_FILE else + LogMessage "Creating the FlightAware piaware_builder build directory" + echo "" + mkdir -v $RECEIVER_BUILD_DIRECTORY/piaware_builder 2>&1 | tee -a $RECEIVER_LOG_FILE + echo "" LogMessage "Entering the ADS-B Receiver Project build directory" cd $RECEIVER_BUILD_DIRECTORY LogMessage "Cloning the piaware_builder git repository locally" echo "" - git clone https://github.com/flightaware/dump978.git + git clone https://github.com/flightaware/dump978.git 2>&1 | tee -a $RECEIVER_LOG_FILE fi echo "" @@ -184,20 +192,21 @@ case $RECEIVER_OS_CODE_NAME in distro="bookworm" ;; esac +LogMessage "Setting distribution to build for to ${distro}" LogMessage "Executing the FlightAware PiAware client build script" echo "" -./sensible-build.sh $distro +./sensible-build.sh $distro 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" LogMessage "Entering the FlightAware PiAware client build directory" cd $RECEIVER_BUILD_DIRECTORY/piaware_builder/package-${distro} LogMessage "Building the FlightAware PiAware client package" echo "" -dpkg-buildpackage -b +dpkg-buildpackage -b 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" LogMessage "Installing the FlightAware PiAware client package" echo "" -sudo dpkg -i $RECEIVER_BUILD_DIRECTORY/piaware_builder/piaware_*.deb 2>&1 +sudo dpkg -i $RECEIVER_BUILD_DIRECTORY/piaware_builder/piaware_*.deb 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" LogMessage "Checking that the FlightAware PiAware client package was installed properly" @@ -216,12 +225,12 @@ else if [[ ! -d $RECEIVER_BUILD_DIRECTORY/package-archive ]]; then LogMessage "Creating the package archive directory" echo "" - mkdir -vp $RECEIVER_BUILD_DIRECTORY/package-archive + mkdir -v $RECEIVER_BUILD_DIRECTORY/package-archive 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" fi LogMessage "Copying the FlightAware PiAware client binary package into the archive directory" echo "" - cp -vf $RECEIVER_BUILD_DIRECTORY/piaware_builder/*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ + cp -vf $RECEIVER_BUILD_DIRECTORY/piaware_builder/*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" fi diff --git a/bash/feeders/planefinder.sh b/bash/feeders/planefinder.sh index 4d4693b9..aad7e569 100755 --- a/bash/feeders/planefinder.sh +++ b/bash/feeders/planefinder.sh @@ -85,22 +85,22 @@ cd $RECEIVER_BUILD_DIRECTORY/planefinder LogMessage "Downloading the appropriate PlaneFinder client Debian package" echo "" -wget -v -O --no-check-certificate http://client.planefinder.net/$PACKAGE_NAME $RECEIVER_BUILD_DIRECTORY/planefinder/$PACKAGE_NAME +wget -v -O --no-check-certificate http://client.planefinder.net/$PACKAGE_NAME $RECEIVER_BUILD_DIRECTORY/planefinder/$PACKAGE_NAME 2>&1 | tee -a $RECEIVER_LOG_FILE LogMessage "Installing the PlaneFinder Client Debian package" echo -e "" -sudo dpkg -i $RECEIVER_BUILD_DIRECTORY/planefinder/$package_name +sudo dpkg -i $RECEIVER_BUILD_DIRECTORY/planefinder/$package_name 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" if [[ ! -d $RECEIVER_BUILD_DIRECTORY/package-archive ]]; then LogMessage "Creating the package archive directory" echo "" - mkdir -vp $RECEIVER_BUILD_DIRECTORY/package-archive + mkdir -v $RECEIVER_BUILD_DIRECTORY/package-archive 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" fi LogMessage "Copying the PlaneFinder client Debian package into the archive directory" echo "" -cp -vf $RECEIVER_BUILD_DIRECTORY/planefinder/$package_name $RECEIVER_BUILD_DIRECTORY/package-archive/ +cp -vf $RECEIVER_BUILD_DIRECTORY/planefinder/$package_name $RECEIVER_BUILD_DIRECTORY/package-archive/ 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" diff --git a/bash/functions.sh b/bash/functions.sh index 89429ad4..3e989d4f 100755 --- a/bash/functions.sh +++ b/bash/functions.sh @@ -2,14 +2,36 @@ ## LOGGING FUNCTIONS +# LogToFile +function LogToFile { + if [[ "${RECEIVER_LOGGING_ENABLED}" == "true" ]]; then + time_stamp='' + if [[ -z $2 || "${2}" == "true" ]]; then + printf -v time_stamp '[%(%Y-%m-%d %H:%M:%S)T]' -1 + fi + + if [[ ! -z $3 && "${3}" == "inline" ]]; then + printf "${time_stamp} ${1}" >> $RECEIVER_LOG_FILE + else + echo "${time_stamp} ${1}" >> $RECEIVER_LOG_FILE + fi + fi +} + +function LogOutput { + LogToFile "${1}" +} + # Logs the "PROJECT TITLE" to the console function LogProjectTitle { + LogToFile "${RECEIVER_PROJECT_TITLE}" echo -e "${DISPLAY_PROJECT_NAME} ${RECEIVER_PROJECT_TITLE}${DISPLAY_DEFAULT}" echo "" } # Logs a "HEADING" to the console function LogHeading { + LogToFile "${1}" echo "" echo -e "${DISPLAY_HEADING} ${1}${DISPLAY_DEFAULT}" echo "" @@ -17,48 +39,58 @@ function LogHeading { # Logs a "MESSAGE" to the console function LogMessage { + LogToFile "${1}" echo -e "${DISPLAY_MESSAGE} ${1}${DISPLAY_DEFAULT}" } # Logs an alert "HEADING" to the console function LogAlertHeading { + LogToFile "${1}" echo -e "${DISPLAY_ALERT_HEADING} ${1}${DISPLAY_DEFAULT}" } # Logs an alert "MESSAGE" to the console function LogAlertMessage { + LogToFile "${1}" echo -e "${DISPLAY_ALERT_MESSAGE} ${1}${DISPLAY_DEFAULT}" } # Logs an title "HEADING" to the console function LogTitleHeading { + LogToFile "${1}" echo -e "${DISPLAY_TITLE_HEADING} ${1}${DISPLAY_DEFAULT}" } # Logs an title "MESSAGE" to the console function LogTitleMessage { + LogToFile "${1}" echo -e "${DISPLAY_TITLE_MESSAGE} ${1}${DISPLAY_DEFAULT}" } # Logs a warning "HEADING" to the console function LogWarningHeading { + LogToFile "${1}" echo -e "${DISPLAY_WARNING_HEADING} ${1}${DISPLAY_DEFAULT}" } # Logs a warning "MESSAGE" to the console function LogWarningMessage { + LogToFile "${1}" echo -e "${DISPLAY_WARNING_MESSAGE} ${1}${DISPLAY_DEFAULT}" } function LogMessageInline { + LogToFile "${1}" "true" "inline" printf "${DISPLAY_MESSAGE} ${1}${DISPLAY_DEFAULT}" } function LogFalseInline { + LogToFile "${1}" "false" echo -e "${DISPLAY_FALSE_INLINE} ${1}${DISPLAY_DEFAULT}" } function LogTrueInline { + LogToFile "${1}" "false" echo -e "${DISPLAY_TRUE_INLINE} ${1}${DISPLAY_DEFAULT}" } @@ -90,7 +122,7 @@ function CheckPackage { fi echo "" attempt=$((attempt+1)) - sudo apt-get install -y $1 + sudo apt-get install -y $1 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" else LogTrueInline "[OK]" diff --git a/bash/init.sh b/bash/init.sh index 3778a097..5c2f7fe6 100755 --- a/bash/init.sh +++ b/bash/init.sh @@ -11,12 +11,14 @@ source $RECEIVER_BASH_DIRECTORY/functions.sh LogHeading "Displaying the welcome message" LogMessage "Displaying the welcome message to the user" +echo "" if ! 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; then LogAlertHeading "INSTALLATION HALTED" LogAlertMessage "Setup has been halted at the request of the user" + echo "" exit 1 fi @@ -41,11 +43,12 @@ if [[ $RECEIVER_DEVELOPMENT_MODE != "true" ]]; then --yesno "There appears to be changes to the current branch. In order to switch to or fetch the ${current_branch} branch these changes will need to be stashed. Would you like to stash these changes now?" \ 14 78; then LogMessage "Stashing changes made to the ${current_branch} branch" - git stash + git stash 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" else LogAlertHeading "INSTALLATION HALTED" LogAlertMessage "Setup has been halted at the request of the user" + echo "" exit 1 fi fi @@ -53,14 +56,14 @@ if [[ $RECEIVER_DEVELOPMENT_MODE != "true" ]]; then if [[ "${current_branch}" != "${RECEIVER_PROJECT_BRANCH}" ]]; then LogMessage "Switching to branch ${RECEIVER_PROJECT_BRANCH}" echo "" - git checkout $RECEIVER_PROJECT_BRANCH + git checkout $RECEIVER_PROJECT_BRANCH 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" fi if [[ `git ls-remote --heads https://github.com/jprochazka/adsb-receiver.git refs/heads/$RECEIVER_PROJECT_BRANCH | wc -l` = 1 ]]; then LogMessage "Fetching branch ${RECEIVER_PROJECT_BRANCH} from origin" echo "" - git fetch origin + git fetch origin 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" LogMessage "Performing hard reset of branch ${RECEIVER_PROJECT_BRANCH} so it matches origin/${RECEIVER_PROJECT_BRANCH}" echo "" @@ -92,7 +95,7 @@ if whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ echo "" LogMessage "Updating the operating system using apt-get" echo "" - sudo apt-get -y dist-upgrade + sudo apt-get -y dist-upgrade 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" LogTitleMessage "------------------------------------------------------------------------" LogTitleHeading "Your operating system should now be up to date" @@ -124,6 +127,9 @@ 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 -LogProjectName "Installation complete" + +echo "" +LogAlertHeading "Installation complete" +echo "" exit 0 diff --git a/bash/main.sh b/bash/main.sh index 1bef5205..9148f228 100755 --- a/bash/main.sh +++ b/bash/main.sh @@ -69,7 +69,6 @@ function InstallFlyItalyAdsb() { fi } - # Execute the OpenSky Network setup script. function InstallOpenSkyNetwork() { chmod +x ${RECEIVER_BASH_DIRECTORY}/feeders/openskynetwork.sh @@ -465,7 +464,7 @@ fi RUN_ADSBEXCHANGE_SCRIPT="false" RUN_PIAWARE_SCRIPT="false" RUN_FLIGHTRADAR24_SCRIPT="false" -RUN_FLYITALYADSB_SCRIPT +RUN_FLYITALYADSB_SCRIPT="false" RUN_OPENSKYNETWORK_SCRIPT="false" RUN_PLANEFINDER_SCRIPT="false" diff --git a/build/.gitignore b/build/.gitignore deleted file mode 100644 index 7a7f2ddd..00000000 --- a/build/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -# exclude build directories -AboveTustin/ -adsbexchange/ -acarsdec/ -dump1090* -gps/ -hab/ -mlat-client/ -mlat-client* -ogn/ -phantomjs* -piaware_builder/ -planefinder/ -portal/graphs/dump1090.pyc -portal/logging/ diff --git a/install.sh b/install.sh index e1a6cb5d..d1a1a19c 100755 --- a/install.sh +++ b/install.sh @@ -35,10 +35,15 @@ ##################################################################################### -## ASSIGN VERSION VARIABLE +## ASSIGN VARIABLE project_version="2.8.5" +printf -v date_time '%(%Y-%m-%d_%H-%M-%S)T' -1 +log_file="adsb-installer_${date_time}.log" +logging_enabled="true" + + ## FUNCTIONS # Display the help message @@ -53,6 +58,7 @@ function DisplayHelp() { echo "-d --development Skips local repository update so changes are not overwrote." echo "-h --help Shows this message. " echo "-m --mta= Specify which email MTA to use currently Exim or Postfix. " + echo "-n --no-logging Disables writing output to a log file. " echo "-v --version Displays the version being used. " echo "-------------------------------------------------------------------------------------------" echo " " @@ -64,22 +70,18 @@ function DisplayHelp() { while [[ $# > 0 ]] ; do case $1 in --branch*) - # The specified branch of github project_branch=`echo $1 | sed -e 's/^[^=]*=//g'` shift 1 ;; -b) - # The specified branch of github project_branch=$2 shift 2 ;; --development | -d) - # Skip adsb-receiver repository update development_mode="true" shift 1 ;; --help | -h) - # Display a help message DisplayHelp exit 0 ;; @@ -91,6 +93,10 @@ while [[ $# > 0 ]] ; do fi shift 1 ;; + --no-logging | -n) + logging_enabled="false" + shift 1 + ;; -m) # The MTA to use mta=${2^^} @@ -114,9 +120,9 @@ while [[ $# > 0 ]] ; do esac done -# Add any environmental variables needed by any child scripts export RECEIVER_PROJECT_BRANCH=$project_branch export RECEIVER_DEVELOPMENT_MODE=$development_mode +export RECEIVER_LOGGING_ENABLED=$logging_enabled export RECEIVER_MTA=$mta @@ -136,6 +142,17 @@ source $RECEIVER_BASH_DIRECTORY/functions.sh source $RECEIVER_BASH_DIRECTORY/variables.sh +## CREATE THE LOG DIRECTORY + +if [[ "${RECEIVER_LOGGING_ENABLED}" == "true" ]]; then + export RECEIVER_LOG_FILE=$PWD/logs/$log_file + if [ ! -d "$DIRECTORY" ]; then + LogMessage "Creating logs directory" + mkdir $PWD/logs + fi +fi + + ## UPDATE PACKAGE LISTS AND INSTALL DEPENDENCIES clear @@ -147,7 +164,7 @@ LogHeading "Updating package lists for all enabled repositories and PPAs" LogMessage "Downloading the latest package lists for all enabled repositories and PPAs" echo "" -sudo apt-get update +sudo apt-get update 2>&1 | tee -a $RECEIVER_LOG_FILE LogHeading "Ensuring that all required packages are installed" @@ -185,14 +202,12 @@ $RECEIVER_BASH_DIRECTORY/init.sh ## CLEAN UP -# Remove any files created by whiptail. for choice in FEEDER_CHOICES EXTRAS_CHOICES ; do if [[ -f ${RECEIVER_ROOT_DIRECTORY}/${choice} ]] ; then rm -f ${RECEIVER_ROOT_DIRECTORY}/${choice} fi done -# Remove any global variables assigned by this script unset RECEIVER_PROJECT_TITLE unset RECEIVER_ROOT_DIRECTORY unset RECEIVER_BASH_DIRECTORY @@ -204,6 +219,8 @@ unset RECIEVER_CPU_ARCHITECTURE unset RECEIVER_CPU_REVISION unset RECEIVER_PROJECT_BRANCH unset RECEIVER_DEVELOPMENT_MODE +unset RECEIVER_LOGGING_ENABLED +unset RECEIVER_LOG_FILE unset RECEIVER_MTA # Check if any errors were encountered by any child scripts From 9b9a7c7d4743a280dc653db5e70ff38dc6d592a1 Mon Sep 17 00:00:00 2001 From: jprochazka Date: Mon, 22 Jul 2024 18:54:17 -0400 Subject: [PATCH 19/26] Fixes to dump978-fa installer. --- .gitignore | 7 +++-- bash/decoders/dump1090-fa.sh | 6 ++--- bash/decoders/dump978-fa.sh | 52 ++++++++++++++++++++---------------- bash/main.sh | 3 --- 4 files changed, 37 insertions(+), 31 deletions(-) diff --git a/.gitignore b/.gitignore index df354f0c..f7820000 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ -logs/ -build/package-archive +EXTRAS_CHOICES +FEEDER_CHOICES build/dump1090* +build/dump978* +build/package-archive +logs/ diff --git a/bash/decoders/dump1090-fa.sh b/bash/decoders/dump1090-fa.sh index 73814a2c..056f8d95 100755 --- a/bash/decoders/dump1090-fa.sh +++ b/bash/decoders/dump1090-fa.sh @@ -148,7 +148,7 @@ if [[ ! -f "/usr/share/dump1090-fa/html/upintheair.json" ]]; then heywhatsthat_panorama_id=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ --title "${heywhatsthat_panorama_id_title}" \ --inputbox "Please enter your Heywhatsthat panorama ID." \ - 8 78) + 8 78 3>&1 1>&2 2>&3) whiptail_exit_status=$? if [[ $whiptail_exit_status == 0 ]]; then LogAlertMessage "Setup of heywhatsthat maximum range rings was cancelled" @@ -165,7 +165,7 @@ if [[ ! -f "/usr/share/dump1090-fa/html/upintheair.json" ]]; then --nocancel \ --inputbox "Enter the first ring's altitude in meters.\n(default 3048 meters or 10000 feet)" \ 8 78 \ - "3048") + "3048" 3>&1 1>&2 2>&3) heywhatsthat_ring_one_altitude_title="First heywhatsthat Ring Altitude [REQUIRED]" done LogMessage "Asking the user what the altitude is for the second ring" @@ -176,7 +176,7 @@ if [[ ! -f "/usr/share/dump1090-fa/html/upintheair.json" ]]; then --nocancel \ --inputbox "Enter the second ring's altitude in meters.\n(default 12192 meters or 40000 feet)" \ 8 78 \ - "12192") + "12192" 3>&1 1>&2 2>&3) heywhatsthat_ring_two_altitude_title="Second heywhatsthat Ring Altitude [REQUIRED]" done diff --git a/bash/decoders/dump978-fa.sh b/bash/decoders/dump978-fa.sh index 856e8de6..457eb804 100755 --- a/bash/decoders/dump978-fa.sh +++ b/bash/decoders/dump978-fa.sh @@ -12,11 +12,11 @@ clear LogProjectTitle LogTitleHeading "Setting up the FlightAware Dump978 decoder" LogTitleMessage "------------------------------------------------------------------------------" -echo "" if ! whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ --title "FlightAware Dump978 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; then + echo "" LogAlertHeading "INSTALLATION HALTED" LogAlertMessage "Setup has been halted at the request of the user" echo "" @@ -34,25 +34,28 @@ LogHeading "Gather information required to configure the ADS-B decoder and dump9 LogMessage "Checking if an ADS-B decoder is installed" adsb_decoder_installed="false" if [[ $(dpkg-query -W -f='${STATUS}' dump1090-fa 2>/dev/null | grep -c "ok installed") -eq 1 ]]; then + LogMessage "An ADS-B decoder appears to be installed" adsb_decoder_installed="true" fi if [[ "${adsb_decoder_installed}" == "true" ]]; then LogMessage "Checking if dump978-fa has been configured" - if grep -wq "driver=rtlsdr,serial=" /etc/default/dump978-fa; then - LogMessage "The dump978-fa installation appears to have been configured" + if [[ -f /etc/default/dump978-fa ]]; then + LogMessage "A dump978-fa configuration file exists" else + LogMessage "Informing the user an ADS-B decoder appears to be installed" whiptail --backtitle "FlightAware Dump978 Configuration" \ --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." \ + --msgbox "It appears one of the dump1090 decoder 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 + LogMessage "Asking the user to assign a RTL-SDR device serial number to the ADS-B decoder" dump1090_device_serial_title="Enter the Dump1090 RTL-SDR Device Serial" while [[ -z $dump1090_device_serial ]] ; do - dump1090_device_serial=$(whiptail --backtitle "FlightAware Dump978 Configuration" \ - --title "${dump1090_device_serial_title}" \ - --inputbox "\nEnter the serial number for your dump1090 RTL-SDR device." \ - 8 78) + dump1090_device_serial=$(whiptail --backtitle "FlightAware Dump978 Configuration" \ + --title "${dump1090_device_serial_title}" \ + --inputbox "\nEnter the serial number for your dump1090 RTL-SDR device." \ + 8 78 3>&1 1>&2 2>&3) if [[ $dump1090_device_serial == 0 ]]; then LogAlertHeading "INSTALLATION HALTED" LogAlertMessage "Setup has been halted due to lack of required information" @@ -64,12 +67,13 @@ if [[ "${adsb_decoder_installed}" == "true" ]]; then dump1090_device_serial_title="Enter the Dump1090 RTL-SDR Device Serial (REQUIRED)" done + LogMessage "Asking the user to assign a RTL-SDR device serial number to dump978-fa" dump978_device_serial_title="Enter the Dump978 RTL-SDR Device Serial" - while [[ -z $dump1090_device_serial ]] ; do - dump978_device_serial=$(whiptail --backtitle "FlightAware Dump978 Configuration" \ - --title "${dump978_device_serial_title}" \ - --inputbox "\nEnter the serial number for your dump978 RTL-SDR device." \ - 8 78) + while [[ -z $dump978_device_serial ]] ; do + dump978_device_serial=$(whiptail --backtitle "FlightAware Dump978 Configuration" \ + --title "${dump978_device_serial_title}" \ + --inputbox "\nEnter the serial number for your dump978 RTL-SDR device." \ + 8 78 3>&1 1>&2 2>&3) if [[ $dump978_device_serial == 0 ]]; then LogAlertHeading "INSTALLATION HALTED" LogAlertMessage "Setup has been halted due to lack of required information" @@ -118,7 +122,7 @@ if [[ -d $RECEIVER_BUILD_DIRECTORY/dump978-fa/dump978 && -d $RECEIVER_BUILD_DIRE else LogMessage "Creating the FlightAware dump978 Project build directory" echo "" - mkdir -v $RECEIVER_BUILD_DIRECTORY/dump1090-fa 2>&1 | tee -a $RECEIVER_LOG_FILE + mkdir -v $RECEIVER_BUILD_DIRECTORY/dump978-fa 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" LogMessage "Entering the ADS-B Receiver Project build directory" cd $RECEIVER_BUILD_DIRECTORY/dump978-fa @@ -126,7 +130,6 @@ else echo "" git clone https://github.com/flightaware/dump978.git 2>&1 | tee -a $RECEIVER_LOG_FILE fi -echo "" ## BUILD AND INSTALL THE DUMP978-FA and SKYAWARE978 PACKAGES @@ -141,10 +144,14 @@ echo "" dpkg-buildpackage -b 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" -LogMessage "Installing the dump1090-fa Debian package" +LogMessage "Installing the dump978-fa Debian package" +echo "" sudo dpkg -i $RECEIVER_BUILD_DIRECTORY/dump978-fa/dump978-fa_${DUMP978_FA_VERSION}_*.deb 2>&1 | tee -a $RECEIVER_LOG_FILE +echo "" LogMessage "Installing the skyaware978 Debian package" -sudo dpkg -i $$RECEIVER_BUILD_DIRECTORY/dump978-fa/skyaware978_${DUMP978_FA_VERSION}_*.deb 2>&1 | tee -a $RECEIVER_LOG_FILE +echo "" +sudo dpkg -i $RECEIVER_BUILD_DIRECTORY/dump978-fa/skyaware978_${DUMP978_FA_VERSION}_*.deb 2>&1 | tee -a $RECEIVER_LOG_FILE +echo "" LogMessage "Checking that the dump978-fa Debian package was installed" if [[ $(dpkg-query -W -f='${STATUS}' dump978-fa 2>/dev/null | grep -c "ok installed") -eq 0 ]]; then @@ -184,12 +191,11 @@ if [[ ! -d $RECEIVER_BUILD_DIRECTORY/package-archive ]]; then fi LogMessage "Copying the dump978-fa Debian package into the Debian package archive directory" echo "" -cp -vf $RECEIVER_BUILD_DIRECTORY/piaware_builder/*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ 2>&1 | tee -a $RECEIVER_LOG_FILE +cp -vf $RECEIVER_BUILD_DIRECTORY/dump978-fa/dump978-fa_*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" LogMessage "Copying the skyaware978 Debian package into the Debian package archive directory" echo "" -cp -vf $RECEIVER_BUILD_DIRECTORY/piaware_builder/*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ 2>&1 | tee -a $RECEIVER_LOG_FILE -echo "" +cp -vf $RECEIVER_BUILD_DIRECTORY/dump978-fa/skyaware978_*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ 2>&1 | tee -a $RECEIVER_LOG_FILE ## CONFIGURATION @@ -201,13 +207,13 @@ if [[ "${adsb_decoder_installed}" == "true" ]]; then LogMessage "Assigning RTL-SDR device with serial ${dump978_device_serial} to dump978-fa" sudo sed -i -e "s/driver=rtlsdr/driver=rtlsdr,serial=${dump978_device_serial}/g" /etc/default/dump978-fa LogMessage "Restarting dump978-fa...\e[97m" - sudo servicectl restart dump978-fa + sudo systemctl restart dump978-fa - if [[ $(dpkg-query -W -f='${STATUS}' dump1090-fa 2>/dev/null | grep -c "ok installed") -eq 1 ]]; then + if [[ $(dpkg-query -W -f='${STATUS}' dump978-fa 2>/dev/null | grep -c "ok installed") -eq 1 ]]; then LogMessage "Assigning RTL-SDR device with serial ${dump1090_device_serial} to the FlightAware Dump1090 decoder" ChangeConfig "RECEIVER_SERIAL" $dump1090_device_serial "/etc/default/dump1090-fa" LogMessage "Restarting dump1090-fa" - sudo servicectl restart dump1090-fa + sudo systemctl restart dump1090-fa fi fi diff --git a/bash/main.sh b/bash/main.sh index 9148f228..6a3a4e89 100755 --- a/bash/main.sh +++ b/bash/main.sh @@ -5,9 +5,6 @@ source ${RECEIVER_BASH_DIRECTORY}/variables.sh source ${RECEIVER_BASH_DIRECTORY}/functions.sh -## Set the project title variable. -export RECEIVER_PROJECT_TITLE="The ADS-B Receiver Project v${PROJECT_VERSION} Installer" - ############### ## FUNCTIONS From 87d6bb64f8da862abf22e1e2f4c2d466ae2d442e Mon Sep 17 00:00:00 2001 From: jprochazka Date: Mon, 22 Jul 2024 19:06:11 -0400 Subject: [PATCH 20/26] Fixes to PiAware installer. --- .gitignore | 1 + bash/feeders/piaware.sh | 5 ++--- bash/main.sh | 8 ++------ 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index f7820000..a9ff86d4 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,6 @@ EXTRAS_CHOICES FEEDER_CHOICES build/dump1090* build/dump978* +build/piaware_builder/ build/package-archive logs/ diff --git a/bash/feeders/piaware.sh b/bash/feeders/piaware.sh index 8455cd7d..2dcec3f1 100755 --- a/bash/feeders/piaware.sh +++ b/bash/feeders/piaware.sh @@ -21,11 +21,11 @@ clear LogProjectTitle LogTitleHeading "Setting up the FlightAware PiAware client" LogTitleMessage "------------------------------------------------------------------------------" -echo "" if ! 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; then +echo "" LogAlertHeading "INSTALLATION HALTED" LogAlertMessage "Setup has been halted at the request of the user" echo "" @@ -167,9 +167,8 @@ else cd $RECEIVER_BUILD_DIRECTORY LogMessage "Cloning the piaware_builder git repository locally" echo "" - git clone https://github.com/flightaware/dump978.git 2>&1 | tee -a $RECEIVER_LOG_FILE + git clone https://github.com/flightaware/piaware_builder.git 2>&1 | tee -a $RECEIVER_LOG_FILE fi -echo "" ## BUILD AND INSTALL THE PIAWARE CLIENT PACKAGE diff --git a/bash/main.sh b/bash/main.sh index 6a3a4e89..5e2b17d6 100755 --- a/bash/main.sh +++ b/bash/main.sh @@ -245,12 +245,8 @@ fi # Check for the PiAware package. 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 - if [[ -z "${PIAWARE_INSTALL}" && "${PIAWARE_INSTALL}" = "true" ]]; then - echo "FlightAware PiAware" >> ${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES - fi - fi + # The OpenSky Network feeder package appears to not be installed. + FEEDER_LIST=("${FEEDER_LIST[@]}" 'FlightAware PiAware' '' OFF) 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 From a9569d4722e2d0bb3da2a98f85ef5b82e41b3c5d Mon Sep 17 00:00:00 2001 From: jprochazka Date: Mon, 22 Jul 2024 19:54:38 -0400 Subject: [PATCH 21/26] Additional logging testing and debugging. --- .gitignore | 7 +++++-- bash/feeders/flyitalyadsb.sh | 12 ++++-------- bash/feeders/openskynetwork.sh | 4 +++- bash/feeders/piaware.sh | 1 - bash/feeders/planefinder.sh | 5 +++-- 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index a9ff86d4..a96c7bef 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,9 @@ EXTRAS_CHOICES FEEDER_CHOICES build/dump1090* build/dump978* -build/piaware_builder/ +build/flightradar24 +build/flyitalyadsb +build/piaware_builder +build/planefinder build/package-archive -logs/ +logs diff --git a/bash/feeders/flyitalyadsb.sh b/bash/feeders/flyitalyadsb.sh index e1754428..45093010 100755 --- a/bash/feeders/flyitalyadsb.sh +++ b/bash/feeders/flyitalyadsb.sh @@ -9,11 +9,11 @@ clear LogProjectTitle LogTitleHeading "Setting up the Fly Italy ADS-B client" LogTitleMessage "------------------------------------------------------------------------------" -echo "" if ! whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ --title "Fly Italy ADS-B feeder client Setup" \ --yesno "The Fly Italy ADS-B feeder client takes data from a local dump1090 instance and shares this with Fly Italy ADS-B. for more information please see their website:\n\n https://flyitalyadsb.com/come-condividere-la-propria-antenna/\n\nContinue setup by installing the Fly Italy ADS-B feeder client?" \ 13 78; then + echo "" LogAlertHeading "INSTALLATION HALTED" LogAlertMessage "Setup has been halted at the request of the user" echo "" @@ -45,26 +45,22 @@ cd $RECEIVER_BUILD_DIRECTORY/flyitalyadsb LogMessage "Downloading the Fly Italy ADS-B installation script" echo "" -wget -v -O $RECEIVER_BUILD_DIRECTORY/flyitalyadsb/install.sh wget https://raw.githubusercontent.com/flyitalyadsb/mlat-client/master/scripts/install.sh 2>&1 | tee -a $RECEIVER_LOG_FILE -echo "" +wget -v -O $RECEIVER_BUILD_DIRECTORY/flyitalyadsb/install.sh https://raw.githubusercontent.com/flyitalyadsb/fly-italy-adsb/master/install.sh 2>&1 | tee -a $RECEIVER_LOG_FILE LogMessage "Executing the Fly Italy ADS-B feeder installation script" echo "" sudo bash $RECEIVER_BUILD_DIRECTORY/flyitalyadsb/install.sh -echo "" LogMessage "Asking if the user wishes to install the Fly Italy ADS-B updater" if whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ --title "Install The Fly Italy ADS-B Updater" \ --yesno "It is recommended that the Fly Italy ADS-B updater be installed as well.\n\nWould you like to install the updater at this time?" \ - 12 78; + 12 78; then LogMessage "Downloading the Fly Italy ADS-B updater script" echo "" - wget -v -O $RECEIVER_BUILD_DIRECTORY/flyitalyadsb/install_updater.sh wget https://raw.githubusercontent.com/flyitalyadsb/mlat-client/master/scripts/install_updater.sh 2>&1 | tee -a $RECEIVER_LOG_FILE - echo "" + wget -v -O $RECEIVER_BUILD_DIRECTORY/flyitalyadsb/install_updater.sh https://raw.githubusercontent.com/flyitalyadsb/mlat-client/master/scripts/install_updater.sh 2>&1 | tee -a $RECEIVER_LOG_FILE LogMessage "Executing the Fly Italy ADS-B feeder updater script" echo "" sudo bash $RECEIVER_BUILD_DIRECTORY/flyitalyadsb/install_updater.sh - echo "" fi diff --git a/bash/feeders/openskynetwork.sh b/bash/feeders/openskynetwork.sh index f06986a8..8ed74e3a 100755 --- a/bash/feeders/openskynetwork.sh +++ b/bash/feeders/openskynetwork.sh @@ -69,7 +69,9 @@ echo "" sudo apt-get update 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" LogMessage "Installing the OpenSky Network fedder package using apt" -CheckPackage opensky-feeder +echo "" +sudo apt-get install opensky-feeder +echo "" ## SETUP COMPLETE diff --git a/bash/feeders/piaware.sh b/bash/feeders/piaware.sh index 2dcec3f1..7379ac6f 100755 --- a/bash/feeders/piaware.sh +++ b/bash/feeders/piaware.sh @@ -230,7 +230,6 @@ else LogMessage "Copying the FlightAware PiAware client binary package into the archive directory" echo "" cp -vf $RECEIVER_BUILD_DIRECTORY/piaware_builder/*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ 2>&1 | tee -a $RECEIVER_LOG_FILE - echo "" fi diff --git a/bash/feeders/planefinder.sh b/bash/feeders/planefinder.sh index aad7e569..0ff95cd5 100755 --- a/bash/feeders/planefinder.sh +++ b/bash/feeders/planefinder.sh @@ -9,11 +9,11 @@ clear LogProjectTitle LogTitleHeading "Setting up the PlaneFinder client" LogTitleMessage "------------------------------------------------------------------------------" -echo "" if ! 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; then + echo "" LogAlertHeading "INSTALLATION HALTED" LogAlertMessage "Setup has been halted at the request of the user" echo "" @@ -85,7 +85,8 @@ cd $RECEIVER_BUILD_DIRECTORY/planefinder LogMessage "Downloading the appropriate PlaneFinder client Debian package" echo "" -wget -v -O --no-check-certificate http://client.planefinder.net/$PACKAGE_NAME $RECEIVER_BUILD_DIRECTORY/planefinder/$PACKAGE_NAME 2>&1 | tee -a $RECEIVER_LOG_FILE +wget -v -O $RECEIVER_BUILD_DIRECTORY/planefinder/$package_name http://client.planefinder.net/$package_name 2>&1 | tee -a $RECEIVER_LOG_FILE +echo "" LogMessage "Installing the PlaneFinder Client Debian package" echo -e "" From 3be72462daf5a19a36ae9e28078717473de11a24 Mon Sep 17 00:00:00 2001 From: jprochazka Date: Tue, 23 Jul 2024 14:45:59 -0400 Subject: [PATCH 22/26] Main.sh and miscellaneous clean up. --- CHANGELOG.md | 3 +- README.md | 4 +- bash/decoders/dump1090-fa.sh | 4 +- bash/extras/beastsplitter.sh | 2 +- bash/extras/duckdns.sh | 2 +- bash/feeders/adsbexchange.sh | 2 +- bash/feeders/airplaneslive.sh | 2 +- bash/feeders/flightradar24.sh | 3 +- bash/feeders/openskynetwork.sh | 2 +- bash/feeders/piaware.sh | 2 +- bash/functions.sh | 64 ++-- bash/init.sh | 5 +- bash/main.sh | 661 ++++++++++++++------------------- bash/variables.sh | 43 ++- 14 files changed, 342 insertions(+), 457 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0bff24bf..bf4db2bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,9 +8,10 @@ The following is a history of the changes made to this project. * The installation of PiAware is no longer required when choosing to install dump1090-fa. * The dump1090-fa installation script now mimics the current dump1090-fa installation instructions. * All scripts excluding those related to the portal now utilize the new logging functions. -* Logging to the logs directory is enabled by default but can be disabled with --no-log or -n. +* Logging to the logs directory is enabled by default but can be disabled with --no-logging or -n. * Added variables which can be modified to adjust text colors used by the bash scripts. * Added the --version and -v arguments in order to display the current project version. +* Additional script cleanup done to various files. * Removed scripting used for image setup. ## v2.8.4 *(July 13th, 2024)* :rooster: diff --git a/README.md b/README.md index 8a3f7976..a6d16a2c 100644 --- a/README.md +++ b/README.md @@ -70,10 +70,10 @@ When setting up the portal you will have to choose between a lite or advanced in The project currently supports the following Linux distributions. -* Armbian _(Bookworm and Jammy)_ +* Armbian _(Bookworm, Jammy and Noble)_ * Debian _(Bookworm and Bullseye)_ * DietPi _(Bookworm aand Bullseye)_ * Rasbperry PI OS _(Bookworm and Bullseye)_ * Ubuntu _(Jammy Jellyfish, Focal Fossa and Noble Numbat)_ -_Support is available via this repository through the use of the issue tracker or discussions._ +_Support is available via this repository through the use of the issue tracker or discussions._ \ No newline at end of file diff --git a/bash/decoders/dump1090-fa.sh b/bash/decoders/dump1090-fa.sh index 056f8d95..394f9c16 100755 --- a/bash/decoders/dump1090-fa.sh +++ b/bash/decoders/dump1090-fa.sh @@ -16,8 +16,8 @@ if ! whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ --title "FlightAware Dump1090 Decoder Setup" \ --yesno "FlightAware Dump1090 is an ADS-B, Mode S, and Mode 3A/3C demodulator and decoder that will receive and decode aircraft transponder messages received via a directly connected software defined radio, or from data provided over a network connection.\n\nWebsite: https://www.flightaware.com/\nGitHub Repository: https://github.com/flightaware/dump1090\n\nWould you like to begin the setup process now?" \ 14 78; then -echo "" -LogAlertHeading "INSTALLATION HALTED" + echo "" + LogAlertHeading "INSTALLATION HALTED" LogAlertMessage "Setup has been halted at the request of the user" echo "" LogTitleMessage "------------------------------------------------------------------------------" diff --git a/bash/extras/beastsplitter.sh b/bash/extras/beastsplitter.sh index 55228446..ff299ab7 100755 --- a/bash/extras/beastsplitter.sh +++ b/bash/extras/beastsplitter.sh @@ -9,11 +9,11 @@ clear LogProjectTitle LogTitleHeading "Setting up beast-splitter" LogTitleMessage "------------------------------------------------------------------------------" -echo "" if ! 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; then + echo "" echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m" echo -e " Setup has been halted at the request of the user." echo -e "" diff --git a/bash/extras/duckdns.sh b/bash/extras/duckdns.sh index b6070300..d3c71ee9 100755 --- a/bash/extras/duckdns.sh +++ b/bash/extras/duckdns.sh @@ -9,11 +9,11 @@ clear LogProjectTitle LogTitleHeading "Setting up Duck DNS" LogTitleMessage "------------------------------------------------------------------------------" -echo "" if ! 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; then + echo "" LogAlertHeading "INSTALLATION HALTED" LogAlertMessage "Setup has been halted at the request of the user" echo "" diff --git a/bash/feeders/adsbexchange.sh b/bash/feeders/adsbexchange.sh index 4ab4dee0..ed35e571 100755 --- a/bash/feeders/adsbexchange.sh +++ b/bash/feeders/adsbexchange.sh @@ -9,11 +9,11 @@ clear LogProjectTitle LogTitleHeading "Setting up the ADS-B Exchange client" LogTitleMessage "------------------------------------------------------------------------------" -echo "" if ! 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; then + echo "" LogAlertHeading "INSTALLATION HALTED" LogAlertMessage "Setup has been halted at the request of the user" echo "" diff --git a/bash/feeders/airplaneslive.sh b/bash/feeders/airplaneslive.sh index eae4f005..5030bd76 100755 --- a/bash/feeders/airplaneslive.sh +++ b/bash/feeders/airplaneslive.sh @@ -9,11 +9,11 @@ clear LogProjectTitle LogTitleHeading "Setting up the Airplanes.live client" LogTitleMessage "------------------------------------------------------------------------------" -echo "" if ! whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ --title "Airplanes.live Feeder Client Setup" \ --yesno "The airplanes.live feeder client takes data from a local dump1090 instance and shares this with airplanes.live. for more information please see their website:\n\n https://airplanes.live/how-to-feed/\n\nContinue setup by installing the airplanes.live feeder client?" \ 13 78; then + echo "" LogAlertHeading "INSTALLATION HALTED" LogAlertMessage "Setup has been halted at the request of the user" echo "" diff --git a/bash/feeders/flightradar24.sh b/bash/feeders/flightradar24.sh index 46efc76d..4b5d11ff 100755 --- a/bash/feeders/flightradar24.sh +++ b/bash/feeders/flightradar24.sh @@ -9,12 +9,11 @@ clear LogProjectTitle LogTitleHeading "Setting up the FlightRadar24 client" LogTitleMessage "------------------------------------------------------------------------------" -echo "" - if ! 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; then + echo "" LogAlertHeading "INSTALLATION HALTED" LogAlertMessage "Setup has been halted at the request of the user" echo "" diff --git a/bash/feeders/openskynetwork.sh b/bash/feeders/openskynetwork.sh index 8ed74e3a..60d47145 100755 --- a/bash/feeders/openskynetwork.sh +++ b/bash/feeders/openskynetwork.sh @@ -9,11 +9,11 @@ clear LogProjectTitle LogTitleHeading "Setting up the OpenSky Network client" LogTitleMessage "------------------------------------------------------------------------------" -echo "" if ! 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; then + echo "" LogAlertHeading "INSTALLATION HALTED" LogAlertMessage "Setup has been halted at the request of the user" echo "" diff --git a/bash/feeders/piaware.sh b/bash/feeders/piaware.sh index 7379ac6f..cb23a20b 100755 --- a/bash/feeders/piaware.sh +++ b/bash/feeders/piaware.sh @@ -25,7 +25,7 @@ if ! 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; then -echo "" + echo "" LogAlertHeading "INSTALLATION HALTED" LogAlertMessage "Setup has been halted at the request of the user" echo "" diff --git a/bash/functions.sh b/bash/functions.sh index 3e989d4f..21c9912e 100755 --- a/bash/functions.sh +++ b/bash/functions.sh @@ -3,7 +3,7 @@ ## LOGGING FUNCTIONS # LogToFile -function LogToFile { +function LogToFile() { if [[ "${RECEIVER_LOGGING_ENABLED}" == "true" ]]; then time_stamp='' if [[ -z $2 || "${2}" == "true" ]]; then @@ -18,86 +18,86 @@ function LogToFile { fi } -function LogOutput { +function LogOutput() { LogToFile "${1}" } # Logs the "PROJECT TITLE" to the console function LogProjectTitle { LogToFile "${RECEIVER_PROJECT_TITLE}" - echo -e "${DISPLAY_PROJECT_NAME} ${RECEIVER_PROJECT_TITLE}${DISPLAY_DEFAULT}" + echo -e "${display_project_name} ${RECEIVER_PROJECT_TITLE}${display_default}" echo "" } # Logs a "HEADING" to the console -function LogHeading { +function LogHeading() { LogToFile "${1}" echo "" - echo -e "${DISPLAY_HEADING} ${1}${DISPLAY_DEFAULT}" + echo -e "${display_heading} ${1}${display_default}" echo "" } # Logs a "MESSAGE" to the console -function LogMessage { +function LogMessage() { LogToFile "${1}" - echo -e "${DISPLAY_MESSAGE} ${1}${DISPLAY_DEFAULT}" + echo -e "${display_message} ${1}${display_default}" } # Logs an alert "HEADING" to the console -function LogAlertHeading { +function LogAlertHeading() { LogToFile "${1}" - echo -e "${DISPLAY_ALERT_HEADING} ${1}${DISPLAY_DEFAULT}" + echo -e "${display_alert_heading} ${1}${display_default}" } # Logs an alert "MESSAGE" to the console -function LogAlertMessage { +function LogAlertMessage() { LogToFile "${1}" - echo -e "${DISPLAY_ALERT_MESSAGE} ${1}${DISPLAY_DEFAULT}" + echo -e "${display_alert_message} ${1}${display_default}" } # Logs an title "HEADING" to the console -function LogTitleHeading { +function LogTitleHeading() { LogToFile "${1}" - echo -e "${DISPLAY_TITLE_HEADING} ${1}${DISPLAY_DEFAULT}" + echo -e "${display_title_heading} ${1}${display_default}" } # Logs an title "MESSAGE" to the console -function LogTitleMessage { +function LogTitleMessage() { LogToFile "${1}" - echo -e "${DISPLAY_TITLE_MESSAGE} ${1}${DISPLAY_DEFAULT}" + echo -e "${display_title_message} ${1}${display_default}" } # Logs a warning "HEADING" to the console -function LogWarningHeading { +function LogWarningHeading() { LogToFile "${1}" - echo -e "${DISPLAY_WARNING_HEADING} ${1}${DISPLAY_DEFAULT}" + echo -e "${display_warning_heading} ${1}${display_default}" } # Logs a warning "MESSAGE" to the console -function LogWarningMessage { +function LogWarningMessage() { LogToFile "${1}" - echo -e "${DISPLAY_WARNING_MESSAGE} ${1}${DISPLAY_DEFAULT}" + echo -e "${display_warning_message} ${1}${display_default}" } -function LogMessageInline { +function LogMessageInline() { LogToFile "${1}" "true" "inline" - printf "${DISPLAY_MESSAGE} ${1}${DISPLAY_DEFAULT}" + printf "${display_message} ${1}${display_default}" } -function LogFalseInline { +function LogFalseInline() { LogToFile "${1}" "false" - echo -e "${DISPLAY_FALSE_INLINE} ${1}${DISPLAY_DEFAULT}" + echo -e "${display_false_inline} ${1}${display_default}" } -function LogTrueInline { +function LogTrueInline() { LogToFile "${1}" "false" - echo -e "${DISPLAY_TRUE_INLINE} ${1}${DISPLAY_DEFAULT}" + echo -e "${display_true_inline} ${1}${display_default}" } ## CHECK IF THE SUPPLIED PACKAGE IS INSTALLED AND IF NOT ATTEMPT TO INSTALL IT -function CheckPackage { +function CheckPackage() { attempt=1 max_attempts=5 wait_time=5 @@ -134,7 +134,7 @@ function CheckPackage { ## BLACKLIST DVB-T DRIVERS FOR RTL-SDR DEVICES -function BlacklistModules { +function BlacklistModules() { if [[ ! -f /etc/modprobe.d/rtlsdr-blacklist.conf || `cat /etc/modprobe.d/rtlsdr-blacklist.conf | wc -l` < 9 ]]; then LogMessage "Blacklisting unwanted RTL-SDR kernel modules so they are not loaded" sudo tee /etc/modprobe.d/rtlsdr-blacklist.conf > /dev/null <&1 | tee -a $RECEIVER_LOG_FILE diff --git a/bash/main.sh b/bash/main.sh index 5e2b17d6..75f6092c 100755 --- a/bash/main.sh +++ b/bash/main.sh @@ -5,551 +5,436 @@ source ${RECEIVER_BASH_DIRECTORY}/variables.sh source ${RECEIVER_BASH_DIRECTORY}/functions.sh -############### -## FUNCTIONS -## DECODERS - -# Execute the dump1090-fa setup script. -function InstallDump1090Fa() { - chmod +x ${RECEIVER_BASH_DIRECTORY}/decoders/dump1090-fa.sh - ${RECEIVER_BASH_DIRECTORY}/decoders/dump1090-fa.sh - if [[ $? -ne 0 ]] ; then - exit 1 +## 1090MHZ DECODERS + +# FlightAware dump1090 +install_1090mhz_decoder="false" +if [[ $(dpkg-query -W -f='${STATUS}' dump1090-fa 2>/dev/null | grep -c "ok installed") == 1 ]] ; then + chosen_1090mhz_decoder="dump1090-fa" + if [[ $(sudo dpkg -s dump1090-fa 2>/dev/null | grep -c "Version: ${dump1090-fa_current_version}") == 0 ]] ; then + whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ + --title "FlightAware Dump1090 Upgrade Available" \ + --defaultno \ + --yesno "An updated version of FlightAware dump1090 is available.\n\nWould you like to install the new version?" \ + 16 65 + if [[ $? == 0 ]]; then + install_1090mhz_decoder="true" + fi fi -} - -# Execute the dump978 setup script. -function InstallDump978Fa() { - chmod +x ${RECEIVER_BASH_DIRECTORY}/decoders/dump978-fa.sh - ${RECEIVER_BASH_DIRECTORY}/decoders/dump978-fa.sh - if [[ $? -ne 0 ]] ; then - exit 1 +else + whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ + --title "FlightAware dump978" \ + --defaultno \ + --yesno "FlightAware dump1090 is capable of demodulating ADS-B, Mode S, Mode 3A/3C signals received by an SDR device.\n\nGitHub Repository: https://github.com/flightaware/dump1090\n\nWould you like to install FlightAware dump1090?" \ + 10 65 + if [[ $? == 0 ]]; then + install_978mhz_decoder="true" fi -} - -## FEEDERS +fi -# Execute the ADS-B Exchange setup script. -function InstallAdsbExchange() { - chmod +x ${RECEIVER_BASH_DIRECTORY}/feeders/adsbexchange.sh - ${RECEIVER_BASH_DIRECTORY}/feeders/adsbexchange.sh - if [[ $? -ne 0 ]] ; then +function install_dump1090-fa() { + ${RECEIVER_BASH_DIRECTORY}/decoders/dump1090-fa.sh + if [[ $? != 0 ]] ; then exit 1 fi } -# Execute the airplanes.live setup script. -function InstallAirplanesLive() { - chmod +x ${RECEIVER_BASH_DIRECTORY}/feeders/airplaneslive.sh - ${RECEIVER_BASH_DIRECTORY}/feeders/airplaneslive.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 - ${RECEIVER_BASH_DIRECTORY}/feeders/flightradar24.sh - if [[ $? -ne 0 ]] ; then - exit 1 +## 978MHZ DECODERS + +# Flightaware dump978 +install_978mhz_decoder="false" +if [[ $(dpkg-query -W -f='${STATUS}' dump978-fa 2>/dev/null | grep -c "ok installed") == 1 ]]; then + chosen_978mhz_decoder="dump978-fa" + if [[ $(sudo dpkg -s dump978-fa 2>/dev/null | grep -c "Version: ${dump978-fa_current_version}") == 0 ]]; then + whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ + --title "FlightAware dump978 Upgrade Available" \ + --defaultno --yesno "An updated version of FlightAware dump978 is available.\n\nWould you like to install the new version?" \ + 16 65 + if [[ $? == 0 ]]; then + install_978mhz_decoder="true" + fi fi -} - -# Execute the Fly Italy ADS-B Feeder client setup script. -function InstallFlyItalyAdsb() { - chmod +x ${RECEIVER_BASH_DIRECTORY}/feeders/flyitalyadsb.sh - ${RECEIVER_BASH_DIRECTORY}/feeders/flyitalyadsb.sh - if [[ $? -ne 0 ]] ; then - exit 1 +else + whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ + --title "FlightAware dump978" \ + --defaultno \ + --yesno "FlightAware dump978 is capable of demodulating UAT received by an SDR device.\n\nGitHub Repository: https://github.com/flightaware/dump978\n\nWould you like to install FlightAware dump978?" \ + 10 65 + if [[ $? == 0 ]]; then + install_978mhz_decoder="true" fi -} +fi -# Execute the OpenSky Network setup script. -function InstallOpenSkyNetwork() { - chmod +x ${RECEIVER_BASH_DIRECTORY}/feeders/openskynetwork.sh - ${RECEIVER_BASH_DIRECTORY}/feeders/openskynetwork.sh - if [[ $? -ne 0 ]] ; then +function install_dump978-fa() { + ${RECEIVER_BASH_DIRECTORY}/decoders/dump978-fa.sh + if [[ $? != 0 ]] ; then exit 1 fi } -# Execute the PiAware setup script -function InstallPiAware() { - chmod +x ${RECEIVER_BASH_DIRECTORY}/feeders/piaware.sh - ${RECEIVER_BASH_DIRECTORY}/feeders/piaware.sh - if [[ $? -ne 0 ]] ; then - exit 1 - fi -} +## AGGREGATE SITE CLIENTS -# Execute the Plane Finder Client setup script. -function InstallPlaneFinder() { - chmod +x ${RECEIVER_BASH_DIRECTORY}/feeders/planefinder.sh - ${RECEIVER_BASH_DIRECTORY}/feeders/planefinder.sh - if [[ $? -ne 0 ]] ; then +declare array feeder_list +touch ${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES + +# ADS-B Exchange +if [[ -f /lib/systemd/system/adsbexchange-mlat.service && -f /lib/systemd/system/adsbexchange-feed.service ]]; then + echo "ADS-B Exchange Feed Client (reinstall)" >> ${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES + feeder_list=("${feeder_list[@]}" 'ADS-B Exchange Feed Client (reinstall)' '' OFF) +else + echo "ADS-B Exchange Feed Client" >> ${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES + feeder_list=("${feeder_list[@]}" 'ADS-B Exchange Feed Client' '' OFF) +fi +function install_adsbexchange_client() { + ${RECEIVER_BASH_DIRECTORY}/feeders/adsbexchange.sh + if [[ $? != 0 ]] ; then exit 1 fi } -## Portal +# Airplanes.live +if [[ -f /lib/systemd/system/airplanes-feed.service && -f /lib/systemd/system/airplanes-mlat.service ]]; then + echo "Airplanes.live Feeder (reinstall)" >> ${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES + feeder_list=("${feeder_list[@]}" 'Airplanes.live Feeder (reinstall)' '' OFF) +else + echo "Airplanes.live Feeder" >> ${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES + feeder_list=("${feeder_list[@]}" 'Airplanes.live Feeder' '' OFF) +fi -# Execute the ADS-B Receiver Project Web Portal setup script. -function InstallWebPortal() { - chmod +x ${RECEIVER_BASH_DIRECTORY}/portal/install.sh - ${RECEIVER_BASH_DIRECTORY}/portal/install.sh - if [[ $? -ne 0 ]] ; then +function install_airplaneslive_client() { + ${RECEIVER_BASH_DIRECTORY}/feeders/airplaneslive.sh + if [[ $? != 0 ]] ; then exit 1 fi } -## Extras - -# Execute the beast-splitter setup script. -function InstallBeastSplitter() { - chmod +x ${RECEIVER_BASH_DIRECTORY}/extras/beeastsplitter.sh - ${RECEIVER_BASH_DIRECTORY}/extras/beastsplitter.sh - if [[ $? -ne 0 ]] ; then - exit 1 +# FlightAware PiAware +if [[ $(dpkg-query -W -f='${STATUS}' piaware 2>/dev/null | grep -c "ok installed") == 0 ]]; then + feeder_list=("${feeder_list[@]}" 'FlightAware PiAware' '' OFF) +else + if [[ $(sudo dpkg -s piaware 2>/dev/null | grep -c "Version: ${piaware_current_version}") == 0 ]]; then + feeder_list=("${feeder_list[@]}" 'FlightAware PiAware (upgrade)' '' OFF) + else + feeder_list=("${feeder_list[@]}" 'FlightAware PiAware (reinstall)' '' OFF) fi -} +fi -# Execute the Duck DNS setup script. -function InstallDuckDns() { - chmod +x ${RECEIVER_BASH_DIRECTORY}/extras/duckdns.sh - ${RECEIVER_BASH_DIRECTORY}/extras/duckdns.sh - if [[ $? -ne 0 ]] ; then +function install_flightaware_client() { + ${RECEIVER_BASH_DIRECTORY}/feeders/piaware.sh + if [[ $? != 0 ]] ; then exit 1 fi } -############# -## DIALOGS - -## Decoders - -# 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: ${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" - ;; - 1) - DUMP1090_DO_UPGRADE="false" - ;; - esac +# Flightradar24 +if [[ $(dpkg-query -W -f='${STATUS}' fr24feed 2>/dev/null | grep -c "ok installed") == 0 ]]; then + feeder_list=("${feeder_list[@]}" 'Flightradar24 Client' '' OFF) +else + if [[ $(sudo dpkg -s fr24feed 2>/dev/null | grep -c "Version: ${fr24feed_current_version}") == 0 ]]; then + feeder_list=("${feeder_list[@]}" 'Flightradar24 Client (upgrade)' '' OFF) + else + feeder_list=("${feeder_list[@]}" 'Flightradar24 Client (reinstall)' '' OFF) fi fi -# If no dump1090 fork is installed then attempt to install one. -if [[ ! "${DUMP1090_IS_INSTALLED}" = "true" ]] ; then - DUMP1090_OPTION=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Choose Dump1090 Version To Install" --nocancel --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." 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" - ;; - *) - DUMP1090_DO_INSTALL="false" - ;; - esac -fi - -# 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" - 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" - ;; - 1) - DUMP978_DO_UPGRADE="false" - ;; - esac +function install_flightradar24_client() { + ${RECEIVER_BASH_DIRECTORY}/feeders/flightradar24.sh + if [[ $? != 0 ]] ; then + exit 1 fi -else - # Dump978 does not appear to be present on this device. - DUMP978_IS_INSTALLED="false" - 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" - ;; - 1) - DUMP978_DO_INSTALL="false" - ;; - esac -fi - -## Feeder Selection Menu - -# Declare the FEEDER_LIST array and the FEEDER_CHOICES file which will store choices for feeders which are available for install. -declare array FEEDER_LIST -touch ${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES - -# 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 (reinstall)" >> ${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES - FEEDER_LIST=("${FEEDER_LIST[@]}" 'ADS-B Exchange Feeder (reinstall)' '' OFF) -else - # 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 if the airplanes.live feeder has been set up. -if [[ -f /lib/systemd/system/airplanes-feed.service && -f /lib/systemd/system/airplanes-mlat.service ]]; then - # The feeder appears to be set up. - echo "Airplanes.live Feeder (reinstall)" >> ${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES - FEEDER_LIST=("${FEEDER_LIST[@]}" 'Airplanes.live Feeder (reinstall)' '' OFF) -else - # The feeder does not appear to be set up. - echo "Airplanes.live Feeder" >> ${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES - FEEDER_LIST=("${FEEDER_LIST[@]}" 'Airplanes.live Feeder' '' OFF) -fi +} -# Check if the Fly Italy ADS-B feeder has been set up. +# Fly Italy ADS-B if [[ -f /lib/systemd/system/flyitalyadsb-mlat.service && -f /lib/systemd/system/flyitalyadsb-feed.service ]]; then - # The feeder appears to be set up. echo "Fly Italy ADS-B Feeder (upgrade)" >> ${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES - FEEDER_LIST=("${FEEDER_LIST[@]}" 'Fly Italy ADS-B Feeder (upgrade)' '' OFF) + feeder_list=("${feeder_list[@]}" 'Fly Italy ADS-B Feeder (upgrade)' '' OFF) else - # The feeder does not appear to be set up. echo "Fly Italy ADS-B Feeder" >> ${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES - FEEDER_LIST=("${FEEDER_LIST[@]}" 'Fly Italy ADS-B Feeder' '' OFF) + feeder_list=("${feeder_list[@]}" 'Fly Italy ADS-B 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 - # The OpenSky Network feeder package appears to not be installed. - 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 - FEEDER_LIST=("${FEEDER_LIST[@]}" 'OpenSky Network Feeder (reinstall)' '' OFF) +function install_flyitalyadsb_client() { + ${RECEIVER_BASH_DIRECTORY}/feeders/flyitalyadsb.sh + if [[ $? != 0 ]] ; then + exit 1 fi -fi +} -# Check for the PiAware package. -if [[ $(dpkg-query -W -f='${STATUS}' piaware 2>/dev/null | grep -c "ok installed") -eq 0 ]]; then - # The OpenSky Network feeder package appears to not be installed. - FEEDER_LIST=("${FEEDER_LIST[@]}" 'FlightAware PiAware' '' OFF) +# OpenSky Network +if [[ $(dpkg-query -W -f='${STATUS}' opensky-feeder 2>/dev/null | grep -c "ok installed") == 0 ]]; then + feeder_list=("${feeder_list[@]}" 'OpenSky Network Feeder' '' OFF) 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 - FEEDER_LIST=("${FEEDER_LIST[@]}" 'FlightAware PiAware (upgrade)' '' OFF) + if [[ $(sudo dpkg -s opensky-feeder 2>/dev/null | grep -c "Version: ${opensky-feeder_current_version}") == 0 ]]; then + feeder_list=("${feeder_list[@]}" 'OpenSky Network Feeder (upgrade)' '' OFF) else - FEEDER_LIST=("${FEEDER_LIST[@]}" 'FlightAware PiAware (reinstall)' '' OFF) + feeder_list=("${feeder_list[@]}" 'OpenSky Network Feeder (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 - # 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 [[ $(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) +function install_openskynetwork_client() { + ${RECEIVER_BASH_DIRECTORY}/feeders/openskynetwork.sh + if [[ $? != 0 ]] ; then + exit 1 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 - # The Planefinder Client package does not appear to be installed. - FEEDER_LIST=("${FEEDER_LIST[@]}" 'Plane Finder Client' '' OFF) +# Planefinder +if [[ $(dpkg-query -W -f='${STATUS}' pfclient 2>/dev/null | grep -c "ok installed") == 0 ]]; then + feeder_list=("${feeder_list[@]}" 'Plane Finder Client' '' OFF) else - # Check if a newer version can be installed. - PLANEFINDER_CLIENT_INSTALLED_VERSION=$(sudo dpkg -s pfclient | grep Version | awk '{print $2}') + pfclient_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) + if [[ "$pfclient_installed_version" != "${pfclient_current_version_armhf}" ]]; then + feeder_list=("${feeder_list[@]}" 'Plane Finder Client (upgrade)' '' OFF) else - FEEDER_LIST=("${FEEDER_LIST[@]}" 'Plane Finder Client (reinstall)' '' OFF) + feeder_list=("${feeder_list[@]}" 'Plane Finder Client (reinstall)' '' OFF) fi ;; "aarch64") - if [[ ! "$PLANEFINDER_CLIENT_INSTALLED_VERSION" = "${PLANEFINDER_CLIENT_VERSION_ARM64}" ]]; then - FEEDER_LIST=("${FEEDER_LIST[@]}" 'Plane Finder Client (upgrade)' '' OFF) + if [[ "$pfclient_installed_version" != "${pfclient_current_version_arm64}" ]]; then + feeder_list=("${feeder_list[@]}" 'Plane Finder Client (upgrade)' '' OFF) else - FEEDER_LIST=("${FEEDER_LIST[@]}" 'Plane Finder Client (reinstall)' '' OFF) + feeder_list=("${feeder_list[@]}" 'Plane Finder Client (reinstall)' '' OFF) fi ;; "x86_64") - if [[ ! "$PLANEFINDER_CLIENT_INSTALLED_VERSION" = "${PLANEFINDER_CLIENT_VERSION_AMD64}" ]]; then - FEEDER_LIST=("${FEEDER_LIST[@]}" 'Plane Finder Client (upgrade)' '' OFF) + if [[ "$pfclient_installed_version" != "${pfclient_current_version_amd64}" ]]; then + feeder_list=("${feeder_list[@]}" 'Plane Finder Client (upgrade)' '' OFF) else - FEEDER_LIST=("${FEEDER_LIST[@]}" 'Plane Finder Client (reinstall)' '' OFF) + 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) + if [[ "$pfclient_installed_version" != "${pfclient_current_version_i386}" ]]; then + feeder_list=("${feeder_list[@]}" 'Plane Finder Client (upgrade)' '' OFF) else - FEEDER_LIST=("${FEEDER_LIST[@]}" 'Plane Finder Client (reinstall)' '' OFF) + feeder_list=("${feeder_list[@]}" 'Plane Finder Client (reinstall)' '' OFF) fi ;; *) - FEEDER_LIST=("${FEEDER_LIST[@]}" 'Plane Finder Client (reinstall)' '' OFF) + feeder_list=("${feeder_list[@]}" 'Plane Finder Client (reinstall)' '' OFF) esac 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." 15 65 7 "${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 +function install_planefinder_client() { + ${RECEIVER_BASH_DIRECTORY}/feeders/planefinder.sh + if [[ $? != 0 ]] ; then + exit 1 + fi +} -## ADS-B Receiver Project Web Portal +whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ + --title "Client Installation Options" \ + --checklist \ + --nocancel \ + --separate-output "The following clients are available for installation.\nChoose the clients you wish to install." \ + 15 65 7 "${feeder_list[@]}" 2>${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES + + +## PORTALS + +# ADS-B Portal +install_portal="false" +whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ + --title "Install The ADS-B Portal" \ + --defaultno \ + --yesno "The ADS-B Portal is a web interface for your receiver. More information can be found in the ADS-B Receiver Project GitHub repository.\n\nhttps://github.com/jprochazka/adsb-receiver\n\nWould you like to install the ADS-B Portal?" \ + 14 78 +if [[ $? == 0 ]]; then + install_portal="true" + +function install_adsb-portal() { + ${RECEIVER_BASH_DIRECTORY}/portal/install.sh + if [[ $? != 0 ]] ; then + exit 1 + 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 -# Declare the EXTRAS_LIST array and the EXTRAS_CHOICES file which will store choices for extras which are available for install. -declare array EXTRAS_LIST +declare array extras_list touch ${RECEIVER_ROOT_DIRECTORY}/EXTRAS_CHOICES -# 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 - # The beast-splitter package appears to not be installed. - EXTRAS_LIST=("${EXTRAS_LIST[@]}" 'beast-splitter' '' OFF) +# Beast-splitter +if [[ $(dpkg-query -W -f='${STATUS}' beast-splitter 2>/dev/null | grep -c "ok installed") == 0 ]]; then + extras_list=("${extras_list[@]}" 'beast-splitter' '' OFF) else - # Offer the option to build then reinstall the beast-splitter package. - EXTRAS_LIST=("${EXTRAS_LIST[@]}" 'beast-splitter (reinstall)' '' OFF) + extras_list=("${extras_list[@]}" 'beast-splitter (reinstall)' '' OFF) fi -# Check if the Duck DNS update script exists. +function install_beast-splitter() { + chmod +x ${RECEIVER_BASH_DIRECTORY}/extras/beeastsplitter.sh + ${RECEIVER_BASH_DIRECTORY}/extras/beastsplitter.sh + if [[ $? != 0 ]] ; then + exit 1 + fi +} + +# Duck DNS if [[ ! -f "${RECEIVER_BUILD_DIRECTORY}/duckdns/duck.sh" ]]; then # Duck DNS does not appear to be set up on this device. - EXTRAS_LIST=("${EXTRAS_LIST[@]}" 'Duck DNS Free Dynamic DNS Hosting' '' OFF) + extras_list=("${extras_list[@]}" 'Duck DNS Free Dynamic DNS Hosting' '' OFF) else # Offer the option to install/setup Duck DNS once more. - EXTRAS_LIST=("${EXTRAS_LIST[@]}" 'Duck DNS Free Dynamic DNS Hosting (reinstall)' '' OFF) + extras_list=("${extras_list[@]}" 'Duck DNS Free Dynamic DNS Hosting (reinstall)' '' OFF) 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 +function install_duck-dns() { + chmod +x ${RECEIVER_BASH_DIRECTORY}/extras/duckdns.sh + ${RECEIVER_BASH_DIRECTORY}/extras/duckdns.sh + if [[ $? -ne 0 ]] ; then + exit 1 + fi +} + +whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ + --title "Extras 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 + + ## Setup Confirmation -declare CONFIRMATION +declare confirmation_message -# 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" && "${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" - echo -e " Nothing was selected to do or be installed." - echo -e "\e[37m" +if [[ "${install_1090mhz_decoder}" == "false" && "${install_1090mhz_decoder}" == "false" && "${install_portal}" == "false" && ! -s "${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES" && ! -s "${RECEIVER_ROOT_DIRECTORY}/EXTRAS_CHOICES" ]]; then + 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 "" + LogAlertHeading "Nothing was selected to do or be installed" + echo "" exit 1 else - # The user decided to install software. - CONFIRMATION="The following software will be installed:\n" - - # dump1090 - if [[ "${DUMP1090_DO_UPGRADE}" = "true" ]]; then - case ${DUMP1090_FORK} in - "fa") - CONFIRMATION="${CONFIRMATION}\n * dump1090-fa (upgrade)" - ;; - esac - elif [[ "${DUMP1090_DO_INSTALL}" = "true" ]]; then - case ${DUMP1090_FORK} in - "fa") - CONFIRMATION="${CONFIRMATION}\n * dump1090-fa" + confirmation_message="The following software will be installed:\n" + + # 1090MHz decoders + if [[ "${install_1090mhz_decoder}" == "true" ]]; then + case ${chosen_1090mhz_decoder} in + "dump1090-fa") + confirmation_message="${confirmation_message}\n * FlightAware dump1090" ;; esac fi - # dump978 - if [[ "${DUMP978_DO_UPGRADE}" = "true" ]]; then - CONFIRMATION="${CONFIRMATION}\n * dump978 (rebuild)" - elif [[ "${DUMP978_DO_INSTALL}" = "true" ]]; then - CONFIRMATION="${CONFIRMATION}\n * dump978" + # 978MHz decoders + if [[ "${install_978mhz_decoder}" = "true" ]]; then + case ${chosen_978mhz_decoder} in + "dump978-fa") + confirmation_message="${confirmation_message}\n * FlightAware dump978" + ;; + esac fi + # Aggragate site clients if [[ -s "${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES" ]]; then - while read FEEDER_CHOICE + while read feeder_choice do - CONFIRMATION="${CONFIRMATION}\n * ${FEEDER_CHOICE}" + confirmation_message="${confirmation_message}\n * ${feeder_choice}" done < ${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES fi - if [[ "${WEBPORTAL_DO_INSTALL}" = "true" ]]; then - CONFIRMATION="${CONFIRMATION}\n * ADS-B Receiver Project Web Portal" + # Portals + if [[ "${WEBPORTAL_DO_INSTALL}" == "true" ]]; then + confirmation_message="${confirmation_message}\n * ADS-B Receiver Project Web Portal" fi + # Extras if [[ -s "${RECEIVER_ROOT_DIRECTORY}/EXTRAS_CHOICES" ]]; then - while read EXTRAS_CHOICE + while read extra_choice do - CONFIRMATION="${CONFIRMATION}\n * ${EXTRAS_CHOICE}" + confirmation_message="${confirmation_message}\n * ${extra_choice}" done < ${RECEIVER_ROOT_DIRECTORY}/EXTRAS_CHOICES fi - CONFIRMATION="${CONFIRMATION}\n\n" + confirmation_message="${confirmation_message}\n\n" 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." +confirmation_message="${confirmation_message}Do you wish to continue setup?" +if ! (whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Confirm You Wish To Continue" --yesno "${confirmation_message}" 21 78); then + echo "" + LogAlertHeading "Installation cancelled by user" + echo "" exit 1 fi -################# -## BEGIN SETUP -## Decoders +## BEGIN SETUP -if [[ "${DUMP1090_DO_INSTALL}" = "true" || "${DUMP1090_DO_UPGRADE}" = "true" ]]; then - case ${DUMP1090_FORK} in - "fa") - InstallDump1090Fa +# 1090MHz Decoders +if [[ "${install_1090mhz_decoder}" == "true" ]]; then + case ${chosen_1090mhz_decoder} in + "dump1090-fa") + install_dump1090-fa ;; esac fi -if [[ "${DUMP978_DO_INSTALL}" = "true" || "${DUMP978_DO_UPGRADE}" = "true" ]]; then - InstallDump978Fa +# 978MHz Decoders +if [[ "${install_978mhz_decoder}" == "true" ]]; then + case ${chosen_978mhz_decoder} in + "dump978-fa") + install_dump978-fa + ;; + esac fi -## Feeders - -# Moved execution of functions outside of while loop. -# Inside the while loop the installation scripts are not stopping at reads. - -RUN_ADSBEXCHANGE_SCRIPT="false" -RUN_PIAWARE_SCRIPT="false" -RUN_FLIGHTRADAR24_SCRIPT="false" -RUN_FLYITALYADSB_SCRIPT="false" -RUN_OPENSKYNETWORK_SCRIPT="false" -RUN_PLANEFINDER_SCRIPT="false" - +# Aggragate site clients if [[ -s "${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES" ]]; then - while read FEEDER_CHOICE + while read feeder_choice do - case ${FEEDER_CHOICE} in + case ${feeder_choice} in "ADS-B Exchange Feeder"|"ADS-B Exchange Feeder (reinstall)") - RUN_ADSBEXCHANGE_SCRIPT="true" + install_adsbexchange_client ;; "Airplanes.live Feeder"|"Airplanes.live Feeder (reinstall)") - RUN_AIRPLANESLIVE_SCRIPT="true" + install_airplaneslive_client ;; "FlightAware PiAware"|"FlightAware PiAware (upgrade)"|"FlightAware PiAware (reinstall)") - RUN_PIAWARE_SCRIPT="true" + install_flightaware_client ;; "Flightradar24 Client"|"Flightradar24 Client (upgrade)"|"Flightradar24 Client (reinstall)") - RUN_FLIGHTRADAR24_SCRIPT="true" + install_flightradar24_client ;; "Fly Italy ADS-B Feeder"|"Fly Italy ADS-B Feeder (upgrade)") - RUN_FLYITALYADSB_SCRIPT="true" + install_flyitalyadsb_client ;; "OpenSky Network Feeder") - RUN_OPENSKYNETWORK_SCRIPT="true" + install_openskynetwork_client ;; "Plane Finder Client"|"Plane Finder Client (upgrade)"|"Plane Finder Client (reinstall)") - RUN_PLANEFINDER_SCRIPT="true" + install_planefinder_client ;; esac done < ${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES fi -if [[ "${RUN_ADSBEXCHANGE_SCRIPT}" = "true" ]]; then - InstallAdsbExchange -fi - -if [[ "${RUN_AIRPLANESLIVE_SCRIPT}" = "true" ]]; then - InstallAirplanesLive -fi - -if [[ "${RUN_PIAWARE_SCRIPT}" = "true" ]]; then - InstallPiAware -fi - -if [[ "${RUN_FLIGHTRADAR24_SCRIPT}" = "true" ]]; then - InstallFlightradar24 -fi - -if [[ "${RUN_FLYITALYADSB_SCRIPT}" = "true" ]]; then - InstallFlyItalyAdsb -fi - -if [[ "${RUN_OPENSKYNETWORK_SCRIPT}" = "true" ]]; then - InstallOpenSkyNetwork +# Portals +if [[ "${install_portal}" == "true" ]]; then + install_adsb-portal fi -if [[ "${RUN_PLANEFINDER_SCRIPT}" = "true" ]]; then - InstallPlaneFinder -fi - -## ADS-B Receiver Project Web Portal - -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_BEASTSPLITTER_SCRIPT="false" -RUN_DUCKDNS_SCRIPT="false" - +# Extras if [[ -s "${RECEIVER_ROOT_DIRECTORY}/EXTRAS_CHOICES" ]]; then - while read EXTRAS_CHOICE + while read extras_choice do - case ${EXTRAS_CHOICE} in + case ${extras_choice} in "beast-splitter"|"beast-splitter (reinstall)") - RUN_BEASTSPLITTER_SCRIPT="true" + install_beast-splitter ;; "Duck DNS Free Dynamic DNS Hosting"|"Duck DNS Free Dynamic DNS Hosting (reinstall)") - RUN_DUCKDNS_SCRIPT="true" + install_duck-dns ;; esac done < ${RECEIVER_ROOT_DIRECTORY}/EXTRAS_CHOICES fi -if [[ "${RUN_BEASTSPLITTER_SCRIPT}" = "true" ]]; then - InstallBeastSplitter -fi - -if [[ "${RUN_DUCKDNS_SCRIPT}" = "true" ]]; then - InstallDuckDns -fi - exit 0 diff --git a/bash/variables.sh b/bash/variables.sh index 0c316d3e..f79190ef 100644 --- a/bash/variables.sh +++ b/bash/variables.sh @@ -2,35 +2,34 @@ ## DISPLAY COLORS -DISPLAY_DEFAULT="\033[0m" -DISPLAY_HEADING="\033[1;36m" -DISPLAY_MESSAGE="\033[2;36m" -DISPLAY_PROJECT_NAME="\033[1;31m" -DISPLAY_TITLE_HEADING="\033[1;32m" -DISPLAY_TITLE_MESSAGE="\033[2;32m" -DISPLAY_WARNING_HEADING="\033[1;33m" -DISPLAY_WARNING_MESSAGE="\033[2;33m" -DISPLAY_ALERT_HEADING="\033[1;31m" -DISPLAY_ALERT_MESSAGE="\033[2;31m" -DISPLAY_FALSE_INLINE="\033[2;31m" -DISPLAY_TRUE_INLINE="\033[2;32m" +display_default="\033[0m" +display_heading="\033[1;36m" +display_message="\033[2;36m" +display_project_name="\033[1;31m" +display_title_heading="\033[1;32m" +display_title_message="\033[2;32m" +display_warning_heading="\033[1;33m" +display_warning_message="\033[2;33m" +display_alert_heading="\033[1;31m" +display_alert_message="\033[2;31m" +display_false_inline="\033[2;31m" +display_true_inline="\033[2;32m" ## SOFTWARE VERSIONS # FlightAware -DUMP1090_FA_VERSION="9.0" -DUMP978_FA_VERSION="9.0" -PIAWARE_VERSION="9.0.1" -SKYAWARE978_VERSION="9.0" +dump1090-fa_current_version="9.0" +dump978-fa_current_version="9.0" +piaware_current_version="9.0.1" # PlaneFinder Client -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" +pfclient_current_version_armhf="5.0.161" +pfclient_current_version_arm64="5.1.440" +pfclient_current_version_amd64="5.0.162" +pfclient_current_version_i386="5.0.161" # Flightradar24 Client -FLIGHTRADAR24_CLIENT_VERSION="1.0.18-5" +fr24feed_current_version="1.0.18-5" # OpenSky Network Client -OPENSKY_NETWORK_CLIENT_VERSION="2.1.7-1" +opensky-feeder_current_version="2.1.7-1" From 3c074669b4b2f90e65606406823ebff64a85e9cb Mon Sep 17 00:00:00 2001 From: jprochazka Date: Tue, 23 Jul 2024 17:39:20 -0400 Subject: [PATCH 23/26] Renamed functions. --- README.md | 2 +- bash/decoders/dump1090-fa.sh | 112 +++++++++++----------- bash/decoders/dump978-fa.sh | 138 +++++++++++++-------------- bash/extras/beastsplitter.sh | 100 ++++++++++---------- bash/extras/duckdns.sh | 60 ++++++------ bash/feeders/adsbexchange.sh | 48 +++++----- bash/feeders/airplaneslive.sh | 56 +++++------ bash/feeders/flightradar24.sh | 58 ++++++------ bash/feeders/flyitalyadsb.sh | 42 ++++----- bash/feeders/openskynetwork.sh | 46 ++++----- bash/feeders/piaware.sh | 168 ++++++++++++++++----------------- bash/feeders/planefinder.sh | 58 ++++++------ bash/functions.sh | 108 +++++++++------------ bash/init.sh | 62 ++++++------ bash/main.sh | 4 +- bash/portal/graphs.sh | 4 +- bash/portal/install.sh | 34 +++---- install.sh | 28 +++--- 18 files changed, 552 insertions(+), 576 deletions(-) diff --git a/README.md b/README.md index a6d16a2c..22510b5e 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Your local repositories master branch will be updated each time install.sh is ex The following software can be installed using these scripts. -### The ADS-B Receiver Web Portal +### The ADS-B Portal Included is the option to install the ADS-B Portal which offers the following features. diff --git a/bash/decoders/dump1090-fa.sh b/bash/decoders/dump1090-fa.sh index 394f9c16..47aa2957 100755 --- a/bash/decoders/dump1090-fa.sh +++ b/bash/decoders/dump1090-fa.sh @@ -9,66 +9,66 @@ source $RECEIVER_BASH_DIRECTORY/functions.sh ## BEGIN SETUP clear -LogProjectTitle -LogTitleHeading "Setting up the FlightAware Dump1090 decoder" -LogTitleMessage "------------------------------------------------------------------------------" +log_project_title +log_title_heading "Setting up the FlightAware Dump1090 decoder" +log_title_message "------------------------------------------------------------------------------" if ! whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ --title "FlightAware Dump1090 Decoder Setup" \ --yesno "FlightAware Dump1090 is an ADS-B, Mode S, and Mode 3A/3C demodulator and decoder that will receive and decode aircraft transponder messages received via a directly connected software defined radio, or from data provided over a network connection.\n\nWebsite: https://www.flightaware.com/\nGitHub Repository: https://github.com/flightaware/dump1090\n\nWould you like to begin the setup process now?" \ 14 78; then echo "" - LogAlertHeading "INSTALLATION HALTED" - LogAlertMessage "Setup has been halted at the request of the user" + log_alert_heading "INSTALLATION HALTED" + log_alert_message "Setup has been halted at the request of the user" echo "" - LogTitleMessage "------------------------------------------------------------------------------" - LogTitleHeading "FlightAware Dump1090 decoder setup halted" + log_title_message "------------------------------------------------------------------------------" + log_title_heading "FlightAware Dump1090 decoder setup halted" echo "" exit 1 fi ## CHECK FOR PREREQUISITE PACKAGES -LogHeading "Installing packages needed to fulfill FlightAware Dump1090 decoder dependencies" +log_heading "Installing packages needed to fulfill FlightAware Dump1090 decoder dependencies" -CheckPackage build-essential -CheckPackage debhelper -CheckPackage devscripts -CheckPackage fakeroot -CheckPackage libbladerf-dev -CheckPackage libhackrf-dev -CheckPackage liblimesuite-dev -CheckPackage libncurses-dev -CheckPackage librtlsdr-dev -CheckPackage libsoapysdr-dev -CheckPackage lighttpd -CheckPackage pkg-config +check_package build-essential +check_package debhelper +check_package devscripts +check_package fakeroot +check_package libbladerf-dev +check_package libhackrf-dev +check_package liblimesuite-dev +check_package libncurses-dev +check_package librtlsdr-dev +check_package libsoapysdr-dev +check_package lighttpd +check_package pkg-config ## BLACKLIST UNWANTED RTL-SDR MODULES -LogHeading "Blacklist unwanted RTL-SDR kernel modules." +log_heading "Blacklist unwanted RTL-SDR kernel modules." -BlacklistModules +blacklist_modules ## CLONE OR PULL THE FLIGHTAWARE DUMP1090 DECODER SOURCE -LogHeading "Preparing the FlightAware Dump1090 Git repository" +log_heading "Preparing the FlightAware Dump1090 Git repository" if [[ -d $RECEIVER_BUILD_DIRECTORY/dump1090-fa/dump1090 && -d $RECEIVER_BUILD_DIRECTORY/dump1090-fa/dump1090/.git ]]; then - LogMessage "Entering the dump1090 git repository directory" + log_message "Entering the dump1090 git repository directory" cd $RECEIVER_BUILD_DIRECTORY/dump1090-fa/dump1090 - LogMessage "Pulling the dump1090 git repository" + log_message "Pulling the dump1090 git repository" echo "" git pull 2>&1 | tee -a $RECEIVER_LOG_FILE else - LogMessage "Creating the FlightAware dump1090 Project build directory" + log_message "Creating the FlightAware dump1090 Project build directory" echo "" mkdir -v $RECEIVER_BUILD_DIRECTORY/dump1090-fa 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" - LogMessage "Entering the FlightAware dump1090 Project build directory" + log_message "Entering the FlightAware dump1090 Project build directory" cd $RECEIVER_BUILD_DIRECTORY/dump1090-fa - LogMessage "Cloning the dump1090 git repository" + log_message "Cloning the dump1090 git repository" echo "" git clone https://github.com/flightaware/dump1090.git 2>&1 | tee -a $RECEIVER_LOG_FILE fi @@ -76,12 +76,12 @@ fi ## BUILD AND INSTALL THE DUMP1090-FA PACKAGE -LogHeading "Building the FlightAware dump1090-fa package" +log_heading "Building the FlightAware dump1090-fa package" -LogMessage "Entering the dump1090 Git repository" +log_message "Entering the dump1090 Git repository" cd $RECEIVER_BUILD_DIRECTORY/dump1090-fa/dump1090 -LogMessage "Determining which distribution to build the package tree for" +log_message "Determining which distribution to build the package tree for" case $RECEIVER_OS_CODE_NAME in focal) distro="buster" @@ -90,59 +90,59 @@ case $RECEIVER_OS_CODE_NAME in distro="bullseye" ;; esac -LogMessage "Preparing to build dump1090-fa for ${distro}" +log_message "Preparing to build dump1090-fa for ${distro}" echo "" ./prepare-build.sh $distro 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" -LogMessage "Entering the package-${distro} directory" +log_message "Entering the package-${distro} directory" cd $RECEIVER_BUILD_DIRECTORY/dump1090-fa/dump1090/package-$distro -LogMessage "Building the dump1090-fa Debian package" +log_message "Building the dump1090-fa Debian package" echo "" dpkg-buildpackage -b --no-sign 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" -LogMessage "Installing the dump1090-fa Debian package" +log_message "Installing the dump1090-fa Debian package" echo "" sudo dpkg -i $RECEIVER_BUILD_DIRECTORY/dump1090-fa/dump1090/dump1090-fa_$DUMP1090_FA_VERSION_*.deb 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" -LogMessage "Checking that the dump1090-fa Debian package was installed" +log_message "Checking that the dump1090-fa Debian package was installed" if [[ $(dpkg-query -W -f='${STATUS}' dump1090-fa 2>/dev/null | grep -c "ok installed") -eq 0 ]]; then echo "" - LogAlertHeading "INSTALLATION HALTED" + log_alert_heading "INSTALLATION HALTED" echo "" - LogAlertMessage "The dump1090-fa Debian package failed to install" - LogAlertMessage "Setup has been terminated" + log_alert_message "The dump1090-fa Debian package failed to install" + log_alert_message "Setup has been terminated" echo "" - LogTitleMessage "------------------------------------------------------------------------------" - LogTitleHeading "FlightAware Dump1090 decoder setup halted" + log_title_message "------------------------------------------------------------------------------" + log_title_heading "FlightAware Dump1090 decoder setup halted" echo "" read -p "Press enter to continue..." discard exit 1 fi if [[ ! -d $RECEIVER_BUILD_DIRECTORY/package-archive ]]; then - LogMessage "Creating the Debian package archive directory" + log_message "Creating the Debian package archive directory" echo "" mkdir -v $RECEIVER_BUILD_DIRECTORY/package-archive 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" fi -LogMessage "Copying the dump1090-fa Debian package into the Debian package archive directory" +log_message "Copying the dump1090-fa Debian package into the Debian package archive directory" echo "" cp -vf $RECEIVER_BUILD_DIRECTORY/dump1090-fa/dump1090/*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ 2>&1 | tee -a $RECEIVER_LOG_FILE ## POST INSTALLATION OPERATIONS -LogHeading "Performing post installation operations" +log_heading "Performing post installation operations" -LogMessage "Checking if a heywhatsthat upintheair.json file exists" +log_message "Checking if a heywhatsthat upintheair.json file exists" if [[ ! -f "/usr/share/dump1090-fa/html/upintheair.json" ]]; then - LogMessage "Asking the user if they want to add heywhatsthat maximum range rings" + log_message "Asking the user if they want to add heywhatsthat maximum range rings" if (whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ --title "Setup heywhaststhat Maximum Range Rings" \ --yesno "Maximum range rings can be added to the FlightAware Dump1090 map usings data obtained from heywhatsthat. In order to add these rings to your FlightAware dump1090 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 numbers after ?view= in the URL.\n\nWould you like to add heywhatsthat maximum range rings to your map?" \ 16 78); then - LogMessage "Asking the user for the heywhatsthat panarama ID" + log_message "Asking the user for the heywhatsthat panarama ID" heywhatsthat_panorama_id_title="Enter the heywhatsthat Panorama ID" while [[ -z $heywhatsthat_panorama_id ]] ; do heywhatsthat_panorama_id=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ @@ -151,13 +151,13 @@ if [[ ! -f "/usr/share/dump1090-fa/html/upintheair.json" ]]; then 8 78 3>&1 1>&2 2>&3) whiptail_exit_status=$? if [[ $whiptail_exit_status == 0 ]]; then - LogAlertMessage "Setup of heywhatsthat maximum range rings was cancelled" + log_alert_message "Setup of heywhatsthat maximum range rings was cancelled" break fi heywhatsthat_panorama_id_title="Enter the Heywhatsthat Panorama ID [REQUIRED]" done if [[ $whiptail_exit_status != 0 ]]; then - LogMessage "Asking the user what the altitude is for the first ring" + log_message "Asking the user what the altitude is for the first ring" heywhatsthat_ring_one_altitude_title="First heywhatsthat Ring Altitude" while [[ -z $heywhatsthat_ring_one_altitude ]] ; do heywhatsthat_ring_one_altitude=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ @@ -168,7 +168,7 @@ if [[ ! -f "/usr/share/dump1090-fa/html/upintheair.json" ]]; then "3048" 3>&1 1>&2 2>&3) heywhatsthat_ring_one_altitude_title="First heywhatsthat Ring Altitude [REQUIRED]" done - LogMessage "Asking the user what the altitude is for the second ring" + log_message "Asking the user what the altitude is for the second ring" heywhatsthat_ring_two_altitude_title="Second heywhatsthat Ring Altitude" while [[ -z $heywhatsthat_ring_two_altitude ]] ; do heywhatsthat_ring_two_altitude=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ @@ -180,26 +180,26 @@ if [[ ! -f "/usr/share/dump1090-fa/html/upintheair.json" ]]; then heywhatsthat_ring_two_altitude_title="Second heywhatsthat Ring Altitude [REQUIRED]" done - LogMessage "Downloading JSON data file assigned to panorama ID ${heywhatsthat_panorama_id}" + log_message "Downloading JSON data file assigned to panorama ID ${heywhatsthat_panorama_id}" echo "" sudo wget -v -O /usr/share/skyaware/html/upintheair.json "http://www.heywhatsthat.com/api/upintheair.json?id=${heywhatsthat_panarama_id}&refraction=0.25&alts=${heywhatsthat_ring_one_altitude},${heywhatsthat_ring_two_altitude}" 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" - LogMessage "Heywhatsthat configuration complete" + log_message "Heywhatsthat configuration complete" fi else - LogMessage "Heywhatsthat maximum range rings was skipped" + log_message "Heywhatsthat maximum range rings was skipped" fi fi ## SETUP COMPLETE -LogMessage "Returning to ${RECEIVER_PROJECT_TITLE} root directory" +log_message "Returning to ${RECEIVER_PROJECT_TITLE} root directory" cd $RECEIVER_ROOT_DIRECTORY echo "" -LogTitleMessage "------------------------------------------------------------------------------" -LogTitleHeading "FlightAware Dump1090 decoder setup is complete" +log_title_message "------------------------------------------------------------------------------" +log_title_heading "FlightAware Dump1090 decoder setup is complete" echo "" read -p "Press enter to continue..." discard diff --git a/bash/decoders/dump978-fa.sh b/bash/decoders/dump978-fa.sh index 457eb804..62c71184 100755 --- a/bash/decoders/dump978-fa.sh +++ b/bash/decoders/dump978-fa.sh @@ -9,19 +9,19 @@ source $RECEIVER_BASH_DIRECTORY/functions.sh ## BEGIN SETUP clear -LogProjectTitle -LogTitleHeading "Setting up the FlightAware Dump978 decoder" -LogTitleMessage "------------------------------------------------------------------------------" +log_project_title +log_title_heading "Setting up the FlightAware Dump978 decoder" +log_title_message "------------------------------------------------------------------------------" if ! whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ --title "FlightAware Dump978 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; then echo "" - LogAlertHeading "INSTALLATION HALTED" - LogAlertMessage "Setup has been halted at the request of the user" + log_alert_heading "INSTALLATION HALTED" + log_alert_message "Setup has been halted at the request of the user" echo "" - LogTitleMessage "------------------------------------------------------------------------------" - LogTitleHeading "FlightAware Dump978 decoder setup halted" + log_title_message "------------------------------------------------------------------------------" + log_title_heading "FlightAware Dump978 decoder setup halted" echo "" exit 1 fi @@ -29,27 +29,27 @@ fi ## GATHER REQUIRED INFORMATION FROM THE USER -LogHeading "Gather information required to configure the ADS-B decoder and dump978-fa if needed" +log_heading "Gather information required to configure the ADS-B decoder and dump978-fa if needed" -LogMessage "Checking if an ADS-B decoder is installed" +log_message "Checking if an ADS-B decoder is installed" adsb_decoder_installed="false" if [[ $(dpkg-query -W -f='${STATUS}' dump1090-fa 2>/dev/null | grep -c "ok installed") -eq 1 ]]; then - LogMessage "An ADS-B decoder appears to be installed" + log_message "An ADS-B decoder appears to be installed" adsb_decoder_installed="true" fi if [[ "${adsb_decoder_installed}" == "true" ]]; then - LogMessage "Checking if dump978-fa has been configured" + log_message "Checking if dump978-fa has been configured" if [[ -f /etc/default/dump978-fa ]]; then - LogMessage "A dump978-fa configuration file exists" + log_message "A dump978-fa configuration file exists" else - LogMessage "Informing the user an ADS-B decoder appears to be installed" + log_message "Informing the user an ADS-B decoder appears to be installed" whiptail --backtitle "FlightAware Dump978 Configuration" \ --title "RTL-SDR Dongle Assignments" \ --msgbox "It appears one of the dump1090 decoder 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 - LogMessage "Asking the user to assign a RTL-SDR device serial number to the ADS-B decoder" + log_message "Asking the user to assign a RTL-SDR device serial number to the ADS-B decoder" dump1090_device_serial_title="Enter the Dump1090 RTL-SDR Device Serial" while [[ -z $dump1090_device_serial ]] ; do dump1090_device_serial=$(whiptail --backtitle "FlightAware Dump978 Configuration" \ @@ -57,17 +57,17 @@ if [[ "${adsb_decoder_installed}" == "true" ]]; then --inputbox "\nEnter the serial number for your dump1090 RTL-SDR device." \ 8 78 3>&1 1>&2 2>&3) if [[ $dump1090_device_serial == 0 ]]; then - LogAlertHeading "INSTALLATION HALTED" - LogAlertMessage "Setup has been halted due to lack of required information" + log_alert_heading "INSTALLATION HALTED" + log_alert_message "Setup has been halted due to lack of required information" echo "" - LogTitleMessage "------------------------------------------------------------------------------" - LogTitleHeading "FlightAware Dump978 decoder setup halted" + log_title_message "------------------------------------------------------------------------------" + log_title_heading "FlightAware Dump978 decoder setup halted" exit 1 fi dump1090_device_serial_title="Enter the Dump1090 RTL-SDR Device Serial (REQUIRED)" done - LogMessage "Asking the user to assign a RTL-SDR device serial number to dump978-fa" + log_message "Asking the user to assign a RTL-SDR device serial number to dump978-fa" dump978_device_serial_title="Enter the Dump978 RTL-SDR Device Serial" while [[ -z $dump978_device_serial ]] ; do dump978_device_serial=$(whiptail --backtitle "FlightAware Dump978 Configuration" \ @@ -75,11 +75,11 @@ if [[ "${adsb_decoder_installed}" == "true" ]]; then --inputbox "\nEnter the serial number for your dump978 RTL-SDR device." \ 8 78 3>&1 1>&2 2>&3) if [[ $dump978_device_serial == 0 ]]; then - LogAlertHeading "INSTALLATION HALTED" - LogAlertMessage "Setup has been halted due to lack of required information" + log_alert_heading "INSTALLATION HALTED" + log_alert_message "Setup has been halted due to lack of required information" echo "" - LogTitleMessage "------------------------------------------------------------------------------" - LogTitleHeading "FlightAware Dump978 decoder setup halted" + log_title_message "------------------------------------------------------------------------------" + log_title_heading "FlightAware Dump978 decoder setup halted" exit 1 fi dump978_device_serial_title="Enter the Dump1090 RTL-SDR Device Serial (REQUIRED)" @@ -90,43 +90,43 @@ fi ## CHECK FOR PREREQUISITE PACKAGES -LogHeading "Installing packages needed to fulfill FlightAware Dump978 decoder dependencies" +log_heading "Installing packages needed to fulfill FlightAware Dump978 decoder dependencies" -CheckPackage build-essential -CheckPackage debhelper -CheckPackage libboost-filesystem-dev -CheckPackage libboost-program-options-dev -CheckPackage libboost-regex-dev -CheckPackage libboost-system-dev -CheckPackage libsoapysdr-dev -CheckPackage soapysdr-module-rtlsdr +check_package build-essential +check_package debhelper +check_package libboost-filesystem-dev +check_package libboost-program-options-dev +check_package libboost-regex-dev +check_package libboost-system-dev +check_package libsoapysdr-dev +check_package soapysdr-module-rtlsdr ## BLACKLIST UNWANTED RTL-SDR MODULES -LogHeading "Blacklist unwanted RTL-SDR kernel modules" +log_heading "Blacklist unwanted RTL-SDR kernel modules" -BlacklistModules +blacklist_modules ## CLONE OR PULL THE FLIGHTAWARE DUMP978 DECODER SOURCE -LogHeading "Preparing the FlightAware Dump978 Git repository" +log_heading "Preparing the FlightAware Dump978 Git repository" if [[ -d $RECEIVER_BUILD_DIRECTORY/dump978-fa/dump978 && -d $RECEIVER_BUILD_DIRECTORY/dump978-fa/dump978/.git ]]; then - LogMessage "Entering the FlightAware dump978 git repository directory" + log_message "Entering the FlightAware dump978 git repository directory" cd $RECEIVER_BUILD_DIRECTORY/dump978-fa/dump978 - LogMessage "Pulling the dump1090 git repository" + log_message "Pulling the dump1090 git repository" echo "" git pull 2>&1 | tee -a $RECEIVER_LOG_FILE else - LogMessage "Creating the FlightAware dump978 Project build directory" + log_message "Creating the FlightAware dump978 Project build directory" echo "" mkdir -v $RECEIVER_BUILD_DIRECTORY/dump978-fa 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" - LogMessage "Entering the ADS-B Receiver Project build directory" + log_message "Entering the ADS-B Receiver Project build directory" cd $RECEIVER_BUILD_DIRECTORY/dump978-fa - LogMessage "Cloning the FlightAware dump978 git repository" + log_message "Cloning the FlightAware dump978 git repository" echo "" git clone https://github.com/flightaware/dump978.git 2>&1 | tee -a $RECEIVER_LOG_FILE fi @@ -134,66 +134,66 @@ fi ## BUILD AND INSTALL THE DUMP978-FA and SKYAWARE978 PACKAGES -LogHeading "Building the FlightAware dump978-fa and skyaware978 packages" +log_heading "Building the FlightAware dump978-fa and skyaware978 packages" -LogMessage "Entering the dump978 Git repository" +log_message "Entering the dump978 Git repository" cd $RECEIVER_BUILD_DIRECTORY/dump978-fa/dump978 -LogMessage "Building the dump978-fa package" +log_message "Building the dump978-fa package" echo "" dpkg-buildpackage -b 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" -LogMessage "Installing the dump978-fa Debian package" +log_message "Installing the dump978-fa Debian package" echo "" sudo dpkg -i $RECEIVER_BUILD_DIRECTORY/dump978-fa/dump978-fa_${DUMP978_FA_VERSION}_*.deb 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" -LogMessage "Installing the skyaware978 Debian package" +log_message "Installing the skyaware978 Debian package" echo "" sudo dpkg -i $RECEIVER_BUILD_DIRECTORY/dump978-fa/skyaware978_${DUMP978_FA_VERSION}_*.deb 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" -LogMessage "Checking that the dump978-fa Debian package was installed" +log_message "Checking that the dump978-fa Debian package was installed" if [[ $(dpkg-query -W -f='${STATUS}' dump978-fa 2>/dev/null | grep -c "ok installed") -eq 0 ]]; then echo "" - LogAlertHeading "INSTALLATION HALTED" + log_alert_heading "INSTALLATION HALTED" echo "" - LogAlertMessage "The dump978-fa Debian package failed to install" - LogAlertMessage "Setup has been terminated" + log_alert_message "The dump978-fa Debian package failed to install" + log_alert_message "Setup has been terminated" echo "" - LogTitleMessage "------------------------------------------------------------------------------" - LogTitleHeading "FlightAware Dump978 decoder setup halted" + log_title_message "------------------------------------------------------------------------------" + log_title_heading "FlightAware Dump978 decoder setup halted" echo "" read -p "Press enter to continue..." discard exit 1 fi -LogMessage "Checking that the skyaware978 Debian package was installed" +log_message "Checking that the skyaware978 Debian package was installed" if [[ $(dpkg-query -W -f='${STATUS}' skyaware978 2>/dev/null | grep -c "ok installed") -eq 0 ]]; then echo "" - LogAlertHeading "INSTALLATION HALTED" + log_alert_heading "INSTALLATION HALTED" echo "" - LogAlertMessage "The skyaware978 Debian package failed to install" - LogAlertMessage "Setup has been terminated" + log_alert_message "The skyaware978 Debian package failed to install" + log_alert_message "Setup has been terminated" echo "" - LogTitleMessage "------------------------------------------------------------------------------" - LogTitleHeading "FlightAware Dump978 decoder setup halted" + log_title_message "------------------------------------------------------------------------------" + log_title_heading "FlightAware Dump978 decoder setup halted" echo "" read -p "Press enter to continue..." discard exit 1 fi if [[ ! -d $RECEIVER_BUILD_DIRECTORY/package-archive ]]; then - LogMessage "Creating the Debian package archive directory" + log_message "Creating the Debian package archive directory" echo "" mkdir -v $RECEIVER_BUILD_DIRECTORY/package-archive 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" fi -LogMessage "Copying the dump978-fa Debian package into the Debian package archive directory" +log_message "Copying the dump978-fa Debian package into the Debian package archive directory" echo "" cp -vf $RECEIVER_BUILD_DIRECTORY/dump978-fa/dump978-fa_*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" -LogMessage "Copying the skyaware978 Debian package into the Debian package archive directory" +log_message "Copying the skyaware978 Debian package into the Debian package archive directory" echo "" cp -vf $RECEIVER_BUILD_DIRECTORY/dump978-fa/skyaware978_*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ 2>&1 | tee -a $RECEIVER_LOG_FILE @@ -202,17 +202,17 @@ cp -vf $RECEIVER_BUILD_DIRECTORY/dump978-fa/skyaware978_*.deb $RECEIVER_BUILD_DI if [[ "${adsb_decoder_installed}" == "true" ]]; then - LogHeading "Configuring the ADS-B decoder and dump978-fa so they can work in tandem" + log_heading "Configuring the ADS-B decoder and dump978-fa so they can work in tandem" - LogMessage "Assigning RTL-SDR device with serial ${dump978_device_serial} to dump978-fa" + log_message "Assigning RTL-SDR device with serial ${dump978_device_serial} to dump978-fa" sudo sed -i -e "s/driver=rtlsdr/driver=rtlsdr,serial=${dump978_device_serial}/g" /etc/default/dump978-fa - LogMessage "Restarting dump978-fa...\e[97m" + log_message "Restarting dump978-fa...\e[97m" sudo systemctl restart dump978-fa if [[ $(dpkg-query -W -f='${STATUS}' dump978-fa 2>/dev/null | grep -c "ok installed") -eq 1 ]]; then - LogMessage "Assigning RTL-SDR device with serial ${dump1090_device_serial} to the FlightAware Dump1090 decoder" - ChangeConfig "RECEIVER_SERIAL" $dump1090_device_serial "/etc/default/dump1090-fa" - LogMessage "Restarting dump1090-fa" + log_message "Assigning RTL-SDR device with serial ${dump1090_device_serial} to the FlightAware Dump1090 decoder" + change_config "RECEIVER_SERIAL" $dump1090_device_serial "/etc/default/dump1090-fa" + log_message "Restarting dump1090-fa" sudo systemctl restart dump1090-fa fi fi @@ -220,12 +220,12 @@ fi ## SETUP COMPLETE -LogMessage "Returning to ${RECEIVER_PROJECT_TITLE} root directory" +log_message "Returning to ${RECEIVER_PROJECT_TITLE} root directory" cd $RECEIVER_ROOT_DIRECTORY echo "" -LogTitleMessage "------------------------------------------------------------------------------" -LogTitleHeading "FlightAware Dump978 decoder setup is complete" +log_title_message "------------------------------------------------------------------------------" +log_title_heading "FlightAware Dump978 decoder setup is complete" echo "" read -p "Press enter to continue..." discard diff --git a/bash/extras/beastsplitter.sh b/bash/extras/beastsplitter.sh index ff299ab7..3c8110b6 100755 --- a/bash/extras/beastsplitter.sh +++ b/bash/extras/beastsplitter.sh @@ -6,9 +6,9 @@ source $RECEIVER_BASH_DIRECTORY/variables.sh source $RECEIVER_BASH_DIRECTORY/functions.sh clear -LogProjectTitle -LogTitleHeading "Setting up beast-splitter" -LogTitleMessage "------------------------------------------------------------------------------" +log_project_title +log_title_heading "Setting up beast-splitter" +log_title_message "------------------------------------------------------------------------------" if ! 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?" \ @@ -27,7 +27,7 @@ fi ## GATHER REQUIRED INFORMATION FROM THE USER -LogMessage "Asking user if beast-splitter should be enabled" +log_message "Asking user if beast-splitter should be enabled" if whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ --title "Enable Beast Splitter" \ --defaultno \ @@ -37,31 +37,31 @@ else enable_beastsplitter="false" fi -LogMessage "Asking user for the beast-splitter input option" +log_message "Asking user for the beast-splitter input option" input_options=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ --title "Input Options for Beast Splitter" \ --inputbox "Enter the option telling Beast Splitter where to read data from. You should provide one of the following either --net or --serial.\n\nExamples:\n--serial /dev/beast\n--net remotehost:remoteport" \ 8 78) if [[ $input_options == 0 ]]; then - LogAlertHeading "INSTALLATION HALTED" - LogAlertMessage "Setup has been halted due to lack of required information" + log_alert_heading "INSTALLATION HALTED" + log_alert_message "Setup has been halted due to lack of required information" echo "" - LogTitleMessage "------------------------------------------------------------------------------" - LogTitleHeading "beast-splitter setup halted" + log_title_message "------------------------------------------------------------------------------" + log_title_heading "beast-splitter setup halted" exit 1 fi -LogMessage "Asking user for the beast-splitter output option" +log_message "Asking user for the beast-splitter output option" 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) if [[ $output_options == 0 ]]; then - LogAlertHeading "INSTALLATION HALTED" - LogAlertMessage "Setup has been halted due to lack of required information" + log_alert_heading "INSTALLATION HALTED" + log_alert_message "Setup has been halted due to lack of required information" echo "" - LogTitleMessage "------------------------------------------------------------------------------" - LogTitleHeading "beast-splitter setup halted" + log_title_message "------------------------------------------------------------------------------" + log_title_heading "beast-splitter setup halted" exit 1 fi @@ -69,33 +69,33 @@ fi ## CHECK FOR PREREQUISITE PACKAGES -LogHeading "Installing packages needed to fulfill beast-splitter dependencies" +log_heading "Installing packages needed to fulfill beast-splitter dependencies" -CheckPackage build-essential -CheckPackage debhelper -CheckPackage libboost-system-dev -CheckPackage libboost-program-options-dev -CheckPackage libboost-regex-dev +check_package build-essential +check_package debhelper +check_package libboost-system-dev +check_package libboost-program-options-dev +check_package libboost-regex-dev ## CLONE OR PULL THE FLIGHTAWARE DUMP978 DECODER SOURCE -LogHeading "Preparing the FlightAware Dump978 Git repository" +log_heading "Preparing the FlightAware Dump978 Git repository" if [[ -d $RECEIVER_BUILD_DIRECTORY/beast-splitter/beast-splitter && -d $RECEIVER_BUILD_DIRECTORY/beast-splitter/beast-splitter/.git ]]; then - LogMessage "Entering the beast-splitter git repository directory" + log_message "Entering the beast-splitter git repository directory" cd $RECEIVER_BUILD_DIRECTORY/beast-splitter/beast-splitter - LogMessage "Pulling the beast-splitter git repository" + log_message "Pulling the beast-splitter git repository" echo "" git pull 2>&1 | tee -a $RECEIVER_LOG_FILE else - LogMessage "Creating the beast-splitter build directory" + log_message "Creating the beast-splitter build directory" echo "" mkdir -v $RECEIVER_BUILD_DIRECTORY/beast-splitter 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" - LogMessage "Entering the beast-splitter build directory" + log_message "Entering the beast-splitter build directory" cd $RECEIVER_BUILD_DIRECTORY/beast-splitter - LogMessage "Cloning the FlightAware dump978 git repository" + log_message "Cloning the FlightAware dump978 git repository" echo "" git clone https://github.com/flightaware/beast-splitter.git 2>&1 | tee -a $RECEIVER_LOG_FILE fi @@ -103,41 +103,41 @@ fi ## BUILD AND INSTALL THE BEAST-SPLITTER PACKAGE -LogHeading "Building the beast-splitter package" +log_heading "Building the beast-splitter package" -LogMessage "Entering the beast-splitter Git repository" +log_message "Entering the beast-splitter Git repository" cd $RECEIVER_BUILD_DIRECTORY/beast-splitter/beast-splitter -LogMessage "Building the beast-splitter package" +log_message "Building the beast-splitter package" echo "" dpkg-buildpackage -b 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" -LogMessage "Installing the beast-splitter Debian package" +log_message "Installing the beast-splitter Debian package" sudo dpkg -i $RECEIVER_BUILD_DIRECTORY/beast-splitter/beast-splitter_*.deb 2>&1 | tee -a $RECEIVER_LOG_FILE -LogMessage "Checking that the beast-splitter Debian package was installed" +log_message "Checking that the beast-splitter Debian package was installed" if [[ $(dpkg-query -W -f='${STATUS}' beast-splitter 2>/dev/null | grep -c "ok installed") -eq 0 ]]; then echo "" - LogAlertHeading "INSTALLATION HALTED" + log_alert_heading "INSTALLATION HALTED" echo "" - LogAlertMessage "The beast-splitter Debian package failed to install" - LogAlertMessage "Setup has been terminated" + log_alert_message "The beast-splitter Debian package failed to install" + log_alert_message "Setup has been terminated" echo "" - LogTitleMessage "------------------------------------------------------------------------------" - LogTitleHeading "beast-splitter setup halted" + log_title_message "------------------------------------------------------------------------------" + log_title_heading "beast-splitter setup halted" echo "" read -p "Press enter to continue..." discard exit 1 fi if [[ ! -d $RECEIVER_BUILD_DIRECTORY/package-archive ]]; then - LogMessage "Creating the Debian package archive directory" + log_message "Creating the Debian package archive directory" echo "" mkdir -v $RECEIVER_BUILD_DIRECTORY/package-archive 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" fi -LogMessage "Copying the beast-splitter Debian package into the Debian package archive directory" +log_message "Copying the beast-splitter Debian package into the Debian package archive directory" echo "" cp -vf $RECEIVER_BUILD_DIRECTORY/beast-splitter/*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" @@ -145,32 +145,32 @@ echo "" ## CONFIGURATION -LogHeading "Configuring beast-splitter" +log_heading "Configuring beast-splitter" -LogMessage "Setting ENABLED to ${enable_beastsplitter}" -ChangeConfig "ENABLED" "${enable_beastsplitter}" "/etc/default/beast-splitter" -LogMessage "Setting INPUT_OPTIONS to ${input_options}" -ChangeConfig "INPUT_OPTIONS" "${input_options}" "/etc/default/beast-splitter" -LogMessage "Setting OUTPUT_OPTIONS to ${output_options}" -ChangeConfig "OUTPUT_OPTIONS" "${output_options}" "/etc/default/beast-splitter" +log_message "Setting ENABLED to ${enable_beastsplitter}" +change_config "ENABLED" "${enable_beastsplitter}" "/etc/default/beast-splitter" +log_message "Setting INPUT_OPTIONS to ${input_options}" +change_config "INPUT_OPTIONS" "${input_options}" "/etc/default/beast-splitter" +log_message "Setting OUTPUT_OPTIONS to ${output_options}" +change_config "OUTPUT_OPTIONS" "${output_options}" "/etc/default/beast-splitter" if [[ "${enable_beastsplitter}" == "true" ]]; then - LogMessage "Starting the beast-splitter process" + log_message "Starting the beast-splitter process" sudo systemctl start beast-splitter else - LogMessage "Making sure beast-splitter is not running" + log_message "Making sure beast-splitter is not running" sudo systemctl stop beast-splitter fi ## SETUP COMPLETE -LogMessage "Returning to ${RECEIVER_PROJECT_TITLE} root directory" +log_message "Returning to ${RECEIVER_PROJECT_TITLE} root directory" cd $RECEIVER_ROOT_DIRECTORY echo "" -LogTitleMessage "------------------------------------------------------------------------------" -LogTitleHeading "beast-splitter setup is complete" +log_title_message "------------------------------------------------------------------------------" +log_title_heading "beast-splitter setup is complete" echo "" read -p "Press enter to continue..." discard diff --git a/bash/extras/duckdns.sh b/bash/extras/duckdns.sh index d3c71ee9..bfc1d395 100755 --- a/bash/extras/duckdns.sh +++ b/bash/extras/duckdns.sh @@ -6,19 +6,19 @@ source $RECEIVER_BASH_DIRECTORY/variables.sh source $RECEIVER_BASH_DIRECTORY/functions.sh clear -LogProjectTitle -LogTitleHeading "Setting up Duck DNS" -LogTitleMessage "------------------------------------------------------------------------------" +log_project_title +log_title_heading "Setting up Duck DNS" +log_title_message "------------------------------------------------------------------------------" if ! 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; then echo "" - LogAlertHeading "INSTALLATION HALTED" - LogAlertMessage "Setup has been halted at the request of the user" + log_alert_heading "INSTALLATION HALTED" + log_alert_message "Setup has been halted at the request of the user" echo "" - LogTitleMessage "------------------------------------------------------------------------------" - LogTitleHeading "Duck DNS setup halted" + log_title_message "------------------------------------------------------------------------------" + log_title_heading "Duck DNS setup halted" echo "" exit 1 fi @@ -26,17 +26,17 @@ fi ## CHECK FOR PREREQUISITE PACKAGES -LogHeading "Installing packages needed to fulfill PlaneFinder client dependencies" +log_heading "Installing packages needed to fulfill PlaneFinder client dependencies" -CheckPackage cron -CheckPackage curl +check_package cron +check_package curl ## GATHER REQUIRED INFORMATION FROM THE USER -LogHeading "Gather information required to configure Duck DNS support" +log_heading "Gather information required to configure Duck DNS support" -LogMessage "Asking the user for the sub domain to be assigned to this device" +log_message "Asking the user for the sub domain to be assigned to this device" domain_title="Duck DNS Sub Domain" while [[ -z $domain ]] ; do domain=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ @@ -44,17 +44,17 @@ while [[ -z $domain ]] ; do --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) if [[ $domain == 0 ]]; then - LogAlertHeading "INSTALLATION HALTED" - LogAlertMessage "Setup has been halted due to lack of required information" + log_alert_heading "INSTALLATION HALTED" + log_alert_message "Setup has been halted due to lack of required information" echo "" - LogTitleMessage "------------------------------------------------------------------------------" - LogTitleHeading "Duck DNS decoder setup halted" + log_title_message "------------------------------------------------------------------------------" + log_title_heading "Duck DNS decoder setup halted" exit 1 fi domain_title="Duck DNS Sub Domain (REQUIRED)" done -LogMessage "Asking the user for the Duck DNS token" +log_message "Asking the user for the Duck DNS token" token_title="Duck DNS Token" while [[ -z "${DUCKDNS_TOKEN}" ]] ; do token=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ @@ -62,11 +62,11 @@ while [[ -z "${DUCKDNS_TOKEN}" ]] ; do --inputbox "\nPlease enter your Duck DNS token." \ 8 78) if [[ $domain == 0 ]]; then - LogAlertHeading "INSTALLATION HALTED" - LogAlertMessage "Setup has been halted due to lack of required information" + log_alert_heading "INSTALLATION HALTED" + log_alert_message "Setup has been halted due to lack of required information" echo "" - LogTitleMessage "------------------------------------------------------------------------------" - LogTitleHeading "Duck DNS setup halted" + log_title_message "------------------------------------------------------------------------------" + log_title_heading "Duck DNS setup halted" exit 1 fi token_title="Duck DNS Token (REQUIRED)" @@ -75,33 +75,33 @@ done ## CREATE THE DUCK DNS SCRIPT -LogHeading "Creating the Duck DNS script" +log_heading "Creating the Duck DNS script" if [[ ! -d $RECEIVER_BUILD_DIRECTORY/duckdns ]]; then - LogMessage "Creating the Duck DNS build directory" + log_message "Creating the Duck DNS build directory" echo "" mkdir -v $RECEIVER_BUILD_DIRECTORY/duckdns 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" fi -LogMessage "Creating the Duck DNS update script" +log_message "Creating the Duck DNS update script" tee $RECEIVER_BUILD_DIRECTORY/duckdns/duck.sh > /dev/null <&1 | tee -a $RECEIVER_LOG_FILE echo "" -LogMessage "Creating the Duck DNS cron file" +log_message "Creating the Duck DNS cron file" sudo tee /etc/cron.d/duckdns_ip_address_update > /dev/null </dev/null 2>&1 EOF echo "" -LogMessage "Executing the Duck DNS update script" +log_message "Executing the Duck DNS update script" echo "" $RECEIVER_BUILD_DIRECTORY/duckdns/duck.sh echo "" @@ -109,12 +109,12 @@ echo "" ## SETUP COMPLETE -LogMessage "Returning to ${RECEIVER_PROJECT_TITLE} root directory" +log_message "Returning to ${RECEIVER_PROJECT_TITLE} root directory" cd $RECEIVER_ROOT_DIRECTORY echo "" -LogTitleMessage "------------------------------------------------------------------------------" -LogTitleHeading "Duck DNS setup is complete" +log_title_message "------------------------------------------------------------------------------" +log_title_heading "Duck DNS setup is complete" echo "" read -p "Press enter to continue..." discard diff --git a/bash/feeders/adsbexchange.sh b/bash/feeders/adsbexchange.sh index ed35e571..d4df02ad 100755 --- a/bash/feeders/adsbexchange.sh +++ b/bash/feeders/adsbexchange.sh @@ -6,19 +6,19 @@ source $RECEIVER_BASH_DIRECTORY/variables.sh source $RECEIVER_BASH_DIRECTORY/functions.sh clear -LogProjectTitle -LogTitleHeading "Setting up the ADS-B Exchange client" -LogTitleMessage "------------------------------------------------------------------------------" +log_project_title +log_title_heading "Setting up the ADS-B Exchange client" +log_title_message "------------------------------------------------------------------------------" if ! 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; then echo "" - LogAlertHeading "INSTALLATION HALTED" - LogAlertMessage "Setup has been halted at the request of the user" + log_alert_heading "INSTALLATION HALTED" + log_alert_message "Setup has been halted at the request of the user" echo "" - LogTitleMessage "------------------------------------------------------------------------------" - LogTitleHeading "ADS-B Exchange client setup halted" + log_title_message "------------------------------------------------------------------------------" + log_title_heading "ADS-B Exchange client setup halted" echo "" exit 1 fi @@ -26,30 +26,30 @@ fi ## DOWNLOAD AND EXECUTE THE ADS-B EXCHANGE CLIENT INSTALL SCRIPT -LogHeading "Downloading the proper ADS-B Exchange client script" +log_heading "Downloading the proper ADS-B Exchange client script" -LogMessage "Informing the user of how the installation process will work" +log_message "Informing the user of how the installation process will work" 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 if [[ ! -d $RECEIVER_BUILD_DIRECTORY/adsbexchange ]]; then - LogMessage "Creating the ADSBExchange build directory" + log_message "Creating the ADSBExchange build directory" echo "" mkdir -v $RECEIVER_BUILD_DIRECTORY/adsbexchange 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" fi -LogMessage "Entering the ADSBExchange build directory" +log_message "Entering the ADSBExchange build directory" cd $RECEIVER_BUILD_DIRECTORY/adsbexchange -LogMessage "Determining whether the installation or upgrade script should be used" +log_message "Determining whether the installation or upgrade script should be used" 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 -LogMessage "Downloading the ADS-B Exchange client ${action_to_perform} script" +log_message "Downloading the ADS-B Exchange client ${action_to_perform} script" echo "" if [[ "${action_to_perform}" = "install" ]]; then wget -v -O $RECEIVER_BUILD_DIRECTORY/adsbexchange/feed-${action_to_perform}.sh https://www.adsbexchange.com/feed.sh 2>&1 | tee -a $RECEIVER_LOG_FILE @@ -58,7 +58,7 @@ else fi echo "" -LogMessage "Executing the ADS-B Exchange client ${action_to_perform} script" +log_message "Executing the ADS-B Exchange client ${action_to_perform} script" echo "" sudo bash $RECEIVER_BUILD_DIRECTORY/adsbexchange/feed-${action_to_perform}.sh echo "" @@ -66,14 +66,14 @@ echo "" ## INSTALL THE ADS-B EXCHANGE STATS PACKAGE -LogHeading "Starting the ADS-B Exchange stats package setup process" +log_heading "Starting the ADS-B Exchange stats package setup process" -LogMessage "Asking if the user wishes to install the ADS-B Exchange stats package" +log_message "Asking if the user wishes to install the ADS-B Exchange stats package" if whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ --title "ADS-B Exchange Feed Setup" \ --yesno "ADS-B Exchange offers the option to install their stats package in order to send your stats to their site.\n\nWould you like to install the stats package now?" \ 12 78; then - LogMessage "Downloading the ADS-B Exchange stats package installation script" + log_message "Downloading the ADS-B Exchange stats package installation script" echo "" wget -v -O $RECEIVER_BUILD_DIRECTORY/adsbexchange/axstats.sh https://adsbexchange.com/stats.sh 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" @@ -82,15 +82,15 @@ if whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ sudo bash $RECEIVER_BUILD_DIRECTORY/adsbexchange/axstats.sh echo "" else - LogMessage "The user opted out of installing the ADS-B Exchange stats package" + log_message "The user opted out of installing the ADS-B Exchange stats package" fi ## INSTALL THE ADS-B EXCHANGE WEB INTERFACE -LogHeading "Starting the ADS-B Exchange web interface setup process" +log_heading "Starting the ADS-B Exchange web interface setup process" -LogMessage "Asking if the user wishes to install the ADS-B Exchange web interface" +log_message "Asking if the user wishes to install the ADS-B Exchange web interface" if whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ --title "ADS-B Exchange Feed Setup" \ --yesno "ADS-B Exchange offers the option to install an additional web interface.\n\nWould you like to install the web interface now?" \ @@ -100,18 +100,18 @@ if whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ sudo bash /usr/local/share/adsbexchange/git/install-or-update-interface.sh echo "" else - LogMessage "The user opted out of installing the ADS-B Exchange web interface" + log_message "The user opted out of installing the ADS-B Exchange web interface" fi ## SETUP COMPLETE -LogMessage "Returning to ${RECEIVER_PROJECT_TITLE} root directory" +log_message "Returning to ${RECEIVER_PROJECT_TITLE} root directory" cd $RECEIVER_ROOT_DIRECTORY echo "" -LogTitleMessage "------------------------------------------------------------------------------" -LogTitleHeading "ADS-B Exchange client client setup is complete" +log_title_message "------------------------------------------------------------------------------" +log_title_heading "ADS-B Exchange client client setup is complete" echo "" read -p "Press enter to continue..." discard diff --git a/bash/feeders/airplaneslive.sh b/bash/feeders/airplaneslive.sh index 5030bd76..3ba04449 100755 --- a/bash/feeders/airplaneslive.sh +++ b/bash/feeders/airplaneslive.sh @@ -6,19 +6,19 @@ source $RECEIVER_BASH_DIRECTORY/variables.sh source $RECEIVER_BASH_DIRECTORY/functions.sh clear -LogProjectTitle -LogTitleHeading "Setting up the Airplanes.live client" -LogTitleMessage "------------------------------------------------------------------------------" +log_project_title +log_title_heading "Setting up the Airplanes.live client" +log_title_message "------------------------------------------------------------------------------" if ! whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ --title "Airplanes.live Feeder Client Setup" \ --yesno "The airplanes.live feeder client takes data from a local dump1090 instance and shares this with airplanes.live. for more information please see their website:\n\n https://airplanes.live/how-to-feed/\n\nContinue setup by installing the airplanes.live feeder client?" \ 13 78; then echo "" - LogAlertHeading "INSTALLATION HALTED" - LogAlertMessage "Setup has been halted at the request of the user" + log_alert_heading "INSTALLATION HALTED" + log_alert_message "Setup has been halted at the request of the user" echo "" - LogTitleMessage "------------------------------------------------------------------------------" - LogTitleHeading "Airplanes.live client setup halted" + log_title_message "------------------------------------------------------------------------------" + log_title_heading "Airplanes.live client setup halted" echo "" exit 1 fi @@ -26,29 +26,29 @@ fi ## DOWNLOAD AND EXECUTE THE AIRPLANES.LIVE CLIENT INSTALL SCRIPT -LogHeading "Begining the airplanes.live client installation process" +log_heading "Begining the airplanes.live client installation process" -LogMessage "Informing the user of how the installation process will work" +log_message "Informing the user of how the installation process will work" whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ --title "Airplanes.live Client Setup" \ --msgbox "Scripts supplied by airplanes.live 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 if [[ ! -d $RECEIVER_BUILD_DIRECTORY/airplaneslive ]]; then - LogMessage "Creating the airplanes.live build directory" + log_message "Creating the airplanes.live build directory" echo "" mkdir -v $RECEIVER_BUILD_DIRECTORY/airplaneslive 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" fi -LogMessage "Entering the airplanes.live build directory" +log_message "Entering the airplanes.live build directory" cd $RECEIVER_BUILD_DIRECTORY/airplaneslive -LogMessage "Downloading the airplanes.live client installation script" +log_message "Downloading the airplanes.live client installation script" echo "" wget -v -O $RECEIVER_BUILD_DIRECTORY/airplaneslive/install.sh https://raw.githubusercontent.com/airplanes-live/feed/main/install.sh 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" -LogMessage "Executing the airplanes.live client installation script" +log_message "Executing the airplanes.live client installation script" echo "" sudo bash $RECEIVER_BUILD_DIRECTORY/airplaneslive/install.sh echo "" @@ -56,36 +56,36 @@ echo "" ## CHECK THE STATUS OF THE CLIENT -LogHeading "Checking if the reciver is now feeding airplanes.live" +log_heading "Checking if the reciver is now feeding airplanes.live" -LogMessage "Checking for connections on ports 30004 and 31090 to IP address 78.46.234.18" +log_message "Checking for connections on ports 30004 and 31090 to IP address 78.46.234.18" netstat_output = `netstat -t -n | grep -E '30004|31090'` if [[ $netstat_output == *"78.46.234.18:30004 ESTABLISHED"* && $netstat_output == *"78.46.234.18:31090 ESTABLISHED"* ]] - LogMessage "This device appears to be connected to airplanes.live" + log_message "This device appears to be connected to airplanes.live" else - LogAlertMessage "The receiver does not appear to be feeding airplanes.live at this time...\e[97m" - LogAlertMessage "Please reboot your device and run the command 'netstat -t -n | grep -E '30004|31090' to see if a connection has been astablished." - LogAlertMessage "If the issue presists supply the last 20 lines given by the following command on the airplanes.live discord." - LogAlertMessage " 'sudo journalctl -u airplanes-feed --no-pager'" - LogAlertMessage " 'sudo journalctl -u airplanes-mlat --no-pager'" + log_alert_message "The receiver does not appear to be feeding airplanes.live at this time...\e[97m" + log_alert_message "Please reboot your device and run the command 'netstat -t -n | grep -E '30004|31090' to see if a connection has been astablished." + log_alert_message "If the issue presists supply the last 20 lines given by the following command on the airplanes.live discord." + log_alert_message " 'sudo journalctl -u airplanes-feed --no-pager'" + log_alert_message " 'sudo journalctl -u airplanes-mlat --no-pager'" fi ## INSTALL THE AIRPLANES.LIVE WEB INTERFACE -LogHeading "Starting the airplanes.live web interface setup process" +log_heading "Starting the airplanes.live web interface setup process" -LogMessage "Asking if the user wishes to install the ADS-B Exchange web interface" +log_message "Asking if the user wishes to install the ADS-B Exchange web interface" if whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ --title "Airplanes.live Web Interface Setup" \ --yesno "Airplanes.live offers the option to install an additional web interface.\n\nWould you like to install the web interface now?" \ 12 78; then echo "" - LogMessage "Executing the airplanes.live web interface installation script" + log_message "Executing the airplanes.live web interface installation script" echo "" sudo bash sudo bash /usr/local/share/airplanes/git/install-or-update-interface.sh else - LogMessage "The user opted out of installing the airplanes.live web interface" + log_message "The user opted out of installing the airplanes.live web interface" fi @@ -99,12 +99,12 @@ whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ ## SETUP COMPLETE -LogMessage "Returning to ${RECEIVER_PROJECT_TITLE} root directory" +log_message "Returning to ${RECEIVER_PROJECT_TITLE} root directory" cd $RECEIVER_ROOT_DIRECTORY echo "" -LogTitleMessage "------------------------------------------------------------------------------" -LogTitleHeading "Airplanes.live client setup is complete" +log_title_message "------------------------------------------------------------------------------" +log_title_heading "Airplanes.live client setup is complete" echo "" read -p "Press enter to continue..." discard diff --git a/bash/feeders/flightradar24.sh b/bash/feeders/flightradar24.sh index 4b5d11ff..6027e0f5 100755 --- a/bash/feeders/flightradar24.sh +++ b/bash/feeders/flightradar24.sh @@ -6,19 +6,19 @@ source $RECEIVER_BASH_DIRECTORY/variables.sh source $RECEIVER_BASH_DIRECTORY/functions.sh clear -LogProjectTitle -LogTitleHeading "Setting up the FlightRadar24 client" -LogTitleMessage "------------------------------------------------------------------------------" +log_project_title +log_title_heading "Setting up the FlightRadar24 client" +log_title_message "------------------------------------------------------------------------------" if ! 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; then echo "" - LogAlertHeading "INSTALLATION HALTED" - LogAlertMessage "Setup has been halted at the request of the user" + log_alert_heading "INSTALLATION HALTED" + log_alert_message "Setup has been halted at the request of the user" echo "" - LogTitleMessage "------------------------------------------------------------------------------" - LogTitleHeading "FlightRadar24 client setup halted" + log_title_message "------------------------------------------------------------------------------" + log_title_heading "FlightRadar24 client setup halted" echo "" exit 1 fi @@ -26,23 +26,23 @@ fi ## DOWNLOAD AND EXECUTE THE FLIGHTRADAR24 CLIENT INSTALL SCRIPT -LogHeading "Begining the FlightRadar24 client installation process" +log_heading "Begining the FlightRadar24 client installation process" if [[ ! -d $RECEIVER_BUILD_DIRECTORY/flightradar24 ]]; then - LogMessage "Creating the FlightRadar24 build directory" + log_message "Creating the FlightRadar24 build directory" echo "" mkdir -v $RECEIVER_BUILD_DIRECTORY/flightradar24 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" fi -LogMessage "Entering the FlightRadar24 build directory" +log_message "Entering the FlightRadar24 build directory" cd $RECEIVER_BUILD_DIRECTORY/flightradar24 -LogMessage "Downloading the airplanes.live client installation script" +log_message "Downloading the airplanes.live client installation script" echo "" wget -v -O $RECEIVER_BUILD_DIRECTORY/flightradar24/install.sh https://fr24.com/install.sh 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" -LogMessage "Executing the airplanes.live client installation script" +log_message "Executing the airplanes.live client installation script" echo "" sudo bash $RECEIVER_BUILD_DIRECTORY/flightradar24/install.sh echo "" @@ -50,18 +50,18 @@ echo "" ## CHECK THE STATUS OF THE CLIENT -LogHeading "Checking if the FlightRadar24 client was installed successfully" +log_heading "Checking if the FlightRadar24 client was installed successfully" echo -e "\e[94m Checking that the FlightRadar24 client package was installed" if [[ $(dpkg-query -W -f='${STATUS}' fr24feed 2>/dev/null | grep -c "ok installed") -eq 0 ]]; then echo "" - LogAlertHeading "INSTALLATION HALTED" + log_alert_heading "INSTALLATION HALTED" echo "" - LogAlertMessage "FlightRadar24 package installation failed" - LogAlertMessage "Setup has been terminated" + log_alert_message "FlightRadar24 package installation failed" + log_alert_message "Setup has been terminated" echo "" - LogTitleMessage "------------------------------------------------------------------------------" - LogTitleHeading "FlightRadar24 client setup failed" + log_title_message "------------------------------------------------------------------------------" + log_title_heading "FlightRadar24 client setup failed" echo "" read -p "Press enter to continue..." discard exit 1 @@ -70,27 +70,27 @@ fi ## POST INSTALLATION OPERATIONS -LogHeading "Performing post installation operations" +log_heading "Performing post installation operations" -LogMessage "Flightradar24 asks that MLAT be disabled if sharing with other networks" -ChangeConfig "mlat" "no" "/etc/fr24feed.ini" -ChangeConfig "mlat-without-gps" "no" "/etc/fr24feed.ini" -LogMessage "Restarting the Flightradar24 client" +log_message "Flightradar24 asks that MLAT be disabled if sharing with other networks" +change_config "mlat" "no" "/etc/fr24feed.ini" +change_config "mlat-without-gps" "no" "/etc/fr24feed.ini" +log_message "Restarting the Flightradar24 client" sudo systemctl restart fr24feed -LogWarningMessage "If the Flightradar24 client is the only feeder utilizing MLAT execute the following commands to enable MLAT" -LogWarningMessage 'sudo sed -i -e "s/\(mlat *= *\).*/\1\"yes\"/" /etc/fr24feed.ini' -LogWarningMessage 'sudo sed -i -e "s/\(mlat-without-gps *= *\).*/\1\"yes\"/" /etc/fr24feed.ini' +log_warning_message "If the Flightradar24 client is the only feeder utilizing MLAT execute the following commands to enable MLAT" +log_warning_message 'sudo sed -i -e "s/\(mlat *= *\).*/\1\"yes\"/" /etc/fr24feed.ini' +log_warning_message 'sudo sed -i -e "s/\(mlat-without-gps *= *\).*/\1\"yes\"/" /etc/fr24feed.ini' ## SETUP COMPLETE -LogMessage "Returning to ${RECEIVER_PROJECT_TITLE} root directory" +log_message "Returning to ${RECEIVER_PROJECT_TITLE} root directory" cd $RECEIVER_ROOT_DIRECTORY echo "" -LogTitleMessage "------------------------------------------------------------------------------" -LogTitleHeading "FlightRadar24 client setup is complete" +log_title_message "------------------------------------------------------------------------------" +log_title_heading "FlightRadar24 client setup is complete" echo "" read -p "Press enter to continue..." discard diff --git a/bash/feeders/flyitalyadsb.sh b/bash/feeders/flyitalyadsb.sh index 45093010..1789db11 100755 --- a/bash/feeders/flyitalyadsb.sh +++ b/bash/feeders/flyitalyadsb.sh @@ -6,19 +6,19 @@ source $RECEIVER_BASH_DIRECTORY/variables.sh source $RECEIVER_BASH_DIRECTORY/functions.sh clear -LogProjectTitle -LogTitleHeading "Setting up the Fly Italy ADS-B client" -LogTitleMessage "------------------------------------------------------------------------------" +log_project_title +log_title_heading "Setting up the Fly Italy ADS-B client" +log_title_message "------------------------------------------------------------------------------" if ! whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ --title "Fly Italy ADS-B feeder client Setup" \ --yesno "The Fly Italy ADS-B feeder client takes data from a local dump1090 instance and shares this with Fly Italy ADS-B. for more information please see their website:\n\n https://flyitalyadsb.com/come-condividere-la-propria-antenna/\n\nContinue setup by installing the Fly Italy ADS-B feeder client?" \ 13 78; then echo "" - LogAlertHeading "INSTALLATION HALTED" - LogAlertMessage "Setup has been halted at the request of the user" + log_alert_heading "INSTALLATION HALTED" + log_alert_message "Setup has been halted at the request of the user" echo "" - LogTitleMessage "------------------------------------------------------------------------------" - LogTitleHeading "Fly Italy ADS-B client setup halted" + log_title_message "------------------------------------------------------------------------------" + log_title_heading "Fly Italy ADS-B client setup halted" echo "" exit 1 fi @@ -26,39 +26,39 @@ fi ## DOWNLOAD AND EXECUTE THE PROPER FLY ITALY ADS-B CLIENT SCRIPT -LogHeading "Begining the Fly Italy ADS-B client installation process" +log_heading "Begining the Fly Italy ADS-B client installation process" -LogMessage "Informing the user of how the installation process will work" +log_message "Informing the user of how the installation process will work" whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ --title "Fly Italy ADS-B Client Setup" \ --msgbox "Scripts supplied by airplanes.live 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 if [[ ! -d $RECEIVER_BUILD_DIRECTORY/flyitalyadsb ]]; then - LogMessage "Creating the Fly Italy ADS-B build directory" + log_message "Creating the Fly Italy ADS-B build directory" echo "" mkdir -v $RECEIVER_BUILD_DIRECTORY/flyitalyadsb 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" fi -LogMessage "Entering the Fly Italy ADS-B build directory" +log_message "Entering the Fly Italy ADS-B build directory" cd $RECEIVER_BUILD_DIRECTORY/flyitalyadsb -LogMessage "Downloading the Fly Italy ADS-B installation script" +log_message "Downloading the Fly Italy ADS-B installation script" echo "" wget -v -O $RECEIVER_BUILD_DIRECTORY/flyitalyadsb/install.sh https://raw.githubusercontent.com/flyitalyadsb/fly-italy-adsb/master/install.sh 2>&1 | tee -a $RECEIVER_LOG_FILE -LogMessage "Executing the Fly Italy ADS-B feeder installation script" +log_message "Executing the Fly Italy ADS-B feeder installation script" echo "" sudo bash $RECEIVER_BUILD_DIRECTORY/flyitalyadsb/install.sh -LogMessage "Asking if the user wishes to install the Fly Italy ADS-B updater" +log_message "Asking if the user wishes to install the Fly Italy ADS-B updater" if whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ --title "Install The Fly Italy ADS-B Updater" \ --yesno "It is recommended that the Fly Italy ADS-B updater be installed as well.\n\nWould you like to install the updater at this time?" \ 12 78; then - LogMessage "Downloading the Fly Italy ADS-B updater script" + log_message "Downloading the Fly Italy ADS-B updater script" echo "" wget -v -O $RECEIVER_BUILD_DIRECTORY/flyitalyadsb/install_updater.sh https://raw.githubusercontent.com/flyitalyadsb/mlat-client/master/scripts/install_updater.sh 2>&1 | tee -a $RECEIVER_LOG_FILE - LogMessage "Executing the Fly Italy ADS-B feeder updater script" + log_message "Executing the Fly Italy ADS-B feeder updater script" echo "" sudo bash $RECEIVER_BUILD_DIRECTORY/flyitalyadsb/install_updater.sh fi @@ -66,9 +66,9 @@ fi ## POST INSTALLATION OPERATIONS -LogHeading "Performing post installation operations" +log_heading "Performing post installation operations" -LogMessage "Informing user as to how to check client status" +log_message "Informing user as to how to check client status" whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ --title "Fly Italy ADS-B Feeder Setup Complete" \ --msgbox "To check the status of your installation vist https://flyitalyadsb.com/stato-ricevitore/.\n\nFor information on configuring your Fly Italy ADS-B feeder visit https://flyitalyadsb.com/configurazione-script/" \ @@ -77,12 +77,12 @@ whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ ## SETUP COMPLETE -LogMessage "Returning to ${RECEIVER_PROJECT_TITLE} root directory" +log_message "Returning to ${RECEIVER_PROJECT_TITLE} root directory" cd $RECEIVER_ROOT_DIRECTORY echo "" -LogTitleMessage "------------------------------------------------------------------------------" -LogTitleHeading "Fly Italy ADS-B client setup is complete" +log_title_message "------------------------------------------------------------------------------" +log_title_heading "Fly Italy ADS-B client setup is complete" echo "" read -p "Press enter to continue..." discard diff --git a/bash/feeders/openskynetwork.sh b/bash/feeders/openskynetwork.sh index 60d47145..6658963c 100755 --- a/bash/feeders/openskynetwork.sh +++ b/bash/feeders/openskynetwork.sh @@ -6,19 +6,19 @@ source $RECEIVER_BASH_DIRECTORY/variables.sh source $RECEIVER_BASH_DIRECTORY/functions.sh clear -LogProjectTitle -LogTitleHeading "Setting up the OpenSky Network client" -LogTitleMessage "------------------------------------------------------------------------------" +log_project_title +log_title_heading "Setting up the OpenSky Network client" +log_title_message "------------------------------------------------------------------------------" if ! 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; then echo "" - LogAlertHeading "INSTALLATION HALTED" - LogAlertMessage "Setup has been halted at the request of the user" + log_alert_heading "INSTALLATION HALTED" + log_alert_message "Setup has been halted at the request of the user" echo "" - LogTitleMessage "------------------------------------------------------------------------------" - LogTitleHeading "OpenSky Network client setup halted" + log_title_message "------------------------------------------------------------------------------" + log_title_heading "OpenSky Network client setup halted" echo "" exit 1 fi @@ -26,49 +26,49 @@ fi ## CHECK FOR PREREQUISITE PACKAGES -LogHeading "Installing packages needed to fulfill OpenSky Network client dependencies" +log_heading "Installing packages needed to fulfill OpenSky Network client dependencies" -CheckPackage apt-transport-https +check_package apt-transport-https ## ADD THE OPENSKY NETWORK APT REPOSITORY TO THE SYSTEM IF IT DOES NOT ALREADY EXIST -LogHeading "Setting up the OpenSky Network apt repository if it has not yet been setup...\e[97m" +log_heading "Setting up the OpenSky Network apt repository if it has not yet been setup...\e[97m" -LogMessage "Checking if the OpenSky Network apt repository is set up" +log_message "Checking if the OpenSky Network apt repository is set up" if ! grep -q "^deb .*opensky." /etc/apt/sources.list /etc/apt/sources.list.d/*; then - LogMessage "The OpenSky Network apt repository is not set up" + log_message "The OpenSky Network apt repository is not set up" if [[ ! -d $RECEIVER_BUILD_DIRECTORY/openskynetwork ]]; then - LogMessage "Creating the OpenSky Network build directory" + log_message "Creating the OpenSky Network build directory" echo "" mkdir -v $RECEIVER_BUILD_DIRECTORY/openskynetwork 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" fi - LogMessage "Entering the OpenSky Network build directory" + log_message "Entering the OpenSky Network build directory" cd $RECEIVER_BUILD_DIRECTORY/openskynetwork - LogMessage "Downloading and adding the OpenSky Network apt repository GPG key" + log_message "Downloading and adding the OpenSky Network apt repository GPG key" echo "" wget -v -O $RECEIVER_BUILD_DIRECTORY/openskynetwork/opensky.gpg.pub https://opensky-network.org/files/firmware/opensky.gpg.pub 2>&1 | tee -a $RECEIVER_LOG_FILE wget -q -O - https://opensky-network.org/files/firmware/opensky.gpg.pub | sudo apt-key add - 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" - LogMessage "Adding the OpenSky Network apt repository" + log_message "Adding the OpenSky Network apt repository" sudo bash -c "echo deb https://opensky-network.org/repos/debian opensky custom > /etc/apt/sources.list.d/opensky.list" else - LogMessage "The OpenSky Network apt repository is already set up" + log_message "The OpenSky Network apt repository is already set up" fi ## INSTALL THE OPENSKY NETWORK FEEDER PACKAGE USING APT -LogHeading "Installing the OpenSky Network feeder package" +log_heading "Installing the OpenSky Network feeder package" -LogMessage "Downloading the latest package lists for all enabled repositories and PPAs" +log_message "Downloading the latest package lists for all enabled repositories and PPAs" echo "" sudo apt-get update 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" -LogMessage "Installing the OpenSky Network fedder package using apt" +log_message "Installing the OpenSky Network fedder package using apt" echo "" sudo apt-get install opensky-feeder echo "" @@ -76,12 +76,12 @@ echo "" ## SETUP COMPLETE -LogMessage "Returning to ${RECEIVER_PROJECT_TITLE} root directory" +log_message "Returning to ${RECEIVER_PROJECT_TITLE} root directory" cd $RECEIVER_ROOT_DIRECTORY echo "" -LogTitleMessage "------------------------------------------------------------------------------" -LogTitleHeading "OpenSky Network client setup is complete" +log_title_message "------------------------------------------------------------------------------" +log_title_heading "OpenSky Network client setup is complete" echo "" read -p "Press enter to continue..." discard diff --git a/bash/feeders/piaware.sh b/bash/feeders/piaware.sh index cb23a20b..943dfcee 100755 --- a/bash/feeders/piaware.sh +++ b/bash/feeders/piaware.sh @@ -18,19 +18,19 @@ source $RECEIVER_BASH_DIRECTORY/variables.sh source $RECEIVER_BASH_DIRECTORY/functions.sh clear -LogProjectTitle -LogTitleHeading "Setting up the FlightAware PiAware client" -LogTitleMessage "------------------------------------------------------------------------------" +log_project_title +log_title_heading "Setting up the FlightAware PiAware client" +log_title_message "------------------------------------------------------------------------------" if ! 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; then echo "" - LogAlertHeading "INSTALLATION HALTED" - LogAlertMessage "Setup has been halted at the request of the user" + log_alert_heading "INSTALLATION HALTED" + log_alert_message "Setup has been halted at the request of the user" echo "" - LogTitleMessage "------------------------------------------------------------------------------" - LogTitleHeading "FlightAware PiAware client setup halted" + log_title_message "------------------------------------------------------------------------------" + log_title_heading "FlightAware PiAware client setup halted" echo "" exit 1 fi @@ -38,43 +38,43 @@ fi ## CHECK FOR PREREQUISITE PACKAGES -LogHeading "Installing packages needed to fulfill FlightAware PiAware client dependencies" - -CheckPackage autoconf -CheckPackage build-essential -CheckPackage chrpath -CheckPackage debhelper -CheckPackage devscripts -CheckPackage git -CheckPackage itcl3 -CheckPackage libboost-filesystem-dev -CheckPackage libboost-program-options-dev -CheckPackage libboost-regex-dev -CheckPackage libboost-system-dev -CheckPackage libssl-dev -CheckPackage net-tools -CheckPackage openssl -CheckPackage patchelf -CheckPackage python3-dev -CheckPackage python3-pip -CheckPackage python3-setuptools -CheckPackage python3-venv -CheckPackage python3-wheel -CheckPackage tcl-dev -CheckPackage tcl8.6-dev -CheckPackage tcllib -CheckPackage tclx8.4 -CheckPackage zlib1g-dev +log_heading "Installing packages needed to fulfill FlightAware PiAware client dependencies" + +check_package autoconf +check_package build-essential +check_package chrpath +check_package debhelper +check_package devscripts +check_package git +check_package itcl3 +check_package libboost-filesystem-dev +check_package libboost-program-options-dev +check_package libboost-regex-dev +check_package libboost-system-dev +check_package libssl-dev +check_package net-tools +check_package openssl +check_package patchelf +check_package python3-dev +check_package python3-pip +check_package python3-setuptools +check_package python3-venv +check_package python3-wheel +check_package tcl-dev +check_package tcl8.6-dev +check_package tcllib +check_package tclx8.4 +check_package zlib1g-dev if [[ "${RECEIVER_OS_CODE_NAME}" == "noble" ]]; then - CheckPackage python3-pyasyncore + check_package python3-pyasyncore fi if [[ "${RECEIVER_OS_CODE_NAME}" == "focal" ]]; then - CheckPackage python3-dev + check_package python3-dev else - CheckPackage python3-build - CheckPackage tcl-tls + check_package python3-build + check_package tcl-tls fi @@ -82,22 +82,22 @@ fi if [[ "${RECEIVER_OS_CODE_NAME}" == "focal" ]]; then - LogHeading "Preparing the FlightAware tcltls-rebuild Git repository" + log_heading "Preparing the FlightAware tcltls-rebuild Git repository" if [[ -d $RECEIVER_BUILD_DIRECTORY/tcltls-rebuild && -d $RECEIVER_BUILD_DIRECTORY/tcltls-rebuild/.git ]]; then - LogMessage "Entering the tcltls-rebuild git repository directory" + log_message "Entering the tcltls-rebuild git repository directory" cd $RECEIVER_BUILD_DIRECTORY/tcltls-rebuild - LogMessage "Updating the local tcltls-rebuild git repository" + log_message "Updating the local tcltls-rebuild git repository" echo "" git pull 2>&1 | tee -a $RECEIVER_LOG_FILE else - LogMessage "Creating the tcltls-rebuild build directory" + log_message "Creating the tcltls-rebuild build directory" echo "" mkdir -v $RECEIVER_BUILD_DIRECTORY/tcltls-rebuild 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" - LogMessage "Entering the tcltls-rebuild build directory" + log_message "Entering the tcltls-rebuild build directory" cd $RECEIVER_BUILD_DIRECTORY/tcltls-rebuild - LogMessage "Cloning the tcltls-rebuild git repository locally" + log_message "Cloning the tcltls-rebuild git repository locally" echo "" git clone https://github.com/flightaware/tcltls-rebuild 2>&1 | tee -a $RECEIVER_LOG_FILE fi @@ -106,42 +106,42 @@ if [[ "${RECEIVER_OS_CODE_NAME}" == "focal" ]]; then ## BUILD AND INSTALL THE TCLTLS-REBUILD PACKAGE - LogHeading "Beginning the FlightAware tcltls-rebuild installation process" + log_heading "Beginning the FlightAware tcltls-rebuild installation process" - LogMessage "Checking if the FlightAware tcltls-rebuild is required" + log_message "Checking if the FlightAware tcltls-rebuild is required" - LogMessage "Entering the tcltls-rebuild source directory" + log_message "Entering the tcltls-rebuild source directory" cd $RECEIVER_BUILD_DIRECTORY/tcltls-rebuild/tcltls-1.7.22 - LogMessage "Building the tcltls-rebuild package" + log_message "Building the tcltls-rebuild package" echo "" dpkg-buildpackage -b 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" - LogMessage "Installing the tcltls-rebuild package" + log_message "Installing the tcltls-rebuild package" echo "" sudo dpkg -i $RECEIVER_BUILD_DIRECTORY/tcltls-rebuild/tcl-tls_1.7.22-2+fa1_*.deb 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" - LogMessage "Checking that the FlightAware tcltls-rebuild package was installed properly" + log_message "Checking that the FlightAware tcltls-rebuild package was installed properly" if [[ $(dpkg-query -W -f='${STATUS}' tcltls 2>/dev/null | grep -c "ok installed") -eq 0 ]]; then echo "" - LogAlertHeading "INSTALLATION HALTED" + log_alert_heading "INSTALLATION HALTED" echo "" - LogAlertMessage "FlightAware tcltls-rebuild package installation failed" - LogAlertMessage "Setup has been terminated" + log_alert_message "FlightAware tcltls-rebuild package installation failed" + log_alert_message "Setup has been terminated" echo "" - LogTitleMessage "------------------------------------------------------------------------------" - LogTitleHeading "FlightAware PiAware client setup failed" + log_title_message "------------------------------------------------------------------------------" + "FlightAware PiAware client setup failed" echo "" read -p "Press enter to continue..." discard exit 1 else if [[ ! -d $RECEIVER_BUILD_DIRECTORY/package-archive ]]; then - LogMessage "Creating the package archive directory" + log_message "Creating the package archive directory" echo "" mkdir -v $RECEIVER_BUILD_DIRECTORY/package-archive 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" fi - LogMessage "Copying the FlightAware tcltls-rebuild Debian package into the archive directory" + log_message "Copying the FlightAware tcltls-rebuild Debian package into the archive directory" echo "" cp -vf $RECEIVER_BUILD_DIRECTORY/tcltls-rebuild/*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ 2>&1 | tee -a $RECEIVER_LOG_FILE fi @@ -150,22 +150,22 @@ fi ## CLONE OR PULL THE PIAWARE_BUILDER GIT REPOSITORY -LogHeading "Preparing the FlightAware piaware_builder Git repository" +log_heading "Preparing the FlightAware piaware_builder Git repository" if [[ -d $RECEIVER_BUILD_DIRECTORY/piaware_builder && -d $RECEIVER_BUILD_DIRECTORY/piaware_builder/.git ]]; then - LogMessage "Entering the piaware_builder git repository directory" + log_message "Entering the piaware_builder git repository directory" cd $RECEIVER_BUILD_DIRECTORY/piaware_builder - LogMessage "Updating the local piaware_builder git repository" + log_message "Updating the local piaware_builder git repository" echo "" git pull 2>&1 | tee -a $RECEIVER_LOG_FILE else - LogMessage "Creating the FlightAware piaware_builder build directory" + log_message "Creating the FlightAware piaware_builder build directory" echo "" mkdir -v $RECEIVER_BUILD_DIRECTORY/piaware_builder 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" - LogMessage "Entering the ADS-B Receiver Project build directory" + log_message "Entering the ADS-B Receiver Project build directory" cd $RECEIVER_BUILD_DIRECTORY - LogMessage "Cloning the piaware_builder git repository locally" + log_message "Cloning the piaware_builder git repository locally" echo "" git clone https://github.com/flightaware/piaware_builder.git 2>&1 | tee -a $RECEIVER_LOG_FILE fi @@ -173,12 +173,12 @@ fi ## BUILD AND INSTALL THE PIAWARE CLIENT PACKAGE -LogHeading "Beginning the FlightAware PiAware installation process" +log_heading "Beginning the FlightAware PiAware installation process" -LogMessage "Entering the piaware_builder git repository directory" +log_message "Entering the piaware_builder git repository directory" cd $RECEIVER_BUILD_DIRECTORY/piaware_builder -LogMessage "Determining which piaware_builder build strategy should be use" +log_message "Determining which piaware_builder build strategy should be use" distro="bookworm" case $RECEIVER_OS_CODE_NAME in focal) @@ -191,43 +191,43 @@ case $RECEIVER_OS_CODE_NAME in distro="bookworm" ;; esac -LogMessage "Setting distribution to build for to ${distro}" +log_message "Setting distribution to build for to ${distro}" -LogMessage "Executing the FlightAware PiAware client build script" +log_message "Executing the FlightAware PiAware client build script" echo "" ./sensible-build.sh $distro 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" -LogMessage "Entering the FlightAware PiAware client build directory" +log_message "Entering the FlightAware PiAware client build directory" cd $RECEIVER_BUILD_DIRECTORY/piaware_builder/package-${distro} -LogMessage "Building the FlightAware PiAware client package" +log_message "Building the FlightAware PiAware client package" echo "" dpkg-buildpackage -b 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" -LogMessage "Installing the FlightAware PiAware client package" +log_message "Installing the FlightAware PiAware client package" echo "" sudo dpkg -i $RECEIVER_BUILD_DIRECTORY/piaware_builder/piaware_*.deb 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" -LogMessage "Checking that the FlightAware PiAware client package was installed properly" +log_message "Checking that the FlightAware PiAware client package was installed properly" if [[ $(dpkg-query -W -f='${STATUS}' piaware 2>/dev/null | grep -c "ok installed") -eq 0 ]]; then - LogAlertHeading "INSTALLATION HALTED" + log_alert_heading "INSTALLATION HALTED" echo "" - LogAlertMessage "FlightAware PiAware package installation failed" - LogAlertMessage "Setup has been terminated" + log_alert_message "FlightAware PiAware package installation failed" + log_alert_message "Setup has been terminated" echo "" - LogTitleMessage "------------------------------------------------------------------------------" - LogTitleHeading "FlightAware PiAware client setup failed" + log_title_message "------------------------------------------------------------------------------" + log_title_heading "FlightAware PiAware client setup failed" echo "" read -p "Press enter to continue..." discard exit 1 else if [[ ! -d $RECEIVER_BUILD_DIRECTORY/package-archive ]]; then - LogMessage "Creating the package archive directory" + log_message "Creating the package archive directory" echo "" mkdir -v $RECEIVER_BUILD_DIRECTORY/package-archive 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" fi - LogMessage "Copying the FlightAware PiAware client binary package into the archive directory" + log_message "Copying the FlightAware PiAware client binary package into the archive directory" echo "" cp -vf $RECEIVER_BUILD_DIRECTORY/piaware_builder/*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ 2>&1 | tee -a $RECEIVER_LOG_FILE fi @@ -235,9 +235,9 @@ fi ## POST INSTALLATION OPERATIONS -LogHeading "Performing post installation operations" +log_heading "Performing post installation operations" -LogMessage "Displaying the message informing the user on how to claim their device" +log_message "Displaying the message informing the user on how to claim their device" whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ --title "Claiming Your PiAware Device" \ --msgbox "FlightAware requires you claim your feeder online using the following URL:\n\n http://flightaware.com/adsb/piaware/claim\n\nTo claim your device simply visit the address listed above." \ @@ -246,12 +246,12 @@ whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ ## SETUP COMPLETE -LogMessage "Returning to ${RECEIVER_PROJECT_TITLE} root directory" +log_message "Returning to ${RECEIVER_PROJECT_TITLE} root directory" cd $RECEIVER_ROOT_DIRECTORY echo "" -LogTitleMessage "------------------------------------------------------------------------------" -LogTitleHeading "FlightAware PiAware client setup is complete" +log_title_message "------------------------------------------------------------------------------" +log_title_heading "FlightAware PiAware client setup is complete" echo "" read -p "Press enter to continue..." discard diff --git a/bash/feeders/planefinder.sh b/bash/feeders/planefinder.sh index 0ff95cd5..0f7b4092 100755 --- a/bash/feeders/planefinder.sh +++ b/bash/feeders/planefinder.sh @@ -6,19 +6,19 @@ source $RECEIVER_BASH_DIRECTORY/variables.sh source $RECEIVER_BASH_DIRECTORY/functions.sh clear -LogProjectTitle -LogTitleHeading "Setting up the PlaneFinder client" -LogTitleMessage "------------------------------------------------------------------------------" +log_project_title +log_title_heading "Setting up the PlaneFinder client" +log_title_message "------------------------------------------------------------------------------" if ! 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; then echo "" - LogAlertHeading "INSTALLATION HALTED" - LogAlertMessage "Setup has been halted at the request of the user" + log_alert_heading "INSTALLATION HALTED" + log_alert_message "Setup has been halted at the request of the user" echo "" - LogTitleMessage "------------------------------------------------------------------------------" - LogTitleHeading "PlaneFinder client setup halted" + log_title_message "------------------------------------------------------------------------------" + log_title_heading "PlaneFinder client setup halted" echo "" exit 1 fi @@ -26,14 +26,14 @@ fi ## CHECK FOR PREREQUISITE PACKAGES -LogHeading "Installing packages needed to fulfill PlaneFinder client dependencies" +log_heading "Installing packages needed to fulfill PlaneFinder client dependencies" -CheckPackage wget +check_package wget case "${RECIEVER_CPU_ARCHITECTURE}" in "aarch64") sudo dpkg --add-architecture armhf - CheckPackage libc6:armhf + check_package libc6:armhf ;; esac @@ -41,10 +41,10 @@ esac ## DOWNLOAD AND INSTALL THE PROPER PLANEFINDER CLIENT DEBIAN PACKAGE -LogHeading "Begining the PlaneFinder client installation process" +log_heading "Begining the PlaneFinder client installation process" -LogMessage "Determining which Debian package to install" +log_message "Determining which Debian package to install" case "${RECIEVER_CPU_ARCHITECTURE}" in "armv7l"|"armv6l") package_name="pfclient_${PLANEFINDER_CLIENT_VERSION_ARMHF}_armhf.deb" @@ -60,14 +60,14 @@ case "${RECIEVER_CPU_ARCHITECTURE}" in ;; *) echo "" - LogAlertHeading "INSTALLATION HALTED" + log_alert_heading "INSTALLATION HALTED" echo "" - LogAlertMessage "Unsupported CPU Archetecture" - LogAlertMessage "Archetecture Detected: ${CPU_ARCHITECTURE}" - LogAlertMessage "Setup has been terminated" + log_alert_message "Unsupported CPU Archetecture" + log_alert_message "Archetecture Detected: ${CPU_ARCHITECTURE}" + log_alert_message "Setup has been terminated" echo "" - LogTitleMessage "------------------------------------------------------------------------------" - LogTitleHeading "PlaneFinder client setup failed" + log_title_message "------------------------------------------------------------------------------" + log_title_heading "PlaneFinder client setup failed" echo "" read -p "Press enter to continue..." discard exit 1 @@ -75,31 +75,31 @@ case "${RECIEVER_CPU_ARCHITECTURE}" in esac if [[ ! -d $RECEIVER_BUILD_DIRECTORY/planefinder ]]; then - LogMessage "Creating the PlaneFinder build directory" + log_message "Creating the PlaneFinder build directory" echo "" mkdir -vp $RECEIVER_BUILD_DIRECTORY/planefinder echo "" fi -LogMessage "Entering the PlaneFinder build directory" +log_message "Entering the PlaneFinder build directory" cd $RECEIVER_BUILD_DIRECTORY/planefinder -LogMessage "Downloading the appropriate PlaneFinder client Debian package" +log_message "Downloading the appropriate PlaneFinder client Debian package" echo "" wget -v -O $RECEIVER_BUILD_DIRECTORY/planefinder/$package_name http://client.planefinder.net/$package_name 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" -LogMessage "Installing the PlaneFinder Client Debian package" +log_message "Installing the PlaneFinder Client Debian package" echo -e "" sudo dpkg -i $RECEIVER_BUILD_DIRECTORY/planefinder/$package_name 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" if [[ ! -d $RECEIVER_BUILD_DIRECTORY/package-archive ]]; then - LogMessage "Creating the package archive directory" + log_message "Creating the package archive directory" echo "" mkdir -v $RECEIVER_BUILD_DIRECTORY/package-archive 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" fi -LogMessage "Copying the PlaneFinder client Debian package into the archive directory" +log_message "Copying the PlaneFinder client Debian package into the archive directory" echo "" cp -vf $RECEIVER_BUILD_DIRECTORY/planefinder/$package_name $RECEIVER_BUILD_DIRECTORY/package-archive/ 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" @@ -107,9 +107,9 @@ echo "" ## POST INSTALLATION OPERATIONS -LogHeading "Performing post installation operations" +log_heading "Performing post installation operations" -LogMessage "Displaying the message informing the user on how to complete setup" +log_message "Displaying the message informing the user on how to complete setup" RECEIVER_IP_ADDRESS=`ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/'` whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ --title "PlaneFinder ADS-B Client Setup Instructions" \ @@ -119,12 +119,12 @@ whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ ## SETUP COMPLETE -LogMessage "Returning to ${RECEIVER_PROJECT_TITLE} root directory" +log_message "Returning to ${RECEIVER_PROJECT_TITLE} root directory" cd $RECEIVER_ROOT_DIRECTORY echo "" -LogTitleMessage "------------------------------------------------------------------------------" -LogTitleHeading "PlaneFinder client setup is complete" +log_title_message "------------------------------------------------------------------------------" +log_title_heading "PlaneFinder client setup is complete" echo "" read -p "Press enter to continue..." discard diff --git a/bash/functions.sh b/bash/functions.sh index 21c9912e..4fc072b3 100755 --- a/bash/functions.sh +++ b/bash/functions.sh @@ -2,8 +2,8 @@ ## LOGGING FUNCTIONS -# LogToFile -function LogToFile() { +# Log a to the log file +function log_to_file() { if [[ "${RECEIVER_LOGGING_ENABLED}" == "true" ]]; then time_stamp='' if [[ -z $2 || "${2}" == "true" ]]; then @@ -18,114 +18,110 @@ function LogToFile() { fi } -function LogOutput() { - LogToFile "${1}" -} - # Logs the "PROJECT TITLE" to the console -function LogProjectTitle { - LogToFile "${RECEIVER_PROJECT_TITLE}" +function log_project_title() { + log_to_file "${RECEIVER_PROJECT_TITLE}" echo -e "${display_project_name} ${RECEIVER_PROJECT_TITLE}${display_default}" echo "" } # Logs a "HEADING" to the console -function LogHeading() { - LogToFile "${1}" +function log_heading() { + log_to_file "${1}" echo "" echo -e "${display_heading} ${1}${display_default}" echo "" } # Logs a "MESSAGE" to the console -function LogMessage() { - LogToFile "${1}" +function log_message() { + log_to_file "${1}" echo -e "${display_message} ${1}${display_default}" } # Logs an alert "HEADING" to the console -function LogAlertHeading() { - LogToFile "${1}" +function log_alert_heading() { + log_to_file "${1}" echo -e "${display_alert_heading} ${1}${display_default}" } # Logs an alert "MESSAGE" to the console -function LogAlertMessage() { - LogToFile "${1}" +function log_alert_message() { + log_to_file "${1}" echo -e "${display_alert_message} ${1}${display_default}" } # Logs an title "HEADING" to the console -function LogTitleHeading() { - LogToFile "${1}" +function log_title_heading() { + log_to_file "${1}" echo -e "${display_title_heading} ${1}${display_default}" } # Logs an title "MESSAGE" to the console -function LogTitleMessage() { - LogToFile "${1}" +function log_title_message() { + log_to_file "${1}" echo -e "${display_title_message} ${1}${display_default}" } # Logs a warning "HEADING" to the console -function LogWarningHeading() { - LogToFile "${1}" +function log_warning_heading() { + log_to_file "${1}" echo -e "${display_warning_heading} ${1}${display_default}" } # Logs a warning "MESSAGE" to the console -function LogWarningMessage() { - LogToFile "${1}" +function log_warning_message() { + log_to_file "${1}" echo -e "${display_warning_message} ${1}${display_default}" } -function LogMessageInline() { - LogToFile "${1}" "true" "inline" +function log_message_inline() { + log_to_file "${1}" "true" "inline" printf "${display_message} ${1}${display_default}" } -function LogFalseInline() { - LogToFile "${1}" "false" +function log_false_inline() { + log_to_file "${1}" "false" echo -e "${display_false_inline} ${1}${display_default}" } -function LogTrueInline() { - LogToFile "${1}" "false" +function log_true_inline() { + log_to_file "${1}" "false" echo -e "${display_true_inline} ${1}${display_default}" } ## CHECK IF THE SUPPLIED PACKAGE IS INSTALLED AND IF NOT ATTEMPT TO INSTALL IT -function CheckPackage() { +function check_package() { attempt=1 max_attempts=5 wait_time=5 while (( $attempt -le `(($max_attempts + 1))` )); do if [[ $attempt > $max_attempts ]]; then - LogAlertHeading "INSTALLATION HALTED" - LogAlertMessage "Unable to install a required package" - LogAlertMessage "The package $1 could not be installed in ${max_attempts} attempts" + log_alert_heading "INSTALLATION HALTED" + log_alert_message "Unable to install a required package" + log_alert_message "The package $1 could not be installed in ${max_attempts} attempts" exit 1 fi - LogMessageInline "Checking if the package $1 is installed" + log_message_inline "Checking if the package $1 is installed" if [[ $(dpkg-query -W -f='${STATUS}' $1 2>/dev/null | grep -c "ok installed") = 0 ]]; then if [[ $attempt > 1 ]]; then - LogAlertMessage "Inastallation attempt failed" - LogAlertMessage "Will attempt to Install the package $1 again in ${wait_time} seconds (attempt ${attempt} of ${max_attempts})" + log_alert_message "Inastallation attempt failed" + log_alert_message "Will attempt to Install the package $1 again in ${wait_time} seconds (attempt ${attempt} of ${max_attempts})" sleep $wait_time else - LogFalseInline "[NOT INSTALLED]" - LogMessage "Installing the package ${1}" + log_false_inline "[NOT INSTALLED]" + log_message "Installing the package ${1}" fi echo "" attempt=$((attempt+1)) sudo apt-get install -y $1 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" else - LogTrueInline "[OK]" + log_true_inline "[OK]" break fi done @@ -134,9 +130,9 @@ function CheckPackage() { ## BLACKLIST DVB-T DRIVERS FOR RTL-SDR DEVICES -function BlacklistModules() { +function blacklist_modules() { if [[ ! -f /etc/modprobe.d/rtlsdr-blacklist.conf || `cat /etc/modprobe.d/rtlsdr-blacklist.conf | wc -l` < 9 ]]; then - LogMessage "Blacklisting unwanted RTL-SDR kernel modules so they are not loaded" + log_message "Blacklisting unwanted RTL-SDR kernel modules so they are not loaded" sudo tee /etc/modprobe.d/rtlsdr-blacklist.conf > /dev/null <&1 | tee -a $RECEIVER_LOG_FILE echo "" else - LogAlertHeading "INSTALLATION HALTED" - LogAlertMessage "Setup has been halted at the request of the user" + log_alert_heading "INSTALLATION HALTED" + log_alert_message "Setup has been halted at the request of the user" echo "" exit 1 fi fi if [[ "${current_branch}" != "${RECEIVER_PROJECT_BRANCH}" ]]; then - LogMessage "Switching to branch ${RECEIVER_PROJECT_BRANCH}" + log_message "Switching to branch ${RECEIVER_PROJECT_BRANCH}" echo "" git checkout $RECEIVER_PROJECT_BRANCH 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" fi if [[ `git ls-remote --heads https://github.com/jprochazka/adsb-receiver.git refs/heads/$RECEIVER_PROJECT_BRANCH | wc -l` = 1 ]]; then - LogMessage "Fetching branch ${RECEIVER_PROJECT_BRANCH} from origin" + log_message "Fetching branch ${RECEIVER_PROJECT_BRANCH} from origin" echo "" git fetch origin 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" - LogMessage "Performing hard reset of branch ${RECEIVER_PROJECT_BRANCH} so it matches origin/${RECEIVER_PROJECT_BRANCH}" + log_message "Performing hard reset of branch ${RECEIVER_PROJECT_BRANCH} so it matches origin/${RECEIVER_PROJECT_BRANCH}" echo "" git reset --hard origin/$RECEIVER_PROJECT_BRANCH else - LogMessage "The branch ${RECEIVER_PROJECT_BRANCH} does not appear to be in origin" + log_message "The branch ${RECEIVER_PROJECT_BRANCH} does not appear to be in origin" fi - LogTitleMessage "-----------------------------------------------------------------------------" - LogTitleHeading "Finished fetching the latest version the '${RECEIVER_PROJECT_BRANCH}' branch." + log_title_message "-----------------------------------------------------------------------------" + log_title_heading "Finished fetching the latest version the '${RECEIVER_PROJECT_BRANCH}' branch." echo "" read -p "Press enter to continue..." discard fi @@ -80,26 +80,26 @@ fi ## ASK IF OPERATING SYSTEM SHOULD BE UPDATED -LogHeading "Performing operating system updates if so desired" +log_heading "Performing operating system updates if so desired" -LogMessage "Asking the user if they wish to update the operating system" +log_message "Asking the user if they wish to update the operating system" if 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; then clear - LogProjectTitle - LogTitleHeading "Downloading and installing the latest updates for your operating system" - LogTitleMessage "------------------------------------------------------------------------------" + log_project_title + log_title_heading "Downloading and installing the latest updates for your operating system" + log_title_message "------------------------------------------------------------------------------" - LogHeading "Updating the operating system" + log_heading "Updating the operating system" - LogMessage "Updating the operating system using apt-get" + log_message "Updating the operating system using apt-get" echo "" sudo apt-get -y dist-upgrade 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" - LogTitleMessage "------------------------------------------------------------------------" - LogTitleHeading "Your operating system should now be up to date" + log_title_message "------------------------------------------------------------------------" + log_title_heading "Your operating system should now be up to date" echo "" read -p "Press enter to continue..." discard fi @@ -107,16 +107,16 @@ fi ## EXECUTE BASH/MAIN.SH -LogHeading "Executing the script bash/main.sh" +log_heading "Executing the script bash/main.sh" -LogMessage "Adding execute permissions to bash/main" +log_message "Adding execute permissions to bash/main" chmod +x $RECEIVER_BASH_DIRECTORY/main.sh -LogMessage "Executing bash/main" +log_message "Executing bash/main" bash $RECEIVER_BASH_DIRECTORY/main.sh if [[ $? -ne 0 ]] ; then echo "" - LogAlertHeading "ANY FURTHER SETUP AND/OR INSTALLATION REQUESTS HAVE BEEN TERMINIATED" + log_alert_heading "ANY FURTHER SETUP AND/OR INSTALLATION REQUESTS HAVE BEEN TERMINIATED" echo "" exit 1 fi @@ -130,7 +130,7 @@ whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ 20 65 echo "" -LogAlertHeading "Installation complete" +log_alert_heading "Installation complete" echo "" exit 0 diff --git a/bash/main.sh b/bash/main.sh index 75f6092c..3a9b8ded 100755 --- a/bash/main.sh +++ b/bash/main.sh @@ -310,7 +310,7 @@ if [[ "${install_1090mhz_decoder}" == "false" && "${install_1090mhz_decoder}" == --msgbox "Nothing has been selected to be installed so the script will exit now." \ 10 65 echo "" - LogAlertHeading "Nothing was selected to do or be installed" + log_alert_heading "Nothing was selected to do or be installed" echo "" exit 1 else @@ -361,7 +361,7 @@ fi confirmation_message="${confirmation_message}Do you wish to continue setup?" if ! (whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Confirm You Wish To Continue" --yesno "${confirmation_message}" 21 78); then echo "" - LogAlertHeading "Installation cancelled by user" + log_alert_heading "Installation cancelled by user" echo "" exit 1 fi diff --git a/bash/portal/graphs.sh b/bash/portal/graphs.sh index 8f474d8b..c649601b 100755 --- a/bash/portal/graphs.sh +++ b/bash/portal/graphs.sh @@ -69,9 +69,9 @@ fi if [[ "${DUMP1090_INSTALLED}" = "true" ]] && [[ "${DUMP1090_FORK}" = "mutability" ]] ; then echo -e "\e[94m Modifying the dump1090-mutability configuration file to add noise measurements...\e[97m" - EXTRA_ARGS=`GetConfig "EXTRA_ARGS" "/etc/default/dump1090-mutability"` + EXTRA_ARGS=`get_config "EXTRA_ARGS" "/etc/default/dump1090-mutability"` EXTRA_ARGS=$(sed -e 's/^[[:space:]]*//' <<<"EXTRA_ARGS --measure-noise") - ChangeConfig "EXTRA_ARGS" "${RECEIVER_LONGITUDE}" "/etc/default/dump1090-mutability" + change_config "EXTRA_ARGS" "${RECEIVER_LONGITUDE}" "/etc/default/dump1090-mutability" echo -e "\e[94m Reloading the systemd manager configuration...\e[97m" sudo systemctl daemon-reload diff --git a/bash/portal/install.sh b/bash/portal/install.sh index 5befe40f..64ff58b1 100755 --- a/bash/portal/install.sh +++ b/bash/portal/install.sh @@ -38,7 +38,7 @@ fi # We will need to make sure Lighttpd is installed first before we go any further. echo -e "\e[95m Installing packages needed to fulfill dependencies...\e[97m" echo -e "" -CheckPackage lighttpd +check_package lighttpd # Assign the Lighthttpd document root directory to a variable. RAW_DOCUMENT_ROOT=`/usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf -p | grep server.document-root` @@ -110,7 +110,7 @@ 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 mariadb-server + check_package 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 @@ -219,44 +219,44 @@ case $RECEIVER_OS_DISTRIBUTION in esac # Install PHP. -CheckPackage php${DISTRO_PHP_VERSION}-cgi +check_package php${DISTRO_PHP_VERSION}-cgi if (( $(echo "${DISTRO_PHP_VERSION} < 8" | bc -l) )); then - CheckPackage php${DISTRO_PHP_VERSION}-json + check_package php${DISTRO_PHP_VERSION}-json fi # Performance graph dependencies. -CheckPackage collectd-core -CheckPackage rrdtool +check_package collectd-core +check_package rrdtool # Portal dependencies. if [ "$RECEIVER_MTA" == "POSTFIX" ] || [ -z "$RECEIVER_MTA" ]; then - CheckPackage postfix + check_package postfix fi -CheckPackage libpython3-stdlib +check_package libpython3-stdlib # Install packages needed for advanced portal setups. if [[ "${ADVANCED}" = "true" ]] ; then - CheckPackage python3-pyinotify - CheckPackage python3-apt + check_package python3-pyinotify + check_package python3-apt case "${DATABASEENGINE}" in "MySQL") - CheckPackage mariadb-client - CheckPackage python3-mysqldb - CheckPackage php${DISTRO_PHP_VERSION}-mysql + check_package mariadb-client + check_package python3-mysqldb + check_package php${DISTRO_PHP_VERSION}-mysql ;; "SQLite") - CheckPackage sqlite3 + check_package sqlite3 if [ `bc -l <<< "$DISTRO_PHP_VERSION >= 7.0"` -eq 1 ]; then - CheckPackage php${DISTRO_PHP_VERSION}-sqlite3 + check_package php${DISTRO_PHP_VERSION}-sqlite3 else - CheckPackage php${DISTRO_PHP_VERSION}-sqlite + check_package php${DISTRO_PHP_VERSION}-sqlite fi ;; esac else if [ ! $DISTRO_PHP_VERSION == "5" ]; then - CheckPackage php${DISTRO_PHP_VERSION}-xml + check_package php${DISTRO_PHP_VERSION}-xml fi fi diff --git a/install.sh b/install.sh index d1a1a19c..bd8d69ac 100755 --- a/install.sh +++ b/install.sh @@ -147,7 +147,7 @@ source $RECEIVER_BASH_DIRECTORY/variables.sh if [[ "${RECEIVER_LOGGING_ENABLED}" == "true" ]]; then export RECEIVER_LOG_FILE=$PWD/logs/$log_file if [ ! -d "$DIRECTORY" ]; then - LogMessage "Creating logs directory" + log_message "Creating logs directory" mkdir $PWD/logs fi fi @@ -156,27 +156,27 @@ fi ## UPDATE PACKAGE LISTS AND INSTALL DEPENDENCIES clear -LogProjectTitle -LogTitleHeading "Starting ADS-B Receiver Installer package dependency check" -LogTitleMessage "------------------------------------------------------------------------------" +log_project_title +log_title_heading "Starting ADS-B Receiver Installer package dependency check" +log_title_message "------------------------------------------------------------------------------" -LogHeading "Updating package lists for all enabled repositories and PPAs" +log_heading "Updating package lists for all enabled repositories and PPAs" -LogMessage "Downloading the latest package lists for all enabled repositories and PPAs" +log_message "Downloading the latest package lists for all enabled repositories and PPAs" echo "" sudo apt-get update 2>&1 | tee -a $RECEIVER_LOG_FILE -LogHeading "Ensuring that all required packages are installed" +log_heading "Ensuring that all required packages are installed" -CheckPackage bc -CheckPackage git -CheckPackage lsb-base -CheckPackage lsb-release -CheckPackage whiptail +check_package bc +check_package git +check_package lsb-base +check_package lsb-release +check_package whiptail echo "" -LogTitleMessage "------------------------------------------------------------------------------" -LogTitleHeading "ADS-B Receiver Installer package dependency check complete" +log_title_message "------------------------------------------------------------------------------" +log_title_heading "ADS-B Receiver Installer package dependency check complete" echo "" read -p "Press enter to continue..." discard From 6e5727ad36ee3e0878eed58d330991d90d3edff8 Mon Sep 17 00:00:00 2001 From: jprochazka Date: Tue, 23 Jul 2024 17:50:50 -0400 Subject: [PATCH 24/26] Use jprochazka fork until Trixie fix is merged. --- bash/feeders/piaware.sh | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/bash/feeders/piaware.sh b/bash/feeders/piaware.sh index 943dfcee..4c16acc6 100755 --- a/bash/feeders/piaware.sh +++ b/bash/feeders/piaware.sh @@ -2,6 +2,15 @@ # THE FLIGHTAWARE PIAWARE CLIENT SETUP SCRIPT +# JPROCHAZKA/PIAWARE_BUILDER REPOSITORY +# ----------------------------------------------------------------------------------- +# I submitted a fix to support Debian Trixie and Ubuntu Noble Numbat to FlightAware's +# piaware_builder repository. Until the changes are merged into their Git reposiory +# the installation will be done using the fork I created along with the branch which +# contains the changes needed in order to build the package. +# +# https://github.com/flightaware/piaware_builder/pull/26 + # TCLTLS-REBUILD # ----------------------------------------------------------------------------------- # Along with PiAware, a version of tcltls maintained by FlightAware can be installed. @@ -167,7 +176,16 @@ else cd $RECEIVER_BUILD_DIRECTORY log_message "Cloning the piaware_builder git repository locally" echo "" - git clone https://github.com/flightaware/piaware_builder.git 2>&1 | tee -a $RECEIVER_LOG_FILE + + # --- START TEMPORARY NOBLE FIX --- + if [[ "${RECEIVER_OS_CODE_NAME}" == "noble" ]]; then + git clone https://github.com/jprochazka/piaware_builder.git 2>&1 | tee -a $RECEIVER_LOG_FILE + else + git clone https://github.com/flightaware/piaware_builder.git 2>&1 | tee -a $RECEIVER_LOG_FILE + fi + + #git clone https://github.com/flightaware/piaware_builder.git 2>&1 | tee -a $RECEIVER_LOG_FILE + # --- END TEMPORARY NOBLE FIX --- fi @@ -178,6 +196,12 @@ log_heading "Beginning the FlightAware PiAware installation process" log_message "Entering the piaware_builder git repository directory" cd $RECEIVER_BUILD_DIRECTORY/piaware_builder +# --- START TEMPORARY NOBLE FIX --- +if [[ "${RECEIVER_OS_CODE_NAME}" == "noble" ]]; then + git checkout trixie +fi +# --- END TEMPORARY NOBLE FIX --- + log_message "Determining which piaware_builder build strategy should be use" distro="bookworm" case $RECEIVER_OS_CODE_NAME in From af5b30d07cdb061e29d89bab1f89124366086787 Mon Sep 17 00:00:00 2001 From: jprochazka Date: Tue, 23 Jul 2024 20:38:11 -0400 Subject: [PATCH 25/26] Testing and debugging after changes. --- .gitignore | 4 ++ CHANGELOG.md | 1 + bash/extras/beastsplitter.sh | 9 ++-- bash/extras/duckdns.sh | 31 ++++++------ bash/feeders/airplaneslive.sh | 19 +++++--- bash/feeders/flyitalyadsb.sh | 3 +- bash/feeders/planefinder.sh | 11 ++--- bash/init.sh | 9 ++-- bash/main.sh | 90 +++++++++++++++++++++++++++-------- bash/variables.sh | 8 ++-- 10 files changed, 121 insertions(+), 64 deletions(-) diff --git a/.gitignore b/.gitignore index a96c7bef..7f4562fa 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,9 @@ EXTRAS_CHOICES FEEDER_CHOICES +build/adsbexchange +build/airplaneslive +build/beast-splitter +build/duckdns build/dump1090* build/dump978* build/flightradar24 diff --git a/CHANGELOG.md b/CHANGELOG.md index bf4db2bb..8a60d662 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ The following is a history of the changes made to this project. * Added the --version and -v arguments in order to display the current project version. * Additional script cleanup done to various files. * Removed scripting used for image setup. +* Updated the latest Flightradar24 Client version to 1.0.48-0. ## v2.8.4 *(July 13th, 2024)* :rooster: diff --git a/bash/extras/beastsplitter.sh b/bash/extras/beastsplitter.sh index 3c8110b6..38d15abd 100755 --- a/bash/extras/beastsplitter.sh +++ b/bash/extras/beastsplitter.sh @@ -27,6 +27,8 @@ fi ## GATHER REQUIRED INFORMATION FROM THE USER +log_heading "Gather information required to configure beast-splitter" + log_message "Asking user if beast-splitter should be enabled" if whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ --title "Enable Beast Splitter" \ @@ -41,7 +43,7 @@ log_message "Asking user for the beast-splitter input option" input_options=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ --title "Input Options for Beast Splitter" \ --inputbox "Enter the option telling Beast Splitter where to read data from. You should provide one of the following either --net or --serial.\n\nExamples:\n--serial /dev/beast\n--net remotehost:remoteport" \ - 8 78) + 8 78 3>&1 1>&2 2>&3) if [[ $input_options == 0 ]]; then log_alert_heading "INSTALLATION HALTED" log_alert_message "Setup has been halted due to lack of required information" @@ -55,7 +57,7 @@ log_message "Asking user for the beast-splitter output option" 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) + 8 78 3>&1 1>&2 2>&3) if [[ $output_options == 0 ]]; then log_alert_heading "INSTALLATION HALTED" log_alert_message "Setup has been halted due to lack of required information" @@ -114,7 +116,9 @@ dpkg-buildpackage -b 2>&1 | tee -a $RECEIVER_LOG_FILE echo "" log_message "Installing the beast-splitter Debian package" +echo "" sudo dpkg -i $RECEIVER_BUILD_DIRECTORY/beast-splitter/beast-splitter_*.deb 2>&1 | tee -a $RECEIVER_LOG_FILE +echo "" log_message "Checking that the beast-splitter Debian package was installed" if [[ $(dpkg-query -W -f='${STATUS}' beast-splitter 2>/dev/null | grep -c "ok installed") -eq 0 ]]; then @@ -140,7 +144,6 @@ fi log_message "Copying the beast-splitter Debian package into the Debian package archive directory" echo "" cp -vf $RECEIVER_BUILD_DIRECTORY/beast-splitter/*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ 2>&1 | tee -a $RECEIVER_LOG_FILE -echo "" ## CONFIGURATION diff --git a/bash/extras/duckdns.sh b/bash/extras/duckdns.sh index bfc1d395..9b569464 100755 --- a/bash/extras/duckdns.sh +++ b/bash/extras/duckdns.sh @@ -37,13 +37,13 @@ check_package curl log_heading "Gather information required to configure Duck DNS support" log_message "Asking the user for the sub domain to be assigned to this device" -domain_title="Duck DNS Sub Domain" -while [[ -z $domain ]] ; do - domain=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ - --title $domain_title \ +duckdns_domain_title="Duck DNS Sub Domain" +while [[ -z $duckdns_domain ]]; do + duckdns_domain=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ + --title "${duckdns_domain_title}" \ --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) - if [[ $domain == 0 ]]; then + 9 78 3>&1 1>&2 2>&3) + if [[ $duckdns_domain == 0 ]]; then log_alert_heading "INSTALLATION HALTED" log_alert_message "Setup has been halted due to lack of required information" echo "" @@ -51,17 +51,17 @@ while [[ -z $domain ]] ; do log_title_heading "Duck DNS decoder setup halted" exit 1 fi - domain_title="Duck DNS Sub Domain (REQUIRED)" + duckdns_domain_title="Duck DNS Sub Domain (REQUIRED)" done log_message "Asking the user for the Duck DNS token" -token_title="Duck DNS Token" -while [[ -z "${DUCKDNS_TOKEN}" ]] ; do - token=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ - --title $token_title \ +duckdns_token_title="Duck DNS Token" +while [[ -z $duckdns_token ]]; do + duckdns_token=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ + --title "${duckdns_token_title}" \ --inputbox "\nPlease enter your Duck DNS token." \ - 8 78) - if [[ $domain == 0 ]]; then + 8 78 3>&1 1>&2 2>&3) + if [[ $duckdns_domain == 0 ]]; then log_alert_heading "INSTALLATION HALTED" log_alert_message "Setup has been halted due to lack of required information" echo "" @@ -69,7 +69,7 @@ while [[ -z "${DUCKDNS_TOKEN}" ]] ; do log_title_heading "Duck DNS setup halted" exit 1 fi - token_title="Duck DNS Token (REQUIRED)" + duckdns_token_title="Duck DNS Token (REQUIRED)" done @@ -86,7 +86,7 @@ fi log_message "Creating the Duck DNS update script" tee $RECEIVER_BUILD_DIRECTORY/duckdns/duck.sh > /dev/null < /dev/null </dev/null 2>&1 EOF -echo "" log_message "Executing the Duck DNS update script" echo "" diff --git a/bash/feeders/airplaneslive.sh b/bash/feeders/airplaneslive.sh index 3ba04449..f1450628 100755 --- a/bash/feeders/airplaneslive.sh +++ b/bash/feeders/airplaneslive.sh @@ -24,6 +24,13 @@ if ! whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ fi +## CHECK FOR PREREQUISITE PACKAGES + +log_heading "Installing packages needed to fulfill FlightAware Dump1090 decoder dependencies" + +check_package net-tools + + ## DOWNLOAD AND EXECUTE THE AIRPLANES.LIVE CLIENT INSTALL SCRIPT log_heading "Begining the airplanes.live client installation process" @@ -46,7 +53,6 @@ cd $RECEIVER_BUILD_DIRECTORY/airplaneslive log_message "Downloading the airplanes.live client installation script" echo "" wget -v -O $RECEIVER_BUILD_DIRECTORY/airplaneslive/install.sh https://raw.githubusercontent.com/airplanes-live/feed/main/install.sh 2>&1 | tee -a $RECEIVER_LOG_FILE -echo "" log_message "Executing the airplanes.live client installation script" echo "" @@ -59,13 +65,14 @@ echo "" log_heading "Checking if the reciver is now feeding airplanes.live" log_message "Checking for connections on ports 30004 and 31090 to IP address 78.46.234.18" -netstat_output = `netstat -t -n | grep -E '30004|31090'` -if [[ $netstat_output == *"78.46.234.18:30004 ESTABLISHED"* && $netstat_output == *"78.46.234.18:31090 ESTABLISHED"* ]] +netstat_output=`netstat -t -n | grep -E '30004|31090'` +if [[ $netstat_output == *"78.46.234.18:30004 ESTABLISHED"* && $netstat_output == *"78.46.234.18:31090 ESTABLISHED"* ]]; then log_message "This device appears to be connected to airplanes.live" else - log_alert_message "The receiver does not appear to be feeding airplanes.live at this time...\e[97m" - log_alert_message "Please reboot your device and run the command 'netstat -t -n | grep -E '30004|31090' to see if a connection has been astablished." - log_alert_message "If the issue presists supply the last 20 lines given by the following command on the airplanes.live discord." + echo "" + log_alert_message "The receiver does not appear to be feeding airplanes.live at this time" + log_alert_message "Please reboot your device and run the command 'netstat -t -n | grep -E '30004|31090' to see if a connection has been astablished" + log_alert_message "If the issue presists supply the last 20 lines given by the following command on the airplanes.live discord" log_alert_message " 'sudo journalctl -u airplanes-feed --no-pager'" log_alert_message " 'sudo journalctl -u airplanes-mlat --no-pager'" fi diff --git a/bash/feeders/flyitalyadsb.sh b/bash/feeders/flyitalyadsb.sh index 1789db11..b1ae0946 100755 --- a/bash/feeders/flyitalyadsb.sh +++ b/bash/feeders/flyitalyadsb.sh @@ -31,9 +31,8 @@ log_heading "Begining the Fly Italy ADS-B client installation process" log_message "Informing the user of how the installation process will work" whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ --title "Fly Italy ADS-B Client Setup" \ - --msgbox "Scripts supplied by airplanes.live 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." \ + --msgbox "Scripts supplied by Fly Italy ADS-B 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 - if [[ ! -d $RECEIVER_BUILD_DIRECTORY/flyitalyadsb ]]; then log_message "Creating the Fly Italy ADS-B build directory" echo "" diff --git a/bash/feeders/planefinder.sh b/bash/feeders/planefinder.sh index 0f7b4092..ddcda2a1 100755 --- a/bash/feeders/planefinder.sh +++ b/bash/feeders/planefinder.sh @@ -46,17 +46,14 @@ log_heading "Begining the PlaneFinder client installation process" log_message "Determining which Debian package to install" case "${RECIEVER_CPU_ARCHITECTURE}" in - "armv7l"|"armv6l") - package_name="pfclient_${PLANEFINDER_CLIENT_VERSION_ARMHF}_armhf.deb" - ;; - "aarch64") - package_name="pfclient_${PLANEFINDER_CLIENT_VERSION_ARM64}_armhf.deb" + "armv7l"|"armv6l"|"aarch64") + package_name="pfclient_${pfclient_current_version_armhf}_armhf.deb" ;; "x86_64") - package_name="pfclient_${PLANEFINDER_CLIENT_VERSION_AMD64}_amd64.deb" + package_name="pfclient_${pfclient_current_version_amd64}_amd64.deb" ;; "i386") - package_name="pfclient_${PLANEFINDER_CLIENT_VERSION_I386}_i386.deb" + package_name="pfclient_${pfclient_current_version_amd64}_i386.deb" ;; *) echo "" diff --git a/bash/init.sh b/bash/init.sh index 41ebc84d..93289bfd 100755 --- a/bash/init.sh +++ b/bash/init.sh @@ -91,9 +91,9 @@ if whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ log_project_title log_title_heading "Downloading and installing the latest updates for your operating system" log_title_message "------------------------------------------------------------------------------" - + log_heading "Updating the operating system" - + log_message "Updating the operating system using apt-get" echo "" sudo apt-get -y dist-upgrade 2>&1 | tee -a $RECEIVER_LOG_FILE @@ -107,10 +107,9 @@ fi ## EXECUTE BASH/MAIN.SH -log_heading "Executing the script bash/main.sh" +clear -log_message "Adding execute permissions to bash/main" -chmod +x $RECEIVER_BASH_DIRECTORY/main.sh +log_heading "Executing the script bash/main.sh" log_message "Executing bash/main" bash $RECEIVER_BASH_DIRECTORY/main.sh diff --git a/bash/main.sh b/bash/main.sh index 3a9b8ded..60e2d6c7 100755 --- a/bash/main.sh +++ b/bash/main.sh @@ -12,7 +12,7 @@ source ${RECEIVER_BASH_DIRECTORY}/functions.sh install_1090mhz_decoder="false" if [[ $(dpkg-query -W -f='${STATUS}' dump1090-fa 2>/dev/null | grep -c "ok installed") == 1 ]] ; then chosen_1090mhz_decoder="dump1090-fa" - if [[ $(sudo dpkg -s dump1090-fa 2>/dev/null | grep -c "Version: ${dump1090-fa_current_version}") == 0 ]] ; then + if [[ $(sudo dpkg -s dump1090-fa 2>/dev/null | grep -c "Version: ${dump1090_fa_current_version}") == 0 ]] ; then whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ --title "FlightAware Dump1090 Upgrade Available" \ --defaultno \ @@ -47,7 +47,7 @@ function install_dump1090-fa() { install_978mhz_decoder="false" if [[ $(dpkg-query -W -f='${STATUS}' dump978-fa 2>/dev/null | grep -c "ok installed") == 1 ]]; then chosen_978mhz_decoder="dump978-fa" - if [[ $(sudo dpkg -s dump978-fa 2>/dev/null | grep -c "Version: ${dump978-fa_current_version}") == 0 ]]; then + if [[ $(sudo dpkg -s dump978-fa 2>/dev/null | grep -c "Version: ${dump978_fa_current_version}") == 0 ]]; then whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ --title "FlightAware dump978 Upgrade Available" \ --defaultno --yesno "An updated version of FlightAware dump978 is available.\n\nWould you like to install the new version?" \ @@ -74,6 +74,7 @@ function install_dump978-fa() { fi } + ## AGGREGATE SITE CLIENTS declare array feeder_list @@ -82,7 +83,7 @@ touch ${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES # ADS-B Exchange if [[ -f /lib/systemd/system/adsbexchange-mlat.service && -f /lib/systemd/system/adsbexchange-feed.service ]]; then echo "ADS-B Exchange Feed Client (reinstall)" >> ${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES - feeder_list=("${feeder_list[@]}" 'ADS-B Exchange Feed Client (reinstall)' '' OFF) + feeder_list=("${feeder_list[@]}" 'ADS-B Exchange Feed Client (reinstall/update)' '' OFF) else echo "ADS-B Exchange Feed Client" >> ${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES feeder_list=("${feeder_list[@]}" 'ADS-B Exchange Feed Client' '' OFF) @@ -149,7 +150,7 @@ function install_flightradar24_client() { # Fly Italy ADS-B if [[ -f /lib/systemd/system/flyitalyadsb-mlat.service && -f /lib/systemd/system/flyitalyadsb-feed.service ]]; then echo "Fly Italy ADS-B Feeder (upgrade)" >> ${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES - feeder_list=("${feeder_list[@]}" 'Fly Italy ADS-B Feeder (upgrade)' '' OFF) + feeder_list=("${feeder_list[@]}" 'Fly Italy ADS-B Feeder (reinstall)' '' OFF) else echo "Fly Italy ADS-B Feeder" >> ${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES feeder_list=("${feeder_list[@]}" 'Fly Italy ADS-B Feeder' '' OFF) @@ -166,9 +167,7 @@ function install_flyitalyadsb_client() { if [[ $(dpkg-query -W -f='${STATUS}' opensky-feeder 2>/dev/null | grep -c "ok installed") == 0 ]]; then feeder_list=("${feeder_list[@]}" 'OpenSky Network Feeder' '' OFF) else - if [[ $(sudo dpkg -s opensky-feeder 2>/dev/null | grep -c "Version: ${opensky-feeder_current_version}") == 0 ]]; then - feeder_list=("${feeder_list[@]}" 'OpenSky Network Feeder (upgrade)' '' OFF) - else + if [[ $(sudo dpkg -s opensky-feeder 2>/dev/null | grep -c "Version: ${opensky_feeder_current_version}") == 0 ]]; then feeder_list=("${feeder_list[@]}" 'OpenSky Network Feeder (reinstall)' '' OFF) fi fi @@ -245,6 +244,7 @@ whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ 14 78 if [[ $? == 0 ]]; then install_portal="true" +fi function install_adsb-portal() { ${RECEIVER_BASH_DIRECTORY}/portal/install.sh @@ -266,7 +266,7 @@ else extras_list=("${extras_list[@]}" 'beast-splitter (reinstall)' '' OFF) fi -function install_beast-splitter() { +function install_beastsplitter() { chmod +x ${RECEIVER_BASH_DIRECTORY}/extras/beeastsplitter.sh ${RECEIVER_BASH_DIRECTORY}/extras/beastsplitter.sh if [[ $? != 0 ]] ; then @@ -283,7 +283,7 @@ else extras_list=("${extras_list[@]}" 'Duck DNS Free Dynamic DNS Hosting (reinstall)' '' OFF) fi -function install_duck-dns() { +function install_duckdns() { chmod +x ${RECEIVER_BASH_DIRECTORY}/extras/duckdns.sh ${RECEIVER_BASH_DIRECTORY}/extras/duckdns.sh if [[ $? -ne 0 ]] ; then @@ -387,54 +387,102 @@ if [[ "${install_978mhz_decoder}" == "true" ]]; then esac fi +run_adsbexchange_script="false" +run_airplaneslive_script="false" +run_flightaware_script="false" +run_flightradar24_script="false" +run_flyitalyadsb_script="false" +run_openskynetwork_script="false" +run_planefinder_script="false" + # Aggragate site clients if [[ -s "${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES" ]]; then while read feeder_choice do case ${feeder_choice} in - "ADS-B Exchange Feeder"|"ADS-B Exchange Feeder (reinstall)") - install_adsbexchange_client + "ADS-B Exchange Feed Client"|"ADS-B Exchange Feed Client (reinstall/update)") + run_adsbexchange_script="true" ;; "Airplanes.live Feeder"|"Airplanes.live Feeder (reinstall)") - install_airplaneslive_client + run_airplaneslive_script="true" ;; "FlightAware PiAware"|"FlightAware PiAware (upgrade)"|"FlightAware PiAware (reinstall)") - install_flightaware_client + run_flightaware_script="true" ;; "Flightradar24 Client"|"Flightradar24 Client (upgrade)"|"Flightradar24 Client (reinstall)") - install_flightradar24_client + run_flightradar24_script="true" ;; - "Fly Italy ADS-B Feeder"|"Fly Italy ADS-B Feeder (upgrade)") - install_flyitalyadsb_client + "Fly Italy ADS-B Feeder"|"Fly Italy ADS-B Feeder (reinstall)") + run_flyitalyadsb_script="true" ;; - "OpenSky Network Feeder") - install_openskynetwork_client + "OpenSky Network Feeder"|"OpenSky Network Feeder (reinstall)") + run_openskynetwork_script="true" ;; "Plane Finder Client"|"Plane Finder Client (upgrade)"|"Plane Finder Client (reinstall)") - install_planefinder_client + run_planefinder_script="true" ;; esac done < ${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES fi +if [[ "${run_adsbexchange_script}" == "true" ]]; then + install_adsbexchange_client +fi + +if [[ "${run_airplaneslive_script}" == "true" ]]; then + install_airplaneslive_client +fi + +if [[ "${run_flightaware_script}" == "true" ]]; then + install_flightaware_client +fi + +if [[ "${run_flightradar24_script}" == "true" ]]; then + install_flightradar24_client +fi + +if [[ "${run_flyitalyadsb_script}" == "true" ]]; then + install_flyitalyadsb_client +fi + +if [[ "${run_openskynetwork_script}" == "true" ]]; then + install_openskynetwork_client +fi + +if [[ "${run_planefinder_script}" == "true" ]]; then + install_planefinder_client +fi + # Portals if [[ "${install_portal}" == "true" ]]; then install_adsb-portal fi # Extras + +run_beastsplitter_script="false" +run_duckdns_script="false" + if [[ -s "${RECEIVER_ROOT_DIRECTORY}/EXTRAS_CHOICES" ]]; then while read extras_choice do case ${extras_choice} in "beast-splitter"|"beast-splitter (reinstall)") - install_beast-splitter + run_beastsplitter_script="true" ;; "Duck DNS Free Dynamic DNS Hosting"|"Duck DNS Free Dynamic DNS Hosting (reinstall)") - install_duck-dns + run_duckdns_script="true" ;; esac done < ${RECEIVER_ROOT_DIRECTORY}/EXTRAS_CHOICES fi +if [[ "${run_adsbexchange_script}" == "true" ]]; then + install_beastsplitter +fi + +if [[ "${run_duckdns_script}" == "true" ]]; then + install_duckdns +fi + exit 0 diff --git a/bash/variables.sh b/bash/variables.sh index f79190ef..c0bb0ba4 100644 --- a/bash/variables.sh +++ b/bash/variables.sh @@ -18,8 +18,8 @@ display_true_inline="\033[2;32m" ## SOFTWARE VERSIONS # FlightAware -dump1090-fa_current_version="9.0" -dump978-fa_current_version="9.0" +dump1090_fa_current_version="9.0" +dump978_fa_current_version="9.0" piaware_current_version="9.0.1" # PlaneFinder Client @@ -29,7 +29,7 @@ pfclient_current_version_amd64="5.0.162" pfclient_current_version_i386="5.0.161" # Flightradar24 Client -fr24feed_current_version="1.0.18-5" +fr24feed_current_version="1.0.48-0" # OpenSky Network Client -opensky-feeder_current_version="2.1.7-1" +opensky_feeder_current_version="2.1.7-1" From 77bfdc5f621e6015c8dabcb66b4eedb6caf3fa1a Mon Sep 17 00:00:00 2001 From: jprochazka Date: Tue, 23 Jul 2024 21:48:53 -0400 Subject: [PATCH 26/26] Marked as v2.8.5. --- CHANGELOG.md | 4 +- README.md | 6 +- build/portal/html/classes/template.class.php | 2 +- build/portal/html/install/index.php | 2 +- build/portal/html/install/upgrade-v2.8.5.php | 68 ++++++++++++++++++++ build/portal/html/install/upgrade.php | 11 +++- 6 files changed, 86 insertions(+), 7 deletions(-) create mode 100644 build/portal/html/install/upgrade-v2.8.5.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a60d662..1e6ed35e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,9 @@ The following is a history of the changes made to this project. -## v2.8.5 *(in development)* +## v2.8.5 *(July 23rd, 2024)* -* The PiAware installation script now supports Ubuntu Noble Numbat. +* The PiAware installation script now supports Ubuntu Noble Numbat. *(unofficial fix)* * The installation of PiAware is no longer required when choosing to install dump1090-fa. * The dump1090-fa installation script now mimics the current dump1090-fa installation instructions. * All scripts excluding those related to the portal now utilize the new logging functions. diff --git a/README.md b/README.md index 22510b5e..355b876a 100644 --- a/README.md +++ b/README.md @@ -71,9 +71,11 @@ When setting up the portal you will have to choose between a lite or advanced in The project currently supports the following Linux distributions. * Armbian _(Bookworm, Jammy and Noble)_ -* Debian _(Bookworm and Bullseye)_ +* Debian _(Bookworm, Bullseye and Trixie)_ * DietPi _(Bookworm aand Bullseye)_ * Rasbperry PI OS _(Bookworm and Bullseye)_ * Ubuntu _(Jammy Jellyfish, Focal Fossa and Noble Numbat)_ -_Support is available via this repository through the use of the issue tracker or discussions._ \ No newline at end of file +_Support is available via this repository through the use of the issue tracker or discussions._ + +_At this time support for PiAware on distributions based on Debian Trixie and Ubuntu Noble Numbat employ an unofficial fix._ diff --git a/build/portal/html/classes/template.class.php b/build/portal/html/classes/template.class.php index 2f874490..9fb9c451 100644 --- a/build/portal/html/classes/template.class.php +++ b/build/portal/html/classes/template.class.php @@ -9,7 +9,7 @@ function display(&$pageData) { // Check if the portal is installed or needs upgraded. - $thisVersion = "2.8.4"; + $thisVersion = "2.8.5"; if (!file_exists($_SERVER['DOCUMENT_ROOT']."/classes/settings.class.php")) { header ("Location: /install/install.php"); diff --git a/build/portal/html/install/index.php b/build/portal/html/install/index.php index fdcb0bd8..6880ecf6 100644 --- a/build/portal/html/install/index.php +++ b/build/portal/html/install/index.php @@ -29,7 +29,7 @@ ///////////////////////////////////////////////////////////////////////////////////// // The most current stable release. - $thisVersion = "2.8.4"; + $thisVersion = "2.8.5"; // Begin the upgrade process if this release is newer than what is installed. if (file_exists($_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR."classes".DIRECTORY_SEPARATOR."settings.class.php")) { diff --git a/build/portal/html/install/upgrade-v2.8.5.php b/build/portal/html/install/upgrade-v2.8.5.php new file mode 100644 index 00000000..a06b0181 --- /dev/null +++ b/build/portal/html/install/upgrade-v2.8.5.php @@ -0,0 +1,68 @@ +updateSetting("version", "2.8.5"); + $common->updateSetting("patch", ""); + + // The upgrade process completed successfully. + $results['success'] = TRUE; + $results['message'] = "Upgrade to v2.8.5 successful."; + return $results; + + } catch(Exception $e) { + // Something went wrong during this upgrade process. + $results['success'] = FALSE; + $results['message'] = $e->getMessage(); + return $results; + } + } +?> + diff --git a/build/portal/html/install/upgrade.php b/build/portal/html/install/upgrade.php index 296782ff..837c5ff6 100644 --- a/build/portal/html/install/upgrade.php +++ b/build/portal/html/install/upgrade.php @@ -33,7 +33,7 @@ $common = new common(); // The most current stable release. - $thisVersion = "2.8.4"; + $thisVersion = "2.8.5"; // Begin the upgrade process if this release is newer than what is installed. if ($common->getSetting("version") == $thisVersion) { @@ -222,6 +222,15 @@ $version = "2.8.4"; } + // UPGRADE TO V2.8.5 + if ($common->getSetting("version") == "2.8.4" && $success) { + $json = file_get_contents("http://localhost/install/upgrade-v2.8.5.php"); + $results = json_decode($json, TRUE); + $success = $results['success']; + $message = $results['message']; + $version = "2.8.5"; + } + require_once($_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR."admin".DIRECTORY_SEPARATOR."includes".DIRECTORY_SEPARATOR."header.inc.php"); // Display the instalation wizard.