From dc56aba0ce9d93c57014c4275a60033603024642 Mon Sep 17 00:00:00 2001 From: jprochazka Date: Wed, 21 Aug 2024 16:50:03 -0400 Subject: [PATCH] Began adding UPPrepeater support. --- README.md | 2 +- bash/extras/beastsplitter.sh | 6 ++-- bash/extras/udprepeater.sh | 58 ++++++++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 4 deletions(-) create mode 100644 bash/extras/udprepeater.sh diff --git a/README.md b/README.md index 80db012..e024782 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ Included is the option to install the ADS-B Portal which offers the following fe When setting up the portal you will have to choose between a lite or advanced installation. Advanced features add flight logging and plotting and should only be chosen on devices running a sturdy data storage solution. -*It is highly recommended that anyone using a SD card as they storage medium not attempt to use the advanced features.* +*It is highly recommended that anyone using a SD card as thier storage medium not attempt to use the advanced features.* ### Decoders diff --git a/bash/extras/beastsplitter.sh b/bash/extras/beastsplitter.sh index 38d15ab..b3deba6 100755 --- a/bash/extras/beastsplitter.sh +++ b/bash/extras/beastsplitter.sh @@ -80,9 +80,9 @@ check_package libboost-program-options-dev check_package libboost-regex-dev -## CLONE OR PULL THE FLIGHTAWARE DUMP978 DECODER SOURCE +## CLONE OR PULL THE BEAST-SPLITTER DECODER SOURCE -log_heading "Preparing the FlightAware Dump978 Git repository" +log_heading "Preparing the beast-splitter Git repository" if [[ -d $RECEIVER_BUILD_DIRECTORY/beast-splitter/beast-splitter && -d $RECEIVER_BUILD_DIRECTORY/beast-splitter/beast-splitter/.git ]]; then log_message "Entering the beast-splitter git repository directory" @@ -97,7 +97,7 @@ else echo "" log_message "Entering the beast-splitter build directory" cd $RECEIVER_BUILD_DIRECTORY/beast-splitter - log_message "Cloning the FlightAware dump978 git repository" + log_message "Cloning the beast-splitter git repository" echo "" git clone https://github.com/flightaware/beast-splitter.git 2>&1 | tee -a $RECEIVER_LOG_FILE fi diff --git a/bash/extras/udprepeater.sh b/bash/extras/udprepeater.sh new file mode 100644 index 0000000..a3f3825 --- /dev/null +++ b/bash/extras/udprepeater.sh @@ -0,0 +1,58 @@ +#!/bin/bash + +# TODO: UDPrepeater should now reside within the bin directory within the repository. +# https://github.com/json-parser/json-parser +# https://troydhanson.github.io/uthash/ (uthash-dev package available) + +## PRE INSTALLATION OPERATIONS + +source $RECEIVER_BASH_DIRECTORY/variables.sh +source $RECEIVER_BASH_DIRECTORY/functions.sh + +clear +log_project_title +log_title_heading "Setting up UDPrepeater" +log_title_message "------------------------------------------------------------------------------" +if ! whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \ + --title "UDPrepeater Setup" \ + --yesno "UDPrepeater is a general purpose, configurable UDP forwarding/repeating daemon for Linux. It is useful for repeating one-way streams of data from a single sender to multiple receivers, and for forwarding UDP traffic to different receivers based upon source or destination IP addresses or UDP ports.\n\n https://github.com/UnionPacific/udp-repeater\n\nContinue UDPrepeater 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 "" + echo -e "\e[93m ------------------------------------------------------------------------------\e[96m" + echo -e "\e[92m UDPrepeater setup halted.\e[39m" + echo -e "" + read -p "Press enter to continue..." discard + exit 1 +fi + + +## CLONE OR PULL THE UDPREPEATER DECODER SOURCE + +log_heading "Preparing the UDPrepeater Git repository" + +if [[ -d $RECEIVER_BUILD_DIRECTORY/udp-repeater && -d $RECEIVER_BUILD_DIRECTORY/udp-repeater/.git ]]; then + log_message "Entering the UDPrepeater git repository directory" + cd $RECEIVER_BUILD_DIRECTORY/udp-repeater + log_message "Updating the local UDPrepeater git repository" + echo "" + git pull +else + log_message "Entering the build directory" + cd $RECEIVER_BUILD_DIRECTORY + log_message "Cloning the UDPrepeater git repository locally" + echo "" + git clone https://github.com/UnionPacific/udp-repeater +fi + + +## BUILD THE UDPREPEATER BINARY + +log_heading "Building the UDPrepeater binary" + +log_message "Entering the UDPrepeater src repository" +cd $RECEIVER_BUILD_DIRECTORY/udp-repeater/src +log_message "Running the make command" +make