adsb-receiver/install.sh

582 wiersze
21 KiB
Bash
Czysty Zwykły widok Historia

2015-11-04 04:48:08 +00:00
#!/bin/bash
#####################################################################################
# ADS-B RECEIVER #
2015-11-04 04:48:08 +00:00
#####################################################################################
# #
# 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 #
2015-11-04 04:48:08 +00:00
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# 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. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
2015-12-17 04:38:06 +00:00
## VARIABLES
2016-01-08 17:02:34 +00:00
BASEDIR=$PWD
BASHDIR="$BASEDIR/bash"
BUILDDIR="$BASEDIR/build"
2015-11-04 04:48:08 +00:00
source $BASHDIR/variables.sh
source $BASHDIR/functions.sh
2015-11-04 04:48:08 +00:00
2016-02-05 21:44:31 +00:00
## CHECK IF FIRST RUN USING IMAGE
if [ -f $BASEDIR/image ]; then
# Execute image setup script.
2016-02-06 02:00:53 +00:00
chmod +x $BASHDIR/image.sh
$BASHDIR/image.sh
2016-02-05 21:44:31 +00:00
# Exit scripts once the the image setup script has completed.
echo -e "\033[32m"
echo "Image setup complete."
echo -e "\033[33m"
2016-02-05 22:07:18 +00:00
echo "At any time you can execute install.sh to add additional features"
echo "or update existing packages installed on this device."
2016-02-05 21:44:31 +00:00
echo -e "\033[37m"
exit 0
fi
## FUNCTIONS
2015-12-17 04:38:06 +00:00
# Download the latest package lists for enabled repositories and PPAs.
function AptUpdate() {
2015-11-04 04:48:08 +00:00
clear
echo -e "\033[33m"
2015-12-17 04:38:06 +00:00
echo "Downloading latest package lists for enabled repositories and PPAs..."
2015-11-04 04:48:08 +00:00
echo -e "\033[37m"
2015-12-17 04:38:06 +00:00
sudo apt-get update
}
2015-11-04 04:48:08 +00:00
2015-12-17 04:38:06 +00:00
# Update the operating system.
function UpdateOperatingSystem() {
2015-11-04 04:48:08 +00:00
clear
echo -e "\033[33m"
echo "Downloading and installing the latest updates for your operating system..."
echo -e "\033[37m"
sudo apt-get -y upgrade
echo -e "\033[33m"
echo "Your system should now be up to date."
echo -e "\033[37m"
read -p "Press enter to continue..." CONTINUE
2015-12-17 04:38:06 +00:00
}
2015-11-04 04:48:08 +00:00
2015-12-17 04:38:06 +00:00
# Download, build and then install the dump1090-mutability package.
function InstallDump1090() {
clear
2015-11-04 04:48:08 +00:00
cd $BUILDDIR
echo -e "\033[33mExecuting the dump1090-mutability installation script..."
echo -e "\033[37m"
chmod +x $BASHDIR/decoders/dump1090-mutability.sh
$BASHDIR/decoders/dump1090-mutability.sh
cd $BASEDIR
2015-12-17 04:38:06 +00:00
}
2015-11-04 04:48:08 +00:00
2016-01-20 20:37:02 +00:00
# Download and build dump978.
function InstallDump978() {
clear
cd $BUILDDIR
echo -e "\033[33mExecuting the dump978 installation script..."
echo -e "\033[37m"
chmod +x $BASHDIR/decoders/dump978.sh
$BASHDIR/decoders/dump978.sh
cd $BASEDIR
}
2015-12-17 04:38:06 +00:00
# Download, build and then install the PiAware package.
function InstallPiAware() {
2015-11-04 04:48:08 +00:00
clear
2015-12-17 04:38:06 +00:00
cd $BUILDDIR
echo -e "\033[33mExecuting the PiAware installation script..."
echo -e "\033[37m"
chmod +x $BASHDIR/feeders/piaware.sh
$BASHDIR/feeders/piaware.sh
cd $BASEDIR
2015-12-17 04:38:06 +00:00
}
2015-11-04 04:48:08 +00:00
2015-12-17 04:38:06 +00:00
# Download and install the Plane Finder ADS-B Client package.
function InstallPlaneFinder() {
clear
2015-11-04 04:48:08 +00:00
cd $BUILDDIR
2015-12-17 04:38:06 +00:00
echo -e "\033[33mExecuting the Plane Finder ADS-B Client installation script..."
echo -e "\033[37m"
chmod +x $BASHDIR/feeders/planefinder.sh
$BASHDIR/feeders/planefinder.sh
cd $BASEDIR
2015-12-17 04:38:06 +00:00
}
2015-11-04 04:48:08 +00:00
# Download and install the Flightradar24 client package.
function InstallFlightradar24() {
clear
cd $BUILDDIR
echo -e "\033[33mExecuting the Flightradar24 client installation script..."
echo -e "\033[37m"
chmod +x $BASHDIR/feeders/flightradar24.sh
$BASHDIR/feeders/flightradar24.sh
cd $BASEDIR
}
2015-12-17 04:38:06 +00:00
# Setup the ADS-B Exchange feed.
function InstallAdsbExchange() {
clear
cd $BUILDDIR
echo -e "\033[33mExecuting the ADS-B Exchange installation script..."
2015-11-04 04:48:08 +00:00
echo -e "\033[37m"
2016-01-11 15:34:08 +00:00
chmod +x $BASHDIR/feeders/adsbexchange.sh
2016-01-07 04:19:05 +00:00
$BASHDIR/feeders/adsbexchange.sh
cd $BASEDIR
2015-12-17 04:38:06 +00:00
}
2015-11-04 04:48:08 +00:00
2015-12-17 04:38:06 +00:00
# Setup and execute the web portal installation scripts.
2015-12-19 09:39:04 +00:00
function InstallWebPortal() {
2015-11-04 04:48:08 +00:00
clear
cd $BUILDDIR
2015-12-17 04:38:06 +00:00
echo -e "\033[33mExecuting the web portal installation scripts..."
echo -e "\033[37m"
chmod +x $BASHDIR/portal/install.sh
$BASHDIR/portal/install.sh
cd $BASEDIR
2015-12-17 04:38:06 +00:00
}
2015-11-04 04:48:08 +00:00
2015-12-17 04:38:06 +00:00
#############
## WHIPTAIL
2015-11-04 04:48:08 +00:00
2015-12-23 01:13:54 +00:00
# Check that whiptail is installed.
CheckPackage whiptail
2015-12-17 04:38:06 +00:00
##
## MESSAGES
2015-11-04 04:48:08 +00:00
##
2015-12-17 04:38:06 +00:00
# The title of the installer.
BACKTITLE="The ADS-B Receiver Project"
2015-12-17 04:38:06 +00:00
# The welcome message displayed when this scrip[t it first executed.
read -d '' WELCOME <<"EOF"
The ADS-B Project is a series of bash scripts and files which can be used to setup an ADS-B receiver on certain Debian derived operating system.
2015-12-17 04:38:06 +00:00
More information on the project can be found on GitHub.
https://github.com/jprochazka/adsb-receiver
2015-12-17 04:38:06 +00:00
Would you like to continue setup?
EOF
# Message displayed asking to update the operating system.
read -d '' UPDATEFIRST <<"EOF"
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.
2015-12-17 04:38:06 +00:00
Update system before installing any ADS-B receiver related software?
2015-12-17 04:38:06 +00:00
EOF
# Message displayed if dump1090-mutability is installed.
read -d '' DUMP1090INSTALLED <<"EOF"
2015-12-27 06:28:02 +00:00
The dump1090-mutability package appears to be installed on your device However...
2016-01-20 20:37:02 +00:00
The dump1090-mutability v1.15~dev source code is updated regularly without a change made to the version numbering. In order to insure you are running the latest version of
dump1090-mutability you may opt to rebuild and reinstall this package.
2015-12-27 06:28:02 +00:00
Download, build, and reinstall this package?
2015-12-17 04:38:06 +00:00
EOF
# Message displayed if dump1090-mutability is not installed.
read -d '' DUMP1090NOTINSTALLED <<"EOF"
The dump1090-mutability package does not appear to be installed on your system. In order to continue setup dump1090-mutability will be downloaded, compiled and installed on this system.
2015-12-17 04:38:06 +00:00
Do you wish to continue setup?
Answering no will exit this script with no actions taken.
EOF
2016-01-20 20:37:02 +00:00
# Message displayed if dump978 is installed.
read -d '' DUMP978INSTALLED <<"EOF"
Dump978 appears to be installed on your device However...
The dump978 source code may have been updated since it was built last. In order to insure you are running the latest version of dump978 you may opt to rebuild the binaries making up dump978.
Download and rebuild the dump978 binaries?
EOF
# Message displayed if dump978 is not installed.
read -d '' DUMP978NOTINSTALLED <<"EOF"
Dump978 is an experimental demodulator/decoder for 978MHz UAT signals. These scripts are able to setup dump978 for you. However keep in mind a second RTL-SDR device will be required in order to feed data to it.
Do you wish to install dump978?
EOF
2015-12-17 04:38:06 +00:00
# Message displayed above feeder selection check list.
FEEDERSAVAILABLE="The following feeders are available for installation. Choose the feeders you wish to install. (Hint: Use spacebar to select/deselect.)"
2015-12-17 04:38:06 +00:00
2015-12-21 22:37:41 +00:00
# Message displayed if all available feeders have already been installed.
ALLFEEDERSINSTALLED="It appears that all the feeders available for installation by this script have been installed already."
2015-12-17 04:38:06 +00:00
# Message displayed asking if the user wishes to install the web portal.
read -d '' INSTALLWEBPORTAL <<"EOF"
The ADS-B Receiver Project Web Portal is a light weight web interface for dump-1090-mutability installations.
2015-12-17 04:38:06 +00:00
Current features include the following:
Unified navigation between all web pages.
System and dump1090 performance graphs.
Would you like to install the ADS-B Receiver Project web portal on this device?
2015-12-17 04:38:06 +00:00
EOF
2015-12-21 22:37:41 +00:00
# Message to display if there is nothing to install or do.
NOTHINGTODO="Nothing has been selected to be installed so the script will exit now."
2015-12-17 04:38:06 +00:00
# Message displayed once installation has been completed.
read -d '' INSTALLATIONCOMPLETE <<"EOF"
INSTALLATION COMPLETE
2016-04-22 18:58:55 +00:00
DO NOT DELETE THIS DIRECTORY!
Files needed for certain items to run properly are contained within this directory. Deleting this directory may result in your receiver not working properly.
2016-02-22 14:40:35 +00:00
It is hoped these scripts and files were found useful while setting up your ADS-B Receiver. Feedback regarding this software is always welcome. If you ran into any problems or wish to submit feed back feel free to do so on the project's GitHub site.
2015-12-17 04:38:06 +00:00
https://github.com/jprochazka/adsb-receiver
2015-12-17 04:38:06 +00:00
EOF
2015-11-04 04:48:08 +00:00
2015-12-17 04:38:06 +00:00
##
## DIALOGS
##
2015-11-04 04:48:08 +00:00
2015-12-17 04:38:06 +00:00
# Display the welcome message.
whiptail --backtitle "$BACKTITLE" --title "The ADS-B Receiver Project" --yesno "$WELCOME" 16 65
2015-12-21 22:37:41 +00:00
BEGININSTALLATION=$?
if [ $BEGININSTALLATION = 1 ]; then
# Exit the script if the user wishes not to continue.
echo -e "\033[31m"
echo "Installation cancelled by user."
echo -e "\033[37m"
exit 0
fi
2015-11-04 04:48:08 +00:00
2015-12-17 04:38:06 +00:00
# Ask to update the operating system.
2015-12-19 08:51:05 +00:00
whiptail --backtitle "$BACKTITLE" --title "Install Operating System Updates" --yesno "$UPDATEFIRST" 10 65
2015-12-17 04:38:06 +00:00
UPDATEOS=$?
2015-11-04 04:48:08 +00:00
2015-12-17 04:38:06 +00:00
## DUMP1090-MUTABILITY CHECK
DUMP1090CHOICE=1
2015-12-27 07:30:27 +00:00
DUMP1090REINSTALL=1
2015-12-17 04:38:06 +00:00
# Check if the dump1090-mutability package is installed.
if [ $(dpkg-query -W -f='${STATUS}' dump1090-mutability 2>/dev/null | grep -c "ok installed") -eq 1 ]; then
# The dump1090-mutability package appear to be installed.
2015-12-27 06:28:02 +00:00
whiptail --backtitle "$BACKTITLE" --title "Dump1090-mutability Installed" --yesno "$DUMP1090INSTALLED" 16 65
DUMP1090REINSTALL=$?
2015-12-27 06:28:02 +00:00
if [ $DUMP1090REINSTALL = 0 ]; then
DUMP1090CHOICE=0
fi
2015-12-17 04:38:06 +00:00
else
2015-12-19 08:51:05 +00:00
whiptail --backtitle "$BACKTITLE" --title "Dump1090-mutability Not Installed" --yesno "$DUMP1090NOTINSTALLED" 10 65
2015-12-17 04:38:06 +00:00
DUMP1090CHOICE=$?
if [ $DUMP1090CHOICE = 1 ]; then
# If the user decided not to install dump1090-mutability exit setup.
2015-12-19 08:51:05 +00:00
echo -e "\033[31m"
echo "Installation cancelled by user."
echo -e "\033[37m"
2015-12-17 04:38:06 +00:00
exit 0
fi
fi
2015-11-04 04:48:08 +00:00
2016-01-20 20:37:02 +00:00
DUMP978CHOICE=1
2016-01-20 20:47:36 +00:00
DUMP978REBUILD=1
2016-01-20 20:37:02 +00:00
# Check if the dump978 has been built.
if [ -f $BUILDDIR/dump978/dump978 ] && [ -f $BUILDDIR/dump978/uat2text ] && [ -f $BUILDDIR/dump978/uat2esnt ] && [ -f $BUILDDIR/dump978/uat2json ]; then
# Dump978 appears to have been built already.
whiptail --backtitle "$BACKTITLE" --title "Dump978 Installed" --yesno "$DUMP978INSTALLED" 16 65
2016-01-20 20:47:36 +00:00
DUMP978REBUILD=$?
if [ $DUMP978REBUILD = 0 ]; then
DUMP978CHOICE=0
2016-01-20 20:37:02 +00:00
fi
else
# Dump978 does not appear to have been built yet.
whiptail --backtitle "$BACKTITLE" --title "Dump978 Not Installed" --yesno "$DUMP978NOTINSTALLED" 10 65
DUMP978CHOICE=$?
fi
2015-12-17 04:38:06 +00:00
## FEEDER OPTIONS
2015-11-04 04:48:08 +00:00
declare array FEEDERLIST
2015-11-04 04:48:08 +00:00
2015-12-27 07:30:27 +00:00
# Check if the PiAware package is installed or if it needs upgraded.
if [ $(dpkg-query -W -f='${STATUS}' piaware 2>/dev/null | grep -c "ok installed") -eq 0 ]; then
2015-12-17 04:38:06 +00:00
# The PiAware package appear to be installed.
FEEDERLIST=("${FEEDERLIST[@]}" 'FlightAware PiAware' '' OFF)
2015-12-27 07:30:27 +00:00
else
# Check if a newer version can be installed.
if [ $(sudo dpkg -s piaware 2>/dev/null | grep -c "Version: ${PIAWAREVERSION}") -eq 0 ]; then
FEEDERLIST=("${FEEDERLIST[@]}" 'FlightAware PiAware (upgrade)' '' OFF)
fi
2015-11-04 04:48:08 +00:00
fi
2015-12-17 04:38:06 +00:00
# Check if the Plane Finder ADS-B Client package is installed.
2015-12-19 09:39:04 +00:00
if [ $(dpkg-query -W -f='${STATUS}' pfclient 2>/dev/null | grep -c "ok installed") -eq 0 ]; then
2015-12-17 04:38:06 +00:00
# The Plane Finder ADS-B Client package appear to be installed.
FEEDERLIST=("${FEEDERLIST[@]}" 'Plane Finder ADS-B Client' '' OFF)
2015-12-29 19:17:36 +00:00
else
# Set version depending on the device architecture.
PFCLIENTVERSION=$PFCLIENTVERSIONARM
if [[ `uname -m` != "armv7l" ]]; then
PFCLIENTVERSION=$PFCLIENTVERSIONI386
fi
2015-12-29 19:17:36 +00:00
# Check if a newer version can be installed.
if [ $(sudo dpkg -s pfclient 2>/dev/null | grep -c "Version: ${PFCLIENTVERSION}") -eq 0 ]; then
FEEDERLIST=("${FEEDERLIST[@]}" 'Plane Finder ADS-B Client (upgrade)' '' OFF)
fi
2015-12-17 04:38:06 +00:00
fi
2015-11-04 04:48:08 +00:00
# Check if the Flightradar24 client package is installed.
if [ $(dpkg-query -W -f='${STATUS}' fr24feed 2>/dev/null | grep -c "ok installed") -eq 0 ]; then
# The Flightradar24 client package appear to be installed.
FEEDERLIST=("${FEEDERLIST[@]}" 'Flightradar24 Client' '' OFF)
else
if [[ `uname -m` != "armv7l" ]]; then
if [ $(sudo dpkg -s fr24feed 2>/dev/null | grep -c "Version: ${FR24CLIENTVERSIONI386}") -eq 0 ]; then
FEEDERLIST=("${FEEDERLIST[@]}" 'Flightradar24 Client (upgrade)' '' OFF)
fi
fi
fi
2015-12-17 04:38:06 +00:00
# Check if ADS-B Exchange sharing has been set up.
2015-12-29 19:24:07 +00:00
if ! grep -q "${BUILDDIR}/adsbexchange/adsbexchange-maint.sh &" /etc/rc.local; then
2015-12-17 04:38:06 +00:00
# The ADS-B Exchange maintainance script does not appear to be executed on start up.
FEEDERLIST=("${FEEDERLIST[@]}" 'ADS-B Exchange Script' '' OFF)
2015-12-17 04:38:06 +00:00
fi
2015-11-04 04:48:08 +00:00
declare FEEDERCHOICES
2015-12-19 08:51:05 +00:00
if [[ -n "$FEEDERLIST" ]]; then
# Display a checklist containing feeders that are not installed if any.
2015-12-19 08:51:05 +00:00
# This command is creating a file named FEEDERCHOICES but can not fiogure out how to make it only a variable without the file being created at this time.
whiptail --backtitle "$BACKTITLE" --title "Feeder Installation Options" --checklist --nocancel --separate-output "$FEEDERSAVAILABLE" 13 52 4 "${FEEDERLIST[@]}" 2>FEEDERCHOICES
2015-12-21 22:37:41 +00:00
else
# Since all available feeders appear to be installed inform the user of the fact.
whiptail --backtitle "$BACKTITLE" --title "All Feeders Installed" --msgbox "$ALLFEEDERSINSTALLED" 10 65
fi
2015-11-04 04:48:08 +00:00
2015-12-17 04:38:06 +00:00
## WEB PORTAL
2015-11-04 04:48:08 +00:00
2015-12-17 04:38:06 +00:00
# Ask if the web portal should be installed.
whiptail --backtitle "$BACKTITLE" --title "Install The ADS-B Receiver Project Web Portal" --yesno "$INSTALLWEBPORTAL" 8 78
DOINSTALLWEBPORTAL=$?
## CONFIRMATION
2015-12-21 22:37:41 +00:00
# Check if anything is to be done before moving on.
if [ $UPDATEOS = 1 ] && [ $DUMP1090CHOICE = 1 ] && [ $DUMP978CHOICE = 1 ] && [ $DOINSTALLWEBPORTAL = 1 ] && [ ! -s FEEDERCHOICES ]; then
2015-12-21 22:37:41 +00:00
whiptail --backtitle "$BACKTITLE" --title "Nothing to be done" --msgbox "$NOTHINGTODO" 10 65
2015-12-21 22:37:41 +00:00
echo -e "\033[31m"
echo "Nothing was selected to do or be installed."
echo "The script has been exited."
echo -e "\033[37m"
# Dirty hack but cannot make the whiptail checkbox not create this file and still work...
# Will work on figuring this out at a later date so until then we will delete the file it created.
rm -f FEEDERCHOICES
exit 0
fi
2015-12-21 22:37:41 +00:00
declare CONFIRMATION
# If the user decided to install updates...
2016-01-08 16:24:10 +00:00
if [ $UPDATEOS = 0 ]; then
2015-12-21 22:37:41 +00:00
CONFIRMATION="The following actions will be performed:\n"
2015-12-21 22:37:41 +00:00
if [ $UPDATEOS = 0 ]; then
# Operating system updates message.
CONFIRMATION="${CONFIRMATION}\n * Operating system updates will be applied."
fi
CONFIRMATION="${CONFIRMATION}\n"
fi
2015-12-27 07:30:27 +00:00
# If the user decided to install software...
2016-03-29 05:28:57 +00:00
if [ $DUMP1090CHOICE = 0 ] || [ $DUMP978CHOICE = 0 ] || [ $DOINSTALLWEBPORTAL = 0 ] || [ -s FEEDERCHOICES ]; then
2015-12-21 22:37:41 +00:00
CONFIRMATION="${CONFIRMATION}\nThe following software will be installed:\n"
if [ $DUMP1090CHOICE = 0 ]; then
2015-12-27 07:30:27 +00:00
if [ $DUMP1090REINSTALL -eq 0 ]; then
CONFIRMATION="${CONFIRMATION}\n * dump1090-mutability (reinstall)"
else
CONFIRMATION="${CONFIRMATION}\n * dump1090-mutability"
fi
2015-12-21 22:37:41 +00:00
fi
2016-01-20 20:37:02 +00:00
if [ $DUMP978CHOICE = 0 ]; then
2016-01-20 20:47:36 +00:00
if [ $DUMP978REBUILD -eq 0 ]; then
CONFIRMATION="${CONFIRMATION}\n * dump978 (rebuild)"
2016-01-20 20:37:02 +00:00
else
CONFIRMATION="${CONFIRMATION}\n * dump978"
fi
fi
2015-12-21 23:01:07 +00:00
if [ -s FEEDERCHOICES ]; then
2015-12-21 22:37:41 +00:00
while read FEEDERCHOICE
do
case $FEEDERCHOICE in
2015-12-27 07:30:27 +00:00
"FlightAware PiAware")
CONFIRMATION="${CONFIRMATION}\n * FlightAware PiAware"
;;
"FlightAware PiAware (upgrade)")
CONFIRMATION="${CONFIRMATION}\n * FlightAware PiAware (upgrade)"
;;
"Plane Finder ADS-B Client")
CONFIRMATION="${CONFIRMATION}\n * Plane Finder ADS-B Client"
;;
2015-12-29 19:17:36 +00:00
"Plane Finder ADS-B Client (upgrade)")
CONFIRMATION="${CONFIRMATION}\n * Plane Finder ADS-B Client (upgrade)"
;;
"Flightradar24 Client")
CONFIRMATION="${CONFIRMATION}\n * Flightradar24 Client"
;;
"Flightradar24 Client (upgrade)")
CONFIRMATION="${CONFIRMATION}\n * Flightradar24 Client (upgrade)"
;;
2015-12-27 07:30:27 +00:00
"ADS-B Exchange Script")
CONFIRMATION="${CONFIRMATION}\n * ADS-B Exchange Script"
;;
2015-12-21 22:37:41 +00:00
esac
done < FEEDERCHOICES
fi
if [ $DOINSTALLWEBPORTAL = 0 ]; then
CONFIRMATION="${CONFIRMATION}\n * ADS-B Receiver Project Web Portal"
2015-12-21 22:37:41 +00:00
fi
CONFIRMATION="${CONFIRMATION}\n"
fi
2015-12-21 22:37:41 +00:00
# Ask for confirmation before moving on.
CONFIRMATION="${CONFIRMATION}\nDo you wish to continue?"
2016-01-20 20:47:36 +00:00
whiptail --backtitle "$BACKTITLE" --title "Confirm You Wish To Continue" --yesno "$CONFIRMATION" 21 78
CONFIRMATION=$?
if [ $CONFIRMATION = 1 ]; then
echo -e "\033[31m"
echo "Installation cancelled by user."
echo -e "\033[37m"
2015-12-19 08:51:05 +00:00
# Dirty hack but cannot make the whiptail checkbox not create this file and still work...
# Will work on figuring this out at a later date so until then we will delete the file it created.
rm -f FEEDERCHOICES
exit 0
2015-11-04 04:48:08 +00:00
fi
2015-12-17 04:38:06 +00:00
################
## BEGIN SETUP
2015-11-04 04:48:08 +00:00
2015-12-17 04:38:06 +00:00
## System updates.
2015-11-04 04:48:08 +00:00
AptUpdate
2015-12-01 07:57:20 +00:00
2015-12-17 04:38:06 +00:00
if [ $UPDATEOS = 0 ]; then
UpdateOperatingSystem
2015-12-17 04:38:06 +00:00
fi
2015-11-04 04:48:08 +00:00
2015-12-17 04:38:06 +00:00
## Mode S decoder.
2015-11-04 04:48:08 +00:00
2015-12-21 22:37:41 +00:00
if [ $DUMP1090CHOICE = 0 ]; then
InstallDump1090
2015-11-04 04:48:08 +00:00
fi
2016-01-20 20:37:02 +00:00
if [ $DUMP978CHOICE = 0 ]; then
InstallDump978
fi
2015-12-17 04:38:06 +00:00
## Feeders.
2015-11-04 04:48:08 +00:00
2015-12-21 22:37:41 +00:00
# Moved execution of functions outside of while loop.
# Inside the while loop the installation scripts are not stopping at reads.
RUNPIAWARESCRIPT=1
RUNPLANEFINDERSCRIPT=1
RUNFLIGHTRADAR24SCRIPT=1
2015-12-21 22:37:41 +00:00
RUNADSBEXCHANGESCRIPT=1
2015-12-21 23:01:07 +00:00
if [ -s FEEDERCHOICES ]; then
2015-12-21 22:37:41 +00:00
while read FEEDERCHOICE
do
case $FEEDERCHOICE in
2015-12-27 07:30:27 +00:00
"FlightAware PiAware"|"FlightAware PiAware (upgrade)")
RUNPIAWARESCRIPT=0
2015-12-21 22:37:41 +00:00
;;
2015-12-29 19:17:36 +00:00
"Plane Finder ADS-B Client"|"Plane Finder ADS-B Client (upgrade)")
2015-12-27 07:30:27 +00:00
RUNPLANEFINDERSCRIPT=0
2015-12-21 22:37:41 +00:00
;;
"Flightradar24 Client"|"Flightradar24 Client (upgrade)")
RUNFLIGHTRADAR24SCRIPT=0
;;
2015-12-27 07:30:27 +00:00
"ADS-B Exchange Script")
RUNADSBEXCHANGESCRIPT=0
2015-12-21 22:37:41 +00:00
;;
esac
done < FEEDERCHOICES
fi
if [ $RUNPIAWARESCRIPT = 0 ]; then
InstallPiAware
fi
if [ $RUNPLANEFINDERSCRIPT = 0 ]; then
InstallPlaneFinder
fi
if [ $RUNFLIGHTRADAR24SCRIPT = 0 ]; then
InstallFlightradar24
fi
2015-12-21 22:37:41 +00:00
if [ $RUNADSBEXCHANGESCRIPT = 0 ]; then
InstallAdsbExchange
fi
2015-12-17 04:38:06 +00:00
## Web portal.
if [ $DOINSTALLWEBPORTAL = 0 ]; then
InstallWebPortal
2015-12-17 04:38:06 +00:00
fi
2015-11-04 04:48:08 +00:00
2015-12-17 04:38:06 +00:00
##########################
## INSTALLATION COMPLETE
2015-11-04 04:48:08 +00:00
2015-12-17 04:38:06 +00:00
# Display the installation complete message box.
2016-04-22 18:58:55 +00:00
whiptail --backtitle "$BACKTITLE" --title "Software Installation Complete" --msgbox "$INSTALLATIONCOMPLETE" 19 65
2015-12-19 08:51:05 +00:00
# Once again cannot make the whiptail checkbox not create this file and still work...
# Will work on figuring this out at a later date but until then we will delete the file created.
rm -f FEEDERCHOICES
2015-11-04 04:48:08 +00:00
2015-12-21 22:37:41 +00:00
echo -e "\033[32m"
2015-12-19 09:39:04 +00:00
echo "Installation complete."
echo -e "\033[37m"
2015-12-17 04:38:06 +00:00
exit 0