Harmonize feeder scripts

pull/289/head
romeo-golf 2017-02-26 13:07:49 +00:00
rodzic 7c3fc13f1b
commit 38829bcc73
5 zmienionych plików z 282 dodań i 175 usunięć

Wyświetl plik

@ -67,7 +67,7 @@ FEEDER_MLAT_SRC_HOST_DEFAULT="127.0.0.1"
FEEDER_MLAT_SRC_PORT_DEFAULT="30005"
FEEDER_MLAT_DST_PORT_DEFAULT="31090"
## INCLUDE EXTERNAL SCRIPTS
### INCLUDE EXTERNAL SCRIPTS
source ${RECEIVER_BASH_DIRECTORY}/variables.sh
source ${RECEIVER_BASH_DIRECTORY}/functions.sh
@ -88,6 +88,7 @@ echo -e "\e[92m Setting up the ADS-B Exchange feed..."
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------\e[96m"
echo -e ""
# Interactive install.
if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
CONTINUE_SETUP=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "ADS-B Exchange Feed Setup" --yesno "ADS-B Exchange is a co-op of ADS-B/Mode S/MLAT feeders from around the world, and the worlds largest source of unfiltered flight data.\n\n http://www.adsbexchange.com/how-to-feed/\n\nContinue setting up the ADS-B Exchange feed?" 12 78 3>&1 1>&2 2>&3)
@ -305,28 +306,11 @@ if [[ "${FEEDER_MLAT_ENABLED}" = "true" ]] ; then
sudo dpkg -i ${RECEIVER_BUILD_DIRECTORY}/mlat-client_${MLAT_CLIENT_VERSION}*.deb 2>&1
echo -e ""
# Create binary package archive directory.
if [[ ! -d "${RECEIVER_BUILD_DIRECTORY}/package-archive" ]] ; then
echo -e "\e[94m Creating package archive directory...\e[97m"
echo -e ""
mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/package-archive 2>&1
echo -e ""
fi
# Archive binary package and changelog.
echo -e "\e[94m Archiving the mlat-client package...\e[97m"
echo -e ""
mv -vf ${RECEIVER_BUILD_DIRECTORY}/mlat-client_*.deb ${RECEIVER_BUILD_DIRECTORY}/package-archive 2>&1
echo -e ""
echo -e "\e[94m Archiving the mlat-client changelog...\e[97m"
echo -e ""
mv -vf ${RECEIVER_BUILD_DIRECTORY}/mlat-client_*.changes ${RECEIVER_BUILD_DIRECTORY}/package-archive 2>&1
echo -e ""
# Check that the mlat-client package was installed successfully.
# Check that the component package was installed successfully.
echo -e ""
echo -e "\e[94m Checking that the mlat-client package was installed properly...\e[97m"
echo -e ""
if [[ $(dpkg-query -W -f='${STATUS}' mlat-client 2>/dev/null | grep -c "ok installed") -eq 0 ]] ; then
# If the mlat-client package could not be installed halt setup.
echo -e ""
@ -343,6 +327,26 @@ if [[ "${FEEDER_MLAT_ENABLED}" = "true" ]] ; then
read -p "Press enter to continue..." CONTINUE
fi
exit 1
else
# Create binary package archive directory.
if [[ ! -d "${RECEIVER_BUILD_DIRECTORY}/package-archive" ]] ; then
echo -e "\e[94m Creating package archive directory...\e[97m"
echo -e ""
mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/package-archive 2>&1
echo -e ""
fi
# Archive binary package.
echo -e "\e[94m Archiving the mlat-client package...\e[97m"
echo -e ""
mv -vf ${RECEIVER_BUILD_DIRECTORY}/mlat-client_*.deb ${RECEIVER_BUILD_DIRECTORY}/package-archive 2>&1
echo -e ""
# Archive changelog.
echo -e "\e[94m Archiving the mlat-client changelog...\e[97m"
echo -e ""
mv -vf ${RECEIVER_BUILD_DIRECTORY}/mlat-client_*.changes ${RECEIVER_BUILD_DIRECTORY}/package-archive 2>&1
echo -e ""
fi
fi

Wyświetl plik

@ -9,7 +9,7 @@
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# Copyright (c) 2015-2017 Joseph A. Prochazka #
# 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 #
@ -31,40 +31,49 @@
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
## VARIABLES
### VARIABLES
RECEIVER_ROOT_DIRECTORY="${PWD}"
RECEIVER_BASH_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/bash"
RECEIVER_BUILD_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/build"
COMPONENT_BUILD_DIRECTORY="${RECEIVER_BUILD_DIRECTORY}/flightradar24"
## INCLUDE EXTERNAL SCRIPTS
### INCLUDE EXTERNAL SCRIPTS
source ${RECEIVER_BASH_DIRECTORY}/variables.sh
source ${RECEIVER_BASH_DIRECTORY}/functions.sh
## BEGIN SETUP
# Source the automated install configuration file if this is an automated installation.
if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] ; then
source ${RECEIVER_CONFIGURATION_FILE}
fi
clear
echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
### BEGIN SETUP
if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
clear
echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
fi
echo -e ""
echo -e "\e[92m Setting up the Flightradar24 feeder client..."
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------\e[96m"
echo -e ""
whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Flightradar24 Feeder Client Setup" --yesno "The Flightradar24's feeder client can track flights within 200-400 miles and will automatically share data with Flightradar24. You can track flights directly off your device or via Flightradar24.com.\n\n http://www.flightradar24.com/share-your-data\n\nContinue setup by installing the Flightradar24 feeder client?" 13 78
CONTINUESETUP=$?
if [[ "${CONTINUESETUP}" = 1 ]] ; then
# Setup has been halted by the user.
echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
echo -e " Setup has been halted at the request of the user."
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m Flightradar24 feeder client setup halted.\e[39m"
echo -e ""
if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
# Interactive install.
if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
CONTINUE_SETUP=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Flightradar24 Feeder Client Setup" --yesno "The Flightradar24's feeder client can track flights within 200-400 miles and will automatically share data with Flightradar24, you can track flights directly off your device or via Flightradar24.com.\n\n http://www.flightradar24.com/share-your-data\n\nContinue setup by installing the Flightradar24 feeder client?" 13 78 3>&1 1>&2 2>&3)
if [[ ${CONTINUE_SETUP} -eq 1 ]] ; then
# Setup has been halted by the user.
echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
echo -e " Setup has been halted at the request of the user."
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m Flightradar24 feeder client setup halted.\e[39m"
echo -e ""
read -p "Press enter to continue..." CONTINUE
exit 1
fi
exit 1
fi
## CHECK FOR PREREQUISITE PACKAGES
@ -74,7 +83,7 @@ echo -e ""
if [[ "${CPU_ARCHITECTURE}" = "x86_64" ]] ; then
if [[ $(dpkg --print-foreign-architectures $1 2>/dev/null | grep -c "i386") -eq 0 ]] ; then
echo -e "\e[94m Adding the i386 architecture...\e[97m"
sudo dpkg --add-architecture i386
sudo dpkg --add-architecture i386 2>&1
echo -e "\e[94m Downloading latest package lists for enabled repositories and PPAs...\e[97m"
echo -e ""
sudo apt-get update
@ -94,56 +103,73 @@ else
fi
CheckPackage wget
## BEGIN INSTALLATION DEPENDING ON DEVICE ARCHITECTURE
### START INSTALLATION
echo -e ""
echo -e "\e[95m Begining the installation process...\e[97m"
echo -e ""
# Create the flightradar24 build directory if it does not exist.
# Create the component build directory if it does not exist.
if [[ ! -d "${COMPONENT_BUILD_DIRECTORY}" ]] ; then
echo -e "\e[94m Creating the Flightradar24 feeder client build directory...\e[97m"
mkdir -vp ${COMPONENT_BUILD_DIRECTORY}
fi
echo -e "\e[94m Entering the Flightradar24 feeder client build directory...\e[97m"
cd ${COMPONENT_BUILD_DIRECTORY} 2>&1
# Change to the comonent build directory.
if [[ ! "${PWD}" = "${COMPONENT_BUILD_DIRECTORY}" ]] ; then
echo -e "\e[94m Entering the Flightradar24 feeder client build directory...\e[97m"
cd ${COMPONENT_BUILD_DIRECTORY} 2>&1
fi
# Download the appropriate package depending on the devices architecture.
if [[ "${CPU_ARCHITECTURE}" = "armv7l" ]] || [[ "${CPU_ARCHITECTURE}" = "armv6l" ]] || [[ "${CPU_ARCHITECTURE}" = "aarch64" ]] ; then
## ARM INSTALLATION
# ARM achitecture detected.
whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Plane Finder ADS-B Client Setup Instructions" --msgbox "This script will now download and execute the official Flightradar24 setup script. Follow the instructions provided and supply the required information when ask for by the script.\n\nOnce finished the ADS-B Receiver Project scripts will continue." 11 78
echo -e "\e[94m Detected the device architecture as ARM...\e[97m"
echo -e "\e[94m Downloading the Flightradar24 feeder installation script...\e[97m"
echo -e "\e[94m Downloading the Flightradar24 feeder installation script for ARM...\e[97m"
echo -e ""
wget --no-check-certificate https://repo.feed.flightradar24.com/install_fr24_rpi.sh -O ${COMPONENT_BUILD_DIRECTORY}/install_fr24_rpi.sh
echo -e ""
echo -e "\e[94m Executing the Flightradar24 feeder installation script...\e[97m"
sudo bash ${COMPONENT_BUILD_DIRECTORY}/install_fr24_rpi.sh
echo -e ""
else
## I386 INSTALLATION
echo -e "\e[94m Detected the device architecture as I386...\e[97m"
echo -e "\e[94m Downloading the Flightradar24 feeder client package...\e[97m"
# Otherwise assume i386.
echo -e "\e[94m Downloading the Flightradar24 feeder client v${FLIGHTRADAR24_CLIENT_VERSION_I386} package for i386 devices...\e[97m"
echo -e ""
wget --no-check-certificate https://feed.flightradar24.com/linux/fr24feed_${FLIGHTRADAR24_CLIENT_VERSION_I386}_i386.deb -O ${COMPONENT_BUILD_DIRECTORY}/fr24feed_${FLIGHTRADAR24_CLIENT_VERSION_I386}_i386.deb
echo -e "\e[94m Installing the Flightradar24 feeder client package...\e[97m"
fi
## INSTALL THE COMPONENT PACKAGE
echo -e "\e[95m Installing the Flightradar24 feeder client package...\e[97m"
echo -e ""
# Install the proper package depending on the devices architecture.
if [[ "${CPU_ARCHITECTURE}" = "armv7l" ]] || [[ "${CPU_ARCHITECTURE}" = "armv6l" ]] || [[ "${CPU_ARCHITECTURE}" = "aarch64" ]] ; then
# ARM achitecture detected.
echo -e "\e[94m Executing the Flightradar24 feeder installation script...\e[97m"
echo -e ""
sudo bash ${COMPONENT_BUILD_DIRECTORY}/install_fr24_rpi.sh
else
# Otherwise assume i386.
echo -e "\e[94m Installing the Flightradar24 feeder client v${FLIGHTRADAR24_CLIENT_VERSION_I386} package for i386 devices...\e[97m"
if [[ `lsb_release -si` = "Debian" ]] ; then
# Force architecture if this is Debian.
echo -e "\e[94m NOTE: dpkg executed with added flag --force-architecture.\e[97m"
echo -e ""
sudo dpkg -i --force-architecture ${COMPONENT_BUILD_DIRECTORY}/fr24feed_${FLIGHTRADAR24_CLIENT_VERSION_I386}_i386.deb
sudo dpkg -i --force-architecture ${COMPONENT_BUILD_DIRECTORY}/fr24feed_${FLIGHTRADAR24_CLIENT_VERSION_I386}_i386.deb 2>&1
else
echo -e ""
sudo dpkg -i ${COMPONENT_BUILD_DIRECTORY}/fr24feed_${FLIGHTRADAR24_CLIENT_VERSION_I386}_i386.deb
sudo dpkg -i ${COMPONENT_BUILD_DIRECTORY}/fr24feed_${FLIGHTRADAR24_CLIENT_VERSION_I386}_i386.deb 2>&1
fi
fi
# Dummy test for consistency with other feeder install scripts.
if [[ -n "${CPU_ARCHITECTURE}" ]] ; then
# Check that the component package was installed successfully.
echo -e ""
echo -e "\e[94m Checking that the fr24feed package was installed properly...\e[97m"
echo -e ""
if [[ $(dpkg-query -W -f='${STATUS}' fr24feed 2>/dev/null | grep -c "ok installed") -eq 0 ]] ; then
# If the fr24feed package could not be installed halt setup.
# If the component package could not be installed halt setup.
echo -e ""
echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
echo -e " UNABLE TO INSTALL A REQUIRED PACKAGE."
@ -158,13 +184,27 @@ else
read -p "Press enter to continue..." CONTINUE
fi
exit 1
elif [[ ! "${CPU_ARCHITECTURE}" = "armv7l" ]] && [[ ! "${CPU_ARCHITECTURE}" = "armv6l" ]] && [[ ! "${CPU_ARCHITECTURE}" = "aarch64" ]] ; then
# Create binary package archive directory.
if [[ ! -d "${RECEIVER_BUILD_DIRECTORY}/package-archive" ]] ; then
echo -e "\e[94m Creating package archive directory...\e[97m"
echo -e ""
mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/package-archive 2>&1
echo -e ""
fi
# Archive binary package.
echo -e "\e[94m Archiving the fr24feed package...\e[97m"
echo -e ""
mv -vf ${COMPONENT_BUILD_DIRECTORY}/fr24feed_*.deb ${RECEIVER_BUILD_DIRECTORY}/package-archive 2>&1
echo -e ""
fi
fi
### SETUP COMPLETE
# Return to the project root directory.
echo -e "\e[94m Entering the ADS-B Receiver Project root directory...\e[97m"
echo -e "\e[94m Entering the ${RECEIVER_PROJECT_TITLE} root directory...\e[97m"
cd ${RECEIVER_ROOT_DIRECTORY} 2>&1
echo -e ""

Wyświetl plik

@ -43,6 +43,11 @@ COMPONENT_BUILD_DIRECTORY="${RECEIVER_BUILD_DIRECTORY}/piaware_builder"
source ${RECEIVER_BASH_DIRECTORY}/variables.sh
source ${RECEIVER_BASH_DIRECTORY}/functions.sh
# Source the automated install configuration file if this is an automated installation.
if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] ; then
source ${RECEIVER_CONFIGURATION_FILE}
fi
### BEGIN SETUP
if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
@ -51,22 +56,24 @@ if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
fi
echo -e ""
echo -e "\e[92m Setting up FlightAware's PiAware..."
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------\e[96m"
echo -e ""
whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "PiAware Setup" --yesno "PiAware is a package used to forward data read from an ADS-B receiver to FlightAware. It does this using a program, piaware, while aided by other support programs.\n\n https://github.com/flightaware/piaware\n\nContinue setup by installing FlightAware's PiAware?" 13 78
CONTINUESETUP=$?
if [[ "${CONTINUESETUP}" = 1 ]] ; then
# Setup has been halted by the user.
echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
echo -e " Setup has been halted at the request of the user."
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m Dump1090-mutability setup halted.\e[39m"
echo -e ""
if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
# Interactive install.
if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
CONTINUE_SETUP=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "PiAware Setup" --yesno "PiAware is a package used to forward data read from an ADS-B receiver to FlightAware. It does this using a program, piaware, while aided by other support programs.\n\n https://github.com/flightaware/piaware\n\nContinue setup by installing FlightAware's PiAware?" 13 78 3>&1 1>&2 2>&3)
if [[ ${CONTINUE_SETUP} -eq 1 ]] ; then
# Setup has been halted by the user.
echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
echo -e " Setup has been halted at the request of the user."
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m PiAware setup halted.\e[39m"
echo -e ""
read -p "Press enter to continue..." CONTINUE
exit 1
fi
exit 1
fi
## CHECK FOR PREREQUISITE PACKAGES
@ -88,11 +95,12 @@ CheckPackage tcllib
CheckPackage tcl-tls
CheckPackage itcl3
## DOWNLOAD OR UPDATE THE PIAWARE_BUILDER SOURCE
### START INSTALLATION
echo -e ""
echo -e "\e[95m Preparing the piaware_builder Git repository...\e[97m"
echo -e "\e[95m Begining the installation process...\e[97m"
echo -e ""
if [[ -d "${COMPONENT_BUILD_DIRECTORY}" ]] && [[ -d "${COMPONENT_BUILD_DIRECTORY}/.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"
@ -114,57 +122,84 @@ fi
echo -e ""
echo -e "\e[95m Building and installing the PiAware package...\e[97m"
echo -e ""
# Change to the comonent build directory.
if [[ ! "${PWD}" = "${COMPONENT_BUILD_DIRECTORY}" ]] ; then
echo -e "\e[94m Entering the piaware_builder git repository directory...\e[97m"
cd ${COMPONENT_BUILD_DIRECTORY} 2>&1
fi
echo -e "\e[94m Executing the PiAware build script...\e[97m"
echo -e ""
./sensible-build.sh jessie
echo -e ""
echo -e "\e[94m Entering the PiAware build directory...\e[97m"
cd ${COMPONENT_BUILD_DIRECTORY}/package-jessie 2>&1
echo -e "\e[94m Building the PiAware package...\e[97m"
echo -e ""
dpkg-buildpackage -b
echo -e ""
echo -e "\e[94m Installing the PiAware package...\e[97m"
echo -e ""
sudo dpkg -i ${COMPONENT_BUILD_DIRECTORY}/piaware_*.deb
# Check that the PiAware package was installed successfully.
echo -e ""
echo -e "\e[94m Checking that the piaware package was installed properly...\e[97m"
if [[ $(dpkg-query -W -f='${STATUS}' piaware 2>/dev/null | grep -c "ok installed") -eq 0 ]] ; then
# If the piaware package could not be installed halt setup.
# Dummy test for consistency with other feeder install scripts.
if [[ -n "${CPU_ARCHITECTURE}" ]] ; then
# Execute build script.
echo -e "\e[94m Executing the PiAware build script...\e[97m"
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!"
./sensible-build.sh jessie
echo -e ""
echo -e "\e[93mThe package \"piaware\" could not be installed.\e[39m"
# Change to build script directory.
echo -e "\e[94m Entering the PiAware build directory...\e[97m"
cd ${COMPONENT_BUILD_DIRECTORY}/package-jessie 2>&1
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m PiAware setup halted.\e[39m"
# Build binary package.
echo -e "\e[94m Building the PiAware package...\e[97m"
echo -e ""
if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
read -p "Press enter to continue..." CONTINUE
dpkg-buildpackage -b 2>&1
echo -e ""
# Install binary package.
echo -e "\e[94m Installing the PiAware package...\e[97m"
echo -e ""
sudo dpkg -i ${COMPONENT_BUILD_DIRECTORY}/piaware_*.deb 2>&1
echo -e ""
# Check that the component package was installed successfully.
echo -e ""
echo -e "\e[94m Checking that the piaware package was installed properly...\e[97m"
echo -e ""
if [[ $(dpkg-query -W -f='${STATUS}' piaware 2>/dev/null | grep -c "ok installed") -eq 0 ]] ; then
# If the component package could not be installed halt setup.
echo -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 \"piaware\" could not be installed.\e[39m"
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m PiAware setup halted.\e[39m"
echo -e ""
if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
read -p "Press enter to continue..." CONTINUE
fi
exit 1
else
# Move the .deb package into another directory simply to keep it for historical reasons.
# Create binary package archive directory.
if [[ ! -d "${RECEIVER_BUILD_DIRECTORY}/package-archive" ]] ; then
echo -e "\e[94m Creating package archive directory...\e[97m"
echo -e ""
mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/package-archive 2>&1
echo -e ""
fi
# Archive binary package.
echo -e "\e[94m Moving the PiAware package into the package archive directory...\e[97m"
echo -e ""
mv -vr ${COMPONENT_BUILD_DIRECTORY}/piaware_*.deb ${RECEIVER_BUILD_DIRECTORY}/package-archive 2>&1
echo -e ""
# Archive changelog.
echo -e "\e[94m Moving the PiAware package changes file into the package archive directory...\e[97m"
echo -e ""
mv -vr ${COMPONENT_BUILD_DIRECTORY}/piaware_*.changes ${RECEIVER_BUILD_DIRECTORY}/package-archive 2>&1
echo -e ""
fi
exit 1
fi
# Move the .deb package into another directory simply to keep it for historical reasons.
if [[ ! -d "${RECEIVER_BUILD_DIRECTORY}/package-archive" ]] ; then
echo -e "\e[94m Making the PiAware package archive directory...\e[97m"
mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/package-archive 2>&1
fi
# Archive binary package.
echo -e "\e[94m Moving the PiAware package into the package archive directory...\e[97m"
mv -vr ${COMPONENT_BUILD_DIRECTORY}/piaware_*.deb ${RECEIVER_BUILD_DIRECTORY}/package-archive 2>&1
echo -e "\e[94m Moving the PiAware package changes file into the package archive directory...\e[97m"
mv -vr ${COMPONENT_BUILD_DIRECTORY}/piaware_*.changes ${RECEIVER_BUILD_DIRECTORY}/package-archive 2>&1
## CONFIGURE FLIGHTAWARE CREDENTIALS
# Confirm if the user is able to claim their PiAware instance online.
@ -222,7 +257,7 @@ fi
### SETUP COMPLETE
# Return to the project root directory.
echo -e "\e[94m Entering the ADS-B Receiver Project root directory...\e[97m"
echo -e "\e[94m Entering the ${RECEIVER_PROJECT_TITLE} root directory...\e[97m"
cd ${RECEIVER_ROOT_DIRECTORY} 2>&1
echo -e ""

Wyświetl plik

@ -9,7 +9,7 @@
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# Copyright (c) 2015-2016 Joseph A. Prochazka #
# 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 #
@ -31,7 +31,7 @@
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
## VARIABLES
### VARIABLES
RECEIVER_ROOT_DIRECTORY="${PWD}"
RECEIVER_BASH_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/bash"
@ -39,33 +39,42 @@ RECEIVER_BUILD_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/build"
COMPONENT_BUILD_DIRECTORY="${RECEIVER_BUILD_DIRECTORY}/planefinder"
DEVICEIPADDRESS=`ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/'`
## INCLUDE EXTERNAL SCRIPTS
### INCLUDE EXTERNAL SCRIPTS
source ${RECEIVER_BASH_DIRECTORY}/variables.sh
source ${RECEIVER_BASH_DIRECTORY}/functions.sh
## BEGIN SETUP
# Source the automated install configuration file if this is an automated installation.
if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] ; then
source ${RECEIVER_CONFIGURATION_FILE}
fi
clear
echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
### BEGIN SETUP
if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
clear
echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
fi
echo -e ""
echo -e "\e[92m Setting up the Plane Finder ADS-B Client..."
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------\e[96m"
echo -e ""
whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Plane Finder ADS-B Client Setup" --yesno "The Plane Finder 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 the Plane Finder ADS-B Client?" 13 78
CONTINUESETUP=$?
if [[ "${CONTINUESETUP}" = 1 ]] ; then
# Setup has been halted by the user.
echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
echo -e " Setup has been halted at the request of the user."
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m Plane Finder ADS-B Client setup halted.\e[39m"
echo -e ""
if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
# Interactive install.
if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
CONTINUE_SETUP=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Plane Finder ADS-B Client Setup" --yesno "The Plane Finder 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 the Plane Finder ADS-B Client?" 13 78 3>&1 1>&2 2>&3)
if [[ ${CONTINUE_SETUP} -eq 1 ]] ; then
# Setup has been halted by the user.
echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
echo -e " Setup has been halted at the request of the user."
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m Plane Finder ADS-B Client setup halted.\e[39m"
echo -e ""
read -p "Press enter to continue..." CONTINUE
exit 1
fi
exit 1
fi
## CHECK FOR PREREQUISITE PACKAGES
@ -75,7 +84,7 @@ echo -e ""
if [[ "${CPU_ARCHITECTURE}" = "x86_64" ]] ; then
if [[ $(dpkg --print-foreign-architectures $1 2>/dev/null | grep -c "i386") -eq 0 ]] ; then
echo -e "\e[94m Adding the i386 architecture...\e[97m"
sudo dpkg --add-architecture i386
sudo dpkg --add-architecture i386 2>&1
echo -e "\e[94m Downloading latest package lists for enabled repositories and PPAs...\e[97m"
echo -e ""
sudo apt-get update
@ -87,83 +96,101 @@ else
fi
CheckPackage wget
## DOWNLOAD THE PLANEFINDER ADS-B CLIENT PACKAGE
### START INSTALLATION
echo -e ""
echo -e "\e[95m Downloading the Plane Finder ADS-B Client package...\e[97m"
echo -e "\e[95m Begining the installation process...\e[97m"
echo -e ""
# Create the planefinder build directory if it does not exist.
# Create the component build directory if it does not exist.
if [[ ! -d "${COMPONENT_BUILD_DIRECTORY}" ]] ; then
echo -e "\e[94m Creating the Plane Finder ADS-B Client build directory...\e[97m"
mkdir -vp ${COMPONENT_BUILD_DIRECTORY}
fi
# Change to the comonent build directory.
if [[ ! "${PWD}" = "${COMPONENT_BUILD_DIRECTORY}" ]] ; then
echo -e "\e[94m Entering the Plane Finder ADS-B Client build directory...\e[97m"
cd ${COMPONENT_BUILD_DIRECTORY} 2>&1
fi
# Download the appropriate package depending on the devices architecture.
if [[ "${CPU_ARCHITECTURE}" = "armv7l" ]] || [[ "${CPU_ARCHITECTURE}" = "armv6l" ]] ; then
# ARM achitecture detected.
echo -e "\e[94m Downloading the Plane Finder ADS-B Client v${PLANEFINDER_CLIENT_VERSION_ARM} for ARM devices...\e[97m"
echo -e ""
wget --no-check-certificate https://client.planefinder.net/pfclient_${PLANEFINDER_CLIENT_VERSION_ARM}_armhf.deb -O ${COMPONENT_BUILD_DIRECTORY}/pfclient_${PLANEFINDER_CLIENT_VERSION_ARM}_armhf.deb
else
echo -e "\e[94m Downloading the Plane Finder ADS-B Client v${PLANEFINDER_CLIENT_VERSION_I386} for I386 devices...\e[97m"
# Otherwise assume i386.
echo -e "\e[94m Downloading the Plane Finder ADS-B Client v${PLANEFINDER_CLIENT_VERSION_I386} for i386 devices...\e[97m"
echo -e ""
wget --no-check-certificate https://client.planefinder.net/pfclient_${PLANEFINDER_CLIENT_VERSION_I386}_i386.deb -O ${COMPONENT_BUILD_DIRECTORY}/pfclient_${PLANEFINDER_CLIENT_VERSION_I386}_i386.deb
fi
## INSTALL THE PLANEFINDER ADS-B CLIENT PACKAGE
## INSTALL THE COMPONENT PACKAGE
echo -e ""
echo -e "\e[95m Installing the Plane Finder ADS-B Client package...\e[97m"
echo -e ""
echo -e "\e[94m Entering the Plane Finder ADS-B Client build directory...\e[97m"
cd ${COMPONENT_BUILD_DIRECTORY} 2>&1
# Install the proper package depending on the devices architecture.
if [[ "${CPU_ARCHITECTURE}" = "armv7l" ]] || [[ "${CPU_ARCHITECTURE}" = "armv6l" ]] || [[ "${CPU_ARCHITECTURE}" = "aarch64" ]] ; then
echo -e "\e[94m Installing the Plane Finder ADS-B Client v${PLANEFINDER_CLIENT_VERSION_ARM} for ARM devices package...\e[97m"
# ARM achitecture detected.
echo -e "\e[94m Installing the Plane Finder ADS-B Client v${PLANEFINDER_CLIENT_VERSION_ARM} package for ARM devices...\e[97m"
echo -e ""
sudo dpkg -i ${COMPONENT_BUILD_DIRECTORY}/pfclient_${PLANEFINDER_CLIENT_VERSION_ARM}_armhf.deb
sudo dpkg -i ${COMPONENT_BUILD_DIRECTORY}/pfclient_${PLANEFINDER_CLIENT_VERSION_ARM}_armhf.deb 2>&1
else
echo -e "\e[94m Installing the Plane Finder ADS-B Client v${PLANEFINDER_CLIENT_VERSION_I386} for I386 devices package...\e[97m"
# Otherwise assume i386.
echo -e "\e[94m Installing the Plane Finder ADS-B Client v${PLANEFINDER_CLIENT_VERSION_I386} package for i386 devices...\e[97m"
if [[ `lsb_release -si` = "Debian" ]] ; then
# Force architecture if this is Debian.
echo -e "\e[94m NOTE: dpkg executed with added flag --force-architecture.\e[97m"
echo -e ""
sudo dpkg -i --force-architecture ${COMPONENT_BUILD_DIRECTORY}/pfclient_${PLANEFINDER_CLIENT_VERSION_I386}_i386.deb
sudo dpkg -i --force-architecture ${COMPONENT_BUILD_DIRECTORY}/pfclient_${PLANEFINDER_CLIENT_VERSION_I386}_i386.deb 2>&1
else
echo -e ""
sudo dpkg -i ${COMPONENT_BUILD_DIRECTORY}/pfclient_${PLANEFINDER_CLIENT_VERSION_I386}_i386.deb
sudo dpkg -i ${COMPONENT_BUILD_DIRECTORY}/pfclient_${PLANEFINDER_CLIENT_VERSION_I386}_i386.deb 2>&1
fi
fi
# Create binary package archive directory.
if [[ ! -d "${RECEIVER_BUILD_DIRECTORY}/package-archive" ]] ; then
echo -e "\e[94m Creating package archive directory...\e[97m"
mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/package-archive 2>&1
# Dummy test for consistency with other feeder install scripts.
if [[ -n "${CPU_ARCHITECTURE}" ]] ; then
# Check that the component package was installed successfully.
echo -e ""
echo -e "\e[94m Checking that the pfclient package was installed properly...\e[97m"
echo -e ""
fi
# Archive binary package and changelog.
echo -e "\e[94m Archiving the pfclient package...\e[97m"
mv -vf ${COMPONENT_BUILD_DIRECTORY}/pfclient_*.deb ${RECEIVER_BUILD_DIRECTORY}/package-archive 2>&1
echo -e ""
if [[ $(dpkg-query -W -f='${STATUS}' pfclient 2>/dev/null | grep -c "ok installed") -eq 0 ]] ; then
# If the component package could not be installed halt setup.
echo -e ""
echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
echo -e " UNABLE TO INSTALL A REQUIRED PACKAGE."
echo -e " SETUP HAS BEEN TERMINATED!"
echo -e ""
echo -e "\e[93mThe package \"pfclient\" could not be installed.\e[39m"
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m Plane Finder ADS-B Client setup halted.\e[39m"
echo -e ""
if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
read -p "Press enter to continue..." CONTINUE
fi
exit 1
else
# Create binary package archive directory.
if [[ ! -d "${RECEIVER_BUILD_DIRECTORY}/package-archive" ]] ; then
echo -e "\e[94m Creating package archive directory...\e[97m"
echo -e ""
mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/package-archive 2>&1
echo -e ""
fi
# Check that the Plane Finder ADS-B Client package was installed successfully.
echo -e ""
echo -e "\e[94m Checking that the pfclient package was installed properly...\e[97m"
if [[ $(dpkg-query -W -f='${STATUS}' pfclient 2>/dev/null | grep -c "ok installed") -eq 0 ]] ; then
# If the pfclient package could not be installed halt setup.
echo -e ""
echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
echo -e " UNABLE TO INSTALL A REQUIRED PACKAGE."
echo -e " SETUP HAS BEEN TERMINATED!"
echo -e ""
echo -e "\e[93mThe package \"pfclient\" could not be installed.\e[39m"
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m Plane Finder ADS-B Client setup halted.\e[39m"
echo -e ""
if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
read -p "Press enter to continue..." CONTINUE
# Archive binary package.
echo -e "\e[94m Archiving the pfclient package...\e[97m"
echo -e ""
mv -vf ${COMPONENT_BUILD_DIRECTORY}/pfclient_*.deb ${RECEIVER_BUILD_DIRECTORY}/package-archive 2>&1
echo -e ""
fi
exit 1
fi
## DISPLAY FINAL SETUP INSTRUCTIONS WHICH CONNOT BE HANDLED BY THIS SCRIPT
@ -173,7 +200,7 @@ whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Plane Finder ADS-B Cli
### SETUP COMPLETE
# Return to the project root directory.
echo -e "\e[94m Entering the ADS-B Receiver Project root directory...\e[97m"
echo -e "\e[94m Entering the ${RECEIVER_PROJECT_TITLE} root directory...\e[97m"
cd ${RECEIVER_ROOT_DIRECTORY} 2>&1
echo -e ""

Wyświetl plik

@ -47,6 +47,7 @@ PLANEFINDER_CLIENT_VERSION_ARM="3.5.469"
PLANEFINDER_CLIENT_VERSION_I386="3.4.61"
# Flightradar24 Client
FLIGHTRADAR24_CLIENT_VERSION_ARM="1.0.18-7"
FLIGHTRADAR24_CLIENT_VERSION_I386="1.0.18-5"
# mlat-client