Merge pull request #472 from jprochazka/2.7.0

2.7.0 pre-release
pull/481/head
Joe Prochazka 2018-10-04 10:48:13 -04:00 zatwierdzone przez GitHub
commit cee2774291
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
14 zmienionych plików z 943 dodań i 45 usunięć

Wyświetl plik

@ -0,0 +1,348 @@
#!/bin/bash
#####################################################################################
# ADS-B RECEIVER #
#####################################################################################
# #
# This script is not meant to be executed directly. #
# Instead execute install.sh to begin the installation process. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# Copyright (c) 2015-2018, Joseph A. Prochazka #
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy #
# of this software and associated documentation files (the "Software"), to deal #
# in the Software without restriction, including without limitation the rights #
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell #
# copies of the Software, and to permit persons to whom the Software is #
# furnished to do so, subject to the following conditions: #
# #
# The above copyright notice and this permission notice shall be included in all #
# copies or substantial portions of the Software. #
# #
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE #
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, #
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE #
# SOFTWARE. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
### VARIABLES
RECEIVER_ROOT_DIRECTORY="${PWD}"
RECEIVER_BASH_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/bash"
RECEIVER_BUILD_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/build"
### INCLUDE EXTERNAL SCRIPTS
source ${RECEIVER_BASH_DIRECTORY}/variables.sh
source ${RECEIVER_BASH_DIRECTORY}/functions.sh
## SET INSTALLATION VARIABLES
# Source the automated install configuration file if this is an automated installation.
if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] && [[ -s "${RECEIVER_CONFIGURATION_FILE}" ]] ; then
source ${RECEIVER_CONFIGURATION_FILE}
fi
### BEGIN SETUP
if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
clear
echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
fi
echo -e ""
echo -e "\e[92m Setting up dump1090-hptoa..."
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------\e[96m"
echo -e ""
# Confirm that the installation process should continue.
if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
# Interactive install.
CONTINUE_SETUP=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Dump1090-hptoa Setup" --yesno "This is a fork of Mutability's version of dump1090 that adds a novel method to compute high-precision Time-of-Arrival (ToA) timestamps of the Mode S / ADS-B packets. The actual precision is in the order of a few nanoseconds, depending on the packet strength.\n\n https://github.com/openskynetwork/dump1090-hptoa \n\nContinue setup by installing dump1090-hptoa?" 15 78 3>&1 1>&2 2>&3)
if [[ ${CONTINUE_SETUP} -eq 1 ]] ; then
# Setup has been halted by the user.
echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
echo -e " Setup has been halted at the request of the user."
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m Dump1090-hptoa setup halted.\e[39m"
echo -e ""
read -p "Press enter to continue..." CONTINUE
exit 1
fi
else
# Warn that automated installation is not supported.
echo -e "\e[92m Automated installation of this script is not yet supported...\e[39m"
echo -e ""
exit 1
fi
### CHECK FOR PREREQUISITE PACKAGES
echo -e "\e[95m Installing packages needed to fulfill dependencies for dump1090-hptoa...\e[97m"
echo -e ""
# Required by install script.
CheckPackage git
CheckPackage cmake
CheckPackage build-essential
CheckPackage pkg-config
CheckPackage autotools-dev
CheckPackage automake
# Required for USB SDR devices.
CheckPackage librtlsdr-dev
CheckPackage libusb-1.0-0-dev
CheckPackage rtl-sdr
# Required by component.
CheckPackage lighttpd
### START INSTALLATION
echo -e ""
echo -e "\e[95m Begining the dump1090-hptoa installation process...\e[97m"
echo -e ""
## SETUP UDEV RTL-SDR RULES
# Download the file rtl-sdr.rules from the osmocon rtl-sdr repository if it does not already exist.
if [[ ! -f "/etc/udev/rules.d/rtl-sdr.rules" ]] ; then
echo -e "\e[94m Downloading the file rtl-sdr.rules from the rtl-sdr repository...\e[97m"
echo ""
sudo wget -O /etc/udev/rules.d/rtl-sdr.rules https://raw.githubusercontent.com/osmocom/rtl-sdr/master/rtl-sdr.rules
echo -e "\e[94m Restarting udev...\e[97m"
sudo service udev restart
fi
# Create an RTL-SDR blacklist file so the device does not claim SDR's for other purposes.
BlacklistModules
## CREATE THE DUMP1090-HPTOA BUILD DIRECTORY IF IT DOES NOT EXIST
if [[ ! -d "${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa" ]] ; then
echo -e "\e[94m Creating the dump1090-hptoa build directory...\e[97m"
echo ""
mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa
echo ""
fi
## ATTEMPT TO DOWNLOAD OR UPDATE THE LIQUID-DSP SOURCE CODE FROM GITHUB
if [[ -d "${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa/liquid-dsp" ]] && [[ -d "${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa/liquid-dsp/.git" ]] ; then
# A directory with a git repository containing the source code already exists.
echo -e "\e[94m Entering the liquid-dsp git repository directory...\e[97m"
cd ${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa/liquid-dsp 2>&1
echo -e "\e[94m Updating the local liquid-dsp git repository...\e[97m"
echo -e ""
git pull 2>&1
else
# A directory containing the source code does not exist in the build directory.
echo -e "\e[94m Entering to dump1090-hptoa build directory...\e[97m"
cd ${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa 2>&1
echo -e "\e[94m Cloning the liquid-dsp git repository locally...\e[97m"
echo -e ""
git clone https://github.com/jgaeddert/liquid-dsp.git 2>&1
echo ""
fi
## ATTEMPT TO DOWNLOAD OR UPDATE THE DUMP1090-HPTOA SOURCE CODE FROM GITHUB
if [[ -d "${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa/dump1090-hptoa" ]] && [[ -d "${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa/dump1090-hptoa/.git" ]] ; then
# A directory with a git repository containing the source code already exists.
echo -e "\e[94m Entering the dump1090-hptoa git repository directory...\e[97m"
cd ${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa/dump1090-hptoa 2>&1
echo -e "\e[94m Updating the local dump1090-hptoa git repository...\e[97m"
echo -e ""
git pull 2>&1
else
# A directory containing the source code does not exist in the build directory.
echo -e "\e[94m Entering dump1090-hptoa build directory...\e[97m"
cd ${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa 2>&1
echo -e "\e[94m Cloning the dump1090-hptoa git repository locally...\e[97m"
echo -e ""
git clone https://github.com/openskynetwork/dump1090-hptoa.git 2>&1
fi
## BUILD AND INSTALL THE LIQUID-DSP LIBRARY.
echo -e ""
echo -e "\e[95m Building the liquid-dsp library...\e[97m"
echo -e ""
# Change directory to the liquid-dsp build directory.
if [[ ! "${PWD}" = "${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa/liquid-dsp" ]] ; then
echo -e "\e[94m Entering the liquid-dsp build directory...\e[97m"
cd ${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa/liquid-dsp 2>&1
fi
echo -e "\e[94m Executing bootstrap.sh...\e[97m"
./bootstrap.sh
echo -e "\e[94m Executing configure...\e[97m"
echo -e ""
./configure
echo -e ""
echo -e "\e[94m Building the liquid-sdr library...\e[97m"
echo -e ""
make
echo -e ""
echo -e "\e[94m Installing the liquid-sdr library...\e[97m"
echo -e ""
sudo make install
echo -e ""
echo -e "\e[94m Updating the shared library cache...\e[97m"
sudo ldconfig
## BUILD THE DUMP1090-HPTOA BINARIES
echo -e ""
echo -e "\e[95m Building the dump1090-hptoa binaries...\e[97m"
echo -e ""
# Change to the dump1090-hptoa build directory.
if [[ ! "${PWD}" = "${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa/dump1090-hptoa" ]] ; then
echo -e "\e[94m Entering the dump1090-hptoa build directory...\e[97m"
cd ${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa/dump1090-hptoa 2>&1
fi
# Build the binaries.
echo -e "\e[94m Creating the directory ${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa/dump1090-hptoa/build...\e[97m"
echo ""
mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa/dump1090-hptoa/build
echo ""
echo -e "\e[94m Entering the directory ${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa/dump1090-hptoa/build...\e[97m"
cd ${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa/dump1090-hptoa/build 2>&1
echo -e "\e[94m Executing cmake...\e[97m"
echo ""
cmake ../
echo ""
echo -e "\e[94m Now executing make...\e[97m"
echo ""
make
echo ""
# Checking that the binaries were in fact built.
if [ ! -f ${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa/dump1090-hptoa/build/dump1090 ] || [ ! -f ${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa/dump1090-hptoa/build/faup1090 ] || [ ! -f ${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa/dump1090-hptoa/build/view1090 ] ; then
# If any of the binaries were not installed halt the setup process..
echo -e ""
echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
echo -e " FAILED TO BUILD A REQUIRED BINARY."
echo -e " SETUP HAS BEEN TERMINATED!"
echo -e ""
echo -e "\e[93mOne or more of the dump1090-hptoa binaries failed to be built.\e[39m"
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m Dump1090-hptoa setup halted.\e[39m"
echo -e ""
if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
read -p "Press enter to continue..." CONTINUE
fi
exit 1
fi
## POST INSTALL ACTIONS
# Create the dump190 init script.
echo -e "\e[94m Creating the dump1090 init script...\e[97m"
sudo tee /etc/init.d/dump1090 > /dev/null <<EOF
#!/bin/bash
### BEGIN INIT INFO
#
# Provides: dump1090
# Required-Start: \$remote_fs
# Required-Stop: \$remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: dump1090 initscript
#
### END INIT INFO
## Fill in name of program here.
PROG="dump1090"
PROG_PATH="${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa/dump1090-hptoa/build/dump1090"
PROG_ARGS="--quiet --gain -10 --net --net-beast --enable-hptoa PeakPulse"
PIDFILE="/var/run/dump1090.pid"
start() {
if [ -e \$PIDFILE ]; then
## Program is running, exit with error.
echo "Error! \$PROG is currently running!" 1>&2
exit 1
else
## Change from /dev/null to something like /var/log/\$PROG if you want to save output.
cd \$PROG_PATH
./\$PROG \$PROG_ARGS 2>&1 >/dev/null &
echo "\$PROG started"
touch \$PIDFILE
fi
}
stop() {
if [ -e \$PIDFILE ]; then
## Program is running, so stop it
echo "\$PROG is running"
killall \$PROG
rm -f \$PIDFILE
echo "\$PROG stopped"
else
## Program is not running, exit with error.
echo "Error! \$PROG not started!" 1>&2
exit 1
fi
}
## Check to see if we are running as root first.
## Found at http://www.cyberciti.biz/tips/shell-root-user-check-script.html
if [ "\$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
case "\$1" in
start)
start
exit 0
;;
stop)
stop
exit 0
;;
reload|restart|force-reload)
stop
start
exit 0
;;
**)
echo "Usage: \$0 {start|stop|reload}" 1>&2
exit 1
;;
esac
exit 0
EOF
echo -e "\e[94m Setting permissions for the dump1090 init script...\e[97m"
sudo chmod +x /etc/init.d/dump1090
echo -e "\e[94m Executing update-rc.d to add the init script link for dump1090...\e[97m"
sudo update-rc.d dump1090 defaults
echo -e "\e[94m Starting dump1090-hptoa...\e[97m"
sudo /etc/init.d/dump1090 start
### SETUP COMPLETE
# Return to the project root directory.
echo -e "\e[94m Returning to ${RECEIVER_PROJECT_TITLE} root directory...\e[97m"
cd ${RECEIVER_ROOT_DIRECTORY} 2>&1
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m Dump1090-hptoa setup is complete.\e[39m"
echo -e ""
if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
read -p "Press enter to continue..." CONTINUE
fi
exit 0

Wyświetl plik

@ -0,0 +1,189 @@
#!/bin/bash
#####################################################################################
# ADS-B RECEIVER #
#####################################################################################
# #
# This script is not meant to be executed directly. #
# Instead execute install.sh to begin the installation process. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# Copyright (c) 2015-2018, Joseph A. Prochazka #
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy #
# of this software and associated documentation files (the "Software"), to deal #
# in the Software without restriction, including without limitation the rights #
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell #
# copies of the Software, and to permit persons to whom the Software is #
# furnished to do so, subject to the following conditions: #
# #
# The above copyright notice and this permission notice shall be included in all #
# copies or substantial portions of the Software. #
# #
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE #
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, #
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE #
# SOFTWARE. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
### VARIABLES
RECEIVER_ROOT_DIRECTORY="${PWD}"
RECEIVER_BASH_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/bash"
RECEIVER_BUILD_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/build"
### INCLUDE EXTERNAL SCRIPTS
source ${RECEIVER_BASH_DIRECTORY}/variables.sh
source ${RECEIVER_BASH_DIRECTORY}/functions.sh
## SET INSTALLATION VARIABLES
# Source the automated install configuration file if this is an automated installation.
if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] && [[ -s "${RECEIVER_CONFIGURATION_FILE}" ]] ; then
source ${RECEIVER_CONFIGURATION_FILE}
fi
### BEGIN SETUP
if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
clear
echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
fi
echo -e ""
echo -e "\e[92m Setting up ADSBHub feeder client..."
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------\e[96m"
echo -e ""
# Confirm component installation.
if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
# Interactive install.
CONTINUE_SETUP=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "ADSBHub client Setup" --yesno "There are many Web sites tracking aircraft and all of them rely on data shared by ADS-B fans. However, the access to aggregated ADS-B worldwide data is limited. The main goal of ADSBHub is to become a ADS-B data sharing centre and valuable data source for all enthusiasts and professionals interested in development of ADS-B related software. For more information please see their website:\n\n http://www.adsbhub.org/howtofeed.php\n\nContinue setup by installing the ADSBHub client?" 16 78 3>&1 1>&2 2>&3)
if [[ ${CONTINUE_SETUP} -eq 1 ]] ; then
# Setup has been halted by the user.
echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
echo -e " Setup has been halted at the request of the user."
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m ADSBHub client setup halted.\e[39m"
echo -e ""
read -p "Press enter to continue..." CONTINUE
exit 1
fi
else
# Warn that automated installation is not supported.
echo -e "\e[92m Automated installation of this script is not yet supported...\e[39m"
echo -e ""
exit 1
fi
### INSTALL REQUIRED PACKAGES IF THEY ARE NOT ALREADY INSTALLED
CheckPackage wget
CheckPackage netcat
### ENABLE THE USE OF /ETC/RC.LOCAL IF THE FILE DOES NOT EXIST
if [ ! -f /etc/rc.local ]; then
echo ""
echo -e "\e[95m Enabling the use of the /etc/rc.local file...\e[97m"
echo ""
# In Debian Stretch /etc/rc.local has been removed.
# However at this time we can bring this file back into play.
# As to if in future releases this will work remains to be seen...
echo -e "\e[94m Creating the file /etc/rc.local...\e[97m"
sudo tee /etc/rc.local > /dev/null <<EOF
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
exit 0
EOF
echo -e "\e[94m Making /etc/rc.local executable...\e[97m"
sudo chmod +x /etc/rc.local
echo -e "\e[94m Enabling the use of /etc/rc.local...\e[97m"
sudo systemctl start rc-local
fi
### DOWNLOAD AND SETUP THE ADSBHUB CLIENT SCRIPT
echo ""
echo -e "\e[95m Setting up the ADSBHub client...\e[97m"
echo ""
# Create the adsbexchange directory in the build directory if it does not exist.
echo -e "\e[94m Checking for the ADSBHub build directory...\e[97m"
if [ ! -d "$RECEIVER_BUILD_DIRECTORY/adsbhub" ]; then
echo -e "\e[94m Creating the ADSBHub build directory...\e[97m"
mkdir $RECEIVER_BUILD_DIRECTORY/adsbhub
fi
# Download the ADSBHub script.
echo -e "\e[94m Downloading the ADSBHub client...\e[97m"
echo -e ""
wget http://www.adsbhub.org/downloads/adsbhub.sh -O ${RECEIVER_BUILD_DIRECTORY}/adsbhub/adsbhub.sh
echo ""
echo -e "\e[94m Setting execute permissions on $RECEIVER_BUILD_DIRECTORY/adsbhub/adsbhub.sh...\e[97m"
chmod +x $RECEIVER_BUILD_DIRECTORY/adsbhub/adsbhub.sh
### ADD STARTUP LINE TO /ETC/RC.LOCAL
echo -e "\e[94m Checking if the ADSBHub startup line is contained within the file /etc/rc.local...\e[97m"
if ! grep -Fxq "$RECEIVER_BUILD_DIRECTORY/adsbhub/adsbhub.sh &" /etc/rc.local; then
echo -e "\e[94m Adding the ADSBHub startup script line to the file /etc/rc.local...\e[97m"
lnum=($(sed -n '/exit 0/=' /etc/rc.local))
((lnum>0)) && sudo sed -i "${lnum[$((${#lnum[@]}-1))]}i $RECEIVER_BUILD_DIRECTORY/adsbhub/adsbhub.sh &\n" /etc/rc.local
fi
### START THE ADSBHUB CLIENT
echo ""
echo -e "\e[95m Starting the ADSBHub client...\e[97m"
echo ""
# Kill any currently running instances of the adsbexchange-socat_maint.sh script.
echo -e "\e[94m Checking for any running adsbexchange-socat_maint.sh processes...\e[97m"
if [[ $(ps -aux | grep '[a]dsbhub/adsbhub.sh' | awk '{print $2}') ]]; then
echo -e "\e[94m Killing the current adsbhub.sh process...\e[97m"
sudo kill -9 $(ps -aux | grep '[a]dsbhub/adsbhub.sh' | awk '{print $2}') &> /dev/null
fi
echo -e "\e[94m Executing the ADSBHub client script...\e[97m"
sudo nohup $RECEIVER_BUILD_DIRECTORY/adsbhub/adsbhub.sh > /dev/null 2>&1 &
### INFORM THE USER THERE IS MORE TO DO
whiptail --title "Complete Setup at ADSBHub.org" --msgbox "IMPORTANT!!!\n\nIn order to complete the ADSBHub setup process you will need to create/login to your ADSBHub account at http://www.adsbhub.com. After logining into your account click on the \"Settings\" button then next to your \"Profile\" tab click on \"New Station\" and fill out the form." 12 78
### SETUP COMPLETE
# Return to the project root directory.
echo -e "\e[94m Returning to ${RECEIVER_PROJECT_TITLE} root directory...\e[97m"
cd ${RECEIVER_ROOT_DIRECTORY} 2>&1
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m OpenSky Network feeder client setup is complete.\e[39m"
echo -e ""
if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
read -p "Press enter to continue..." CONTINUE
fi
exit 0

Wyświetl plik

@ -0,0 +1,129 @@
#!/bin/bash
#####################################################################################
# ADS-B RECEIVER #
#####################################################################################
# #
# This script is not meant to be executed directly. #
# Instead execute install.sh to begin the installation process. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# Copyright (c) 2015-2018, Joseph A. Prochazka #
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy #
# of this software and associated documentation files (the "Software"), to deal #
# in the Software without restriction, including without limitation the rights #
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell #
# copies of the Software, and to permit persons to whom the Software is #
# furnished to do so, subject to the following conditions: #
# #
# The above copyright notice and this permission notice shall be included in all #
# copies or substantial portions of the Software. #
# #
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE #
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, #
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE #
# SOFTWARE. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
### VARIABLES
RECEIVER_ROOT_DIRECTORY="${PWD}"
RECEIVER_BASH_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/bash"
RECEIVER_BUILD_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/build"
### INCLUDE EXTERNAL SCRIPTS
source ${RECEIVER_BASH_DIRECTORY}/variables.sh
source ${RECEIVER_BASH_DIRECTORY}/functions.sh
## SET INSTALLATION VARIABLES
# Source the automated install configuration file if this is an automated installation.
if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] && [[ -s "${RECEIVER_CONFIGURATION_FILE}" ]] ; then
source ${RECEIVER_CONFIGURATION_FILE}
fi
### BEGIN SETUP
if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
clear
echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
fi
echo -e ""
echo -e "\e[92m Setting up OpenSky Network feeder client..."
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------\e[96m"
echo -e ""
# Confirm component installation.
if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
# Interactive install.
CONTINUE_SETUP=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "OpenSky Network feeder client Setup" --yesno "The OpenSky Network is a community-based receiver network which continuously collects air traffic surveillance data. Unlike other networks, OpenSky keeps the collected data forever and makes it accessible to researchers. For more information please see their website:\n\n https://opensky-network.org/\n\nContinue setup by installing the OpenSky Network feeder client?" 13 78 3>&1 1>&2 2>&3)
if [[ ${CONTINUE_SETUP} -eq 1 ]] ; then
# Setup has been halted by the user.
echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
echo -e " Setup has been halted at the request of the user."
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m OpenSky Network feeder client setup halted.\e[39m"
echo -e ""
read -p "Press enter to continue..." CONTINUE
exit 1
fi
else
# Warn that automated installation is not supported.
echo -e "\e[92m Automated installation of this script is not yet supported...\e[39m"
echo -e ""
exit 1
fi
### 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 ""
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"
CheckPacakge apt-transport-https
echo -e "\e[94m Downloading the OpenSky Network apt repository GPG key...\e[97m"
wget -O - https://opensky-network.org/files/firmware/opensky.gpg.pub | sudo apt-key add -
echo -e "\e[94m Adding the OpenSky Network apt repository...\e[97m"
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"
fi
### INSTALL THE OPENSKY NETWORK FEEDER PACKAGE USING APT
echo ""
echo -e "\e[95m Installing the OpenSky Network fedder package...\e[97m"
echo ""
echo -e "\e[94m Downloading the latest package lists for all enabled repositories and PPAs...\e[97m"
echo ""
sudo apt-get update
echo ""
echo -e "\e[94m Installing the OpenSky Network fedder package using apt...\e[97m"
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
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m OpenSky Network feeder client setup is complete.\e[39m"
echo -e ""
if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
read -p "Press enter to continue..." CONTINUE
fi
exit 0

Wyświetl plik

@ -236,7 +236,7 @@ fi
chmod +x ${RECEIVER_BASH_DIRECTORY}/main.sh
${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"
echo -e "\e[91m ANY FURTHER SETUP AND/OR INSTALLATION REQUESTS HAVE BEEN TERMINIATED\e[39m"
echo -e ""
exit 1
fi

Wyświetl plik

@ -73,6 +73,15 @@ function InstallDump1090Fa() {
fi
}
# Execute the dump1090-hptoa setup script.
function InstallDump1090Hptoa() {
chmod +x ${RECEIVER_BASH_DIRECTORY}/decoders/dump1090-hptoa.sh
${RECEIVER_BASH_DIRECTORY}/decoders/dump1090-hptoa.sh
if [[ $? -ne 0 ]] ; then
exit 1
fi
}
# Execute the dump978 setup script.
function InstallDump978() {
chmod +x ${RECEIVER_BASH_DIRECTORY}/decoders/dump978.sh
@ -102,10 +111,10 @@ function InstallAdsbExchange() {
fi
}
# Execute the PiAware setup script
function InstallPiAware() {
chmod +x ${RECEIVER_BASH_DIRECTORY}/feeders/piaware.sh
${RECEIVER_BASH_DIRECTORY}/feeders/piaware.sh
# Execute the ADSBHub setup script.
function InstallAdsbhub() {
chmod +x ${RECEIVER_BASH_DIRECTORY}/feeders/adsbhub.sh
${RECEIVER_BASH_DIRECTORY}/feeders/adsbhub.sh
if [[ $? -ne 0 ]] ; then
exit 1
fi
@ -120,6 +129,24 @@ function InstallFlightradar24() {
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
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
}
# Execute the Plane Finder Client setup script.
function InstallPlaneFinder() {
chmod +x ${RECEIVER_BASH_DIRECTORY}/feeders/planefinder.sh
@ -228,6 +255,33 @@ if [[ $(dpkg-query -W -f='${STATUS}' dump1090-fa 2>/dev/null | grep -c "ok insta
fi
fi
# Check if dump1090-hptoa is being used.
if [ -f ${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa/dump1090-hptoa/build/dump1090 ] && [ -f ${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa/dump1090-hptoa/build/faup1090 ] && [ -f ${RECEIVER_BUILD_DIRECTORY}/dump1090-hptoa/dump1090-hptoa/build/view1090 ] && [ -f /etc/init.d/dump1090 ] ; then
DUMP1090_FORK="hptoa"
DUMP1090_IS_INSTALLED="true"
# Skip over this dialog if this installation is set to be automated.
if [[ ! "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] ; then
# Ask if dump1090-hptoa should be reinstalled.
whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Dump1090-hptoa Installed" --defaultno --yesno "The dump1090-hptoa package appears to be installed on your device, however...\n\nThe dump1090-hptoa source code may have been updated recently.\n\nTo ensure you are running the latest version of dump1090-hptoa you may opt to rebuild these binaries.\n\nDownload and rebuild dump1090-hptoa from source?" 17 65
case $? in
0)
DUMP1090_DO_UPGRADE="true"
;;
1)
DUMP1090_DO_UPGRADE="false"
;;
esac
else
# Refer to the installation configuration to decide if dump1090-hptoa is to be reinstalled or not.
if [[ "${DUMP1090_UPGRADE}" = "true" ]] ; then
DUMP1090_DO_UPGRADE="true"
else
DUMP1090_DO_UPGRADE="false"
fi
fi
fi
# If no dump1090 fork is installed then attempt to install one.
if [[ ! "${DUMP1090_IS_INSTALLED}" = "true" ]] ; then
# If this is not an automated installation ask the user which one to install.
@ -235,9 +289,9 @@ if [[ ! "${DUMP1090_IS_INSTALLED}" = "true" ]] ; then
# Do not show dump 1090-fa option for Ubuntu 17.10 or higher until it is updated to support it.
if [ ! "$RECEIVER_OS_DISTRIBUTION" == "ubuntu" ] && (( $(bc -l <<<"$RECEIVER_OS_RELEASE < 17.10") )); then
DUMP1090_OPTION=$(whiptail --nocancel --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Choose Dump1090 Version To Install" --radiolist "The dump1090-mutability or dump1090-fa package does not appear to be installed on this device. In order to continue setup one of the following packages need to be installed. Please select your prefered dump1090 version from the list below.\n\nPlease note that in order to run dump1090-fa PiAware will need to be installed as well." 16 65 2 "dump1090-mutability" "(Mutability)" ON "dump1090-fa" "(FlightAware)" OFF 3>&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.\n\nPlease note that in order to run dump1090-fa PiAware will need to be installed as well." 16 65 3 "dump1090-mutability" "(Mutability)" ON "dump1090-fa" "(FlightAware)" OFF "dump1090-hptoa" "(OpenSky Network)" OFF 3>&1 1>&2 2>&3)
else
DUMP1090_OPTION=$(whiptail --nocancel --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Choose Dump1090 Version To Install" --radiolist "The dump1090-mutability or dump1090-fa package does not appear to be installed on this device. In order to continue setup one of the following packages need to be installed. Please select your prefered dump1090 version from the list below.\n\nPlease note that in order to run dump1090-fa PiAware will need to be installed as well." 16 65 2 "dump1090-mutability" "(Mutability)" ON 3>&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.\n\nPlease note that in order to run dump1090-fa PiAware will need to be installed as well." 16 65 3 "dump1090-mutability" "(Mutability)" ON "dump1090-hptoa" "(OpenSky Network)" OFF 3>&1 1>&2 2>&3)
fi
case ${DUMP1090_OPTION} in
@ -249,13 +303,17 @@ if [[ ! "${DUMP1090_IS_INSTALLED}" = "true" ]] ; then
DUMP1090_FORK="fa"
DUMP1090_DO_INSTALL="true"
;;
"dump1090-hptoa")
DUMP1090_FORK="hptoa"
DUMP1090_DO_INSTALL="true"
;;
*)
DUMP1090_DO_INSTALL="false"
;;
esac
else
# Refer to the installation configuration to check if a dump1090 fork has been specified
if [[ "${DUMP1090_FORK}" = "mutability" ]] || [[ "${DUMP1090_FORK}" = "fa" ]] ; then
if [[ "${DUMP1090_FORK}" = "mutability" ]] || [[ "${DUMP1090_FORK}" = "fa" ]] || [[ "${DUMP1090_FORK}" = "hptoa" ]] ; then
DUMP1090_DO_INSTALL="true"
else
DUMP1090_DO_INSTALL="false"
@ -416,6 +474,36 @@ else
fi
fi
# Check if the ADSBHub client script has been set up.
if ! grep -q "${BUILDDIR}/adsbexchange/adsbexchange-maint.sh &" /etc/rc.local; then
# The ADSBHub client script does not appear to be executed on start up.
if [[ ! "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] ; then
# Add this choice to the FEEDER_LIST array to be used by the whiptail menu.
FEEDER_LIST=("${FEEDER_LIST[@]}" 'ADSBHub Client Script' '' OFF)
else
# Check the installation configuration file to see if the ADSBHub client is to be installed.
if [[ -z "${ADSBHUB_INSTALL}" ]] && [[ "${ADSBHUB_INSTALL}" = "true" ]] ; then
# Since the menu will be skipped add this choice directly to the FEEDER_CHOICES file.
echo "ADSBHub Client Script" >> ${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES
fi
fi
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.
if [[ ! "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] ; then
# Add this choice to the FEEDER_LIST array to be used by the whiptail menu.
FEEDER_LIST=("${FEEDER_LIST[@]}" 'OpenSky Network Feeder' '' OFF)
else
# Check the installation configuration file to see if the OpenSky Network package is to be installed.
if [[ -z "${OPENSKY_NETWORK_INSTALL}" ]] && [[ "${OPENSKY_NETWORK_INSTALL}" = "true" ]] ; then
# Since the menu will be skipped add this choice directly to the FEEDER_CHOICES file.
echo "OpenSky Network Feeder" >> ${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES
fi
fi
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.
@ -526,7 +614,7 @@ fi
if [[ ! "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] ; then
if [[ -n "${FEEDER_LIST}" ]] ; then
# Display a checklist containing feeders that are not installed if any.
whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Feeder Installation Options" --checklist --nocancel --separate-output "The following feeders are available for installation.\nChoose the feeders you wish to install." 13 65 4 "${FEEDER_LIST[@]}" 2>${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES
whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Feeder Installation Options" --checklist --nocancel --separate-output "The following feeders are available for installation.\nChoose the feeders you wish to install." 13 65 6 "${FEEDER_LIST[@]}" 2>${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES
else
# Since all available feeders appear to be installed inform the user of the fact.
whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "All Feeders Installed" --msgbox "It appears that all the optional feeders available for installation by this script have been installed already." 8 65
@ -670,6 +758,9 @@ else
"fa")
CONFIRMATION="${CONFIRMATION}\n * dump1090-fa (upgrade)"
;;
"hptoa")
CONFIRMATION="${CONFIRMATION}\n * dump1090-hptoa (reinstall)"
;;
esac
elif [[ "${DUMP1090_DO_INSTALL}" = "true" ]] ; then
case ${DUMP1090_FORK} in
@ -679,6 +770,9 @@ else
"fa")
CONFIRMATION="${CONFIRMATION}\n * dump1090-fa"
;;
"hptoa")
CONFIRMATION="${CONFIRMATION}\n * dump1090-hptoa"
;;
esac
fi
@ -705,29 +799,35 @@ else
while read FEEDER_CHOICE
do
case ${FEEDER_CHOICE} in
"ADS-B Exchange data export and MLAT Client")
CONFIRMATION="${CONFIRMATION}\n * ADS-B Exchange data export and MLAT Client"
;;
"ADS-B Exchange data export and MLAT Client (upgrade)")
CONFIRMATION="${CONFIRMATION}\n * ADS-B Exchange data export and MLAT Client (upgrade)"
;;
"ADSBHub Client Script")
CONFIRMATION="${CONFIRMATION}\n * ADSBHub Client Script"
;;
"FlightAware PiAware")
CONFIRMATION="${CONFIRMATION}\n * FlightAware PiAware"
;;
"FlightAware PiAware (upgrade)")
CONFIRMATION="${CONFIRMATION}\n * FlightAware PiAware (upgrade)"
;;
"Plane Finder Client")
CONFIRMATION="${CONFIRMATION}\n * Plane Finder Client"
;;
"Plane Finder Client (upgrade)")
CONFIRMATION="${CONFIRMATION}\n * Plane Finder Client (upgrade)"
;;
"Flightradar24 Client")
CONFIRMATION="${CONFIRMATION}\n * Flightradar24 Client"
;;
"Flightradar24 Client (upgrade)")
CONFIRMATION="${CONFIRMATION}\n * Flightradar24 Client (upgrade)"
;;
"ADS-B Exchange data export and MLAT Client")
CONFIRMATION="${CONFIRMATION}\n * ADS-B Exchange data export and MLAT Client"
"OpenSky Network Feeder")
CONFIRMATION="${CONFIRMATION}\n * OpenSky Network Feeder"
;;
"ADS-B Exchange data export and MLAT Client (upgrade)")
CONFIRMATION="${CONFIRMATION}\n * ADS-B Exchange data export and MLAT Client (upgrade)"
"Plane Finder Client")
CONFIRMATION="${CONFIRMATION}\n * Plane Finder Client"
;;
"Plane Finder Client (upgrade)")
CONFIRMATION="${CONFIRMATION}\n * Plane Finder Client (upgrade)"
;;
esac
done < ${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES
@ -789,6 +889,9 @@ if [[ "${DUMP1090_DO_INSTALL}" = "true" ]] || [[ "${DUMP1090_DO_UPGRADE}" = "tru
"fa")
InstallDump1090Fa
;;
"hptoa")
InstallDump1090Hptoa
;;
esac
fi
@ -805,45 +908,60 @@ fi
# Moved execution of functions outside of while loop.
# Inside the while loop the installation scripts are not stopping at reads.
RUN_PIAWARE_SCRIPT="false"
RUN_PLANEFINDER_SCRIPT="false"
RUN_FLIGHTRADAR24_SCRIPT="false"
RUN_ADSBEXCHANGE_SCRIPT="false"
RUN_PIAWARE_SCRIPT="false"
RUN_FLIGHTRADAR24_SCRIPT="false"
RUN_OPENSKYNETWORK_SCRIPT="false"
RUN_PLANEFINDER_SCRIPT="false"
if [[ -s "${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES" ]] ; then
while read FEEDER_CHOICE
do
case ${FEEDER_CHOICE} in
"ADS-B Exchange data export and MLAT Client"|"ADS-B Exchange data export and MLAT Client (upgrade)")
RUN_ADSBEXCHANGE_SCRIPT="true"
;;
"ADSBHub Client Script")
RUN_ADSBHUB_SCRIPT="true"
;;
"FlightAware PiAware"|"FlightAware PiAware (upgrade)")
RUN_PIAWARE_SCRIPT="true"
;;
"Plane Finder Client"|"Plane Finder Client (upgrade)")
RUN_PLANEFINDER_SCRIPT="true"
;;
"Flightradar24 Client"|"Flightradar24 Client (upgrade)")
RUN_FLIGHTRADAR24_SCRIPT="true"
;;
"ADS-B Exchange data export and MLAT Client"|"ADS-B Exchange data export and MLAT Client (upgrade)")
RUN_ADSBEXCHANGE_SCRIPT="true"
"OpenSky Network Feeder")
RUN_OPENSKYNETWORK_SCRIPT="true"
;;
"Plane Finder Client"|"Plane Finder Client (upgrade)")
RUN_PLANEFINDER_SCRIPT="true"
;;
esac
done < ${RECEIVER_ROOT_DIRECTORY}/FEEDER_CHOICES
fi
if [[ "${RUN_ADSBEXCHANGE_SCRIPT}" = "true" ]] ; then
InstallAdsbExchange
fi
if [[ "${RUN_ADSBHUB_SCRIPT}" = "true" ]] ; then
InstallAdsbhub
fi
if [[ "${RUN_PIAWARE_SCRIPT}" = "true" ]] || [[ "${FORCE_PIAWARE_INSTALL}" = "true" ]] ; then
InstallPiAware
fi
if [[ "${RUN_PLANEFINDER_SCRIPT}" = "true" ]] ; then
InstallPlaneFinder
fi
if [[ "${RUN_FLIGHTRADAR24_SCRIPT}" = "true" ]] ; then
InstallFlightradar24
fi
if [[ "${RUN_ADSBEXCHANGE_SCRIPT}" = "true" ]] ; then
InstallAdsbExchange
if [[ "${RUN_OPENSKYNETWORK_SCRIPT}" = "true" ]] ; then
InstallOpenSkyNetwork
fi
if [[ "${RUN_PLANEFINDER_SCRIPT}" = "true" ]] ; then
InstallPlaneFinder
fi
## ADS-B Receiver Project Web Portal

Wyświetl plik

@ -517,6 +517,12 @@ if [ "${DATABASEENGINE}" = "MySQL" ]; then
export ADSB_DATABASENAME=${DATABASENAME}
elif [ "${DATABASEENGINE}" = "SQLite" ]; then
if [ -z "${DATABASENAME}" ] ; then
if [ ! -f ${LIGHTTPD_DOCUMENT_ROOT}/data/portal.sqlite ]; then
echo -e "\e[94m Creating an empty SQLite database file...\e[97m"
sudo touch ${LIGHTTPD_DOCUMENT_ROOT}/data/portal.sqlite
echo -e "\e[94m Setting write permissions on the empty SQLite database file...\e[97m"
sudo chmod 666 ${LIGHTTPD_DOCUMENT_ROOT}/data/portal.sqlite
fi
DATABASENAME="${LIGHTTPD_DOCUMENT_ROOT}/data/portal.sqlite"
fi
export ADSB_DATABASEENGINE=${DATABASEENGINE}

Wyświetl plik

@ -11,7 +11,7 @@
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# Copyright (c) 2015-2016 Joseph A. Prochazka #
# 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 #
@ -41,6 +41,7 @@ BACKUPSDIRECTORY="${RECEIVER_ROOT_DIRECTORY}/backups"
TEMPORARY_DIRECTORY="${RECEIVER_ROOT_DIRECTORY}/backup_${BACKUPDATE}"
RAWDOCUMENTROOT=`/usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf -p | grep server.document-root`
LIGHTTPDDOCUMENTROOT=`sed 's/.*"\(.*\)"[^"]*$/\1/' <<< ${RAWDOCUMENTROOT}`
COLLECTD_RRD_DIRECTORY="/var/lib/collectd/rrd"
## BEGIN THE BACKUP PROCESS
@ -97,15 +98,24 @@ if [[ ! -d "${TEMPORARY_DIRECTORY}" ]] ; then
mkdir -vp ${TEMPORARY_DIRECTORY}
fi
## BACKUP THE FILES COMMON TO ALL PORTAL INSTALLATION SCENARIOS
## BACKUP THE COLLECTD RRD FILES BY EXPORTING THEM TO XML.
# Copy the collectd round robin database files to the temporary directory.
echo -e "\e[94m Checking that the directory ${TEMPORARY_DIRECTORY}/var/lib/collectd/rrd/ exists...\e[97m"
if [[ ! -d "${TEMPORARY_DIRECTORY}/var/lib/collectd/rrd/" ]] ; then
mkdir -vp ${TEMPORARY_DIRECTORY}/var/lib/collectd/rrd/
# 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"
echo -e "\e[94m Skipping RRD file backups...\e[97m"
else
for RRD_FILE in `find ${COLLECTD_RRD_DIRECTORY} -name '*.rrd'`; do
echo -e "\e[94m Exporting RRD files named $RRD_FILE to XML...\e[97m"
RRD_FILE_NAME=`basename -s .rrd $RRD_FILE`
RRD_FILE_DIRECTORY=`dirname $RRD_FILE`
if [ ! -d ${TEMPORARY_DIRECTORY}/${RRD_FILE_DIRECTORY} ]; then
mkdir ${TEMPORARY_DIRECTORY}/${RRD_FILE_DIRECTORY}
fi
sudo rrdtool dump $RRD_FILE > ${TEMPORARY_DIRECTORY}/${RRD_FILE_DIRECTORY}/${RRD_FILE_NAME}.xml
done
fi
echo -e "\e[94m Backing up the directory /var/lib/collectd/rrd/...\e[97m"
sudo cp -R /var/lib/collectd/rrd/ ${TEMPORARY_DIRECTORY}/var/lib/collectd/rrd/
## BACKUP PORTAL USING LITE FEATURES AND XML FILES

Wyświetl plik

@ -37,7 +37,7 @@
// Check if the portal is installed or needs upgraded.
$thisVersion = "2.6.3";
$thisVersion = "2.7.0";
if (!file_exists($_SERVER['DOCUMENT_ROOT']."/classes/settings.class.php")) {
header ("Location: /install/install.php");

Wyświetl plik

@ -29,7 +29,7 @@
/////////////////////////////////////////////////////////////////////////////////////
// The most current stable release.
$thisVersion = "2.6.3";
$thisVersion = "2.7.0";
// 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")) {

Wyświetl plik

@ -34,6 +34,7 @@
// ------------------------------------------------------------------------------------------
// Updates the version setting to 2.6.3.
// Added setting to toggle navbar and footer hiding.
// ------------------------------------------------------------------------------------------
$results = upgrade();

Wyświetl plik

@ -0,0 +1,72 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// 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. //
/////////////////////////////////////////////////////////////////////////////////////
///////////////////////
// UPGRADE TO V2.7.0
///////////////////////
// ------------------------------------------------------------------------------------------
// Updates the version setting to 2.7.0.
// Added options to set the default latitude and longitude for the advanced features map.
// ------------------------------------------------------------------------------------------
$results = upgrade();
exit(json_encode($results));
function upgrade() {
require_once($_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR."classes".DIRECTORY_SEPARATOR."common.class.php");
require_once($_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR."classes".DIRECTORY_SEPARATOR."settings.class.php");
$common = new common();
$settings = new settings();
try {
// Add portal navigation and footer autohide option.
$common->addSetting("advancedMapCenterLatitude", "41.3683798");
$common->addSetting("advancedMapCenterLongitude", "-82.1076486");
// Update the version and patch settings..
$common->updateSetting("version", "2.7.0");
$common->updateSetting("patch", "");
// The upgrade process completed successfully.
$results['success'] = TRUE;
$results['message'] = "Upgrade to v2.7.0 successful.";
return $results;
} catch(Exception $e) {
// Something went wrong during this upgrade process.
$results['success'] = FALSE;
$results['message'] = $e->getMessage();
return $results;
}
}
?>

Wyświetl plik

@ -33,7 +33,7 @@
$common = new common();
// The most current stable release.
$thisVersion = "2.6.2";
$thisVersion = "2.7.0";
// Begin the upgrade process if this release is newer than what is installed.
if ($common->getSetting("version") == $thisVersion) {
@ -150,6 +150,15 @@
$version = "2.6.3";
}
// UPGRADE TO V2.7.0
if ($common->getSetting("version") == "2.6.3" && $success) {
$json = file_get_contents("http://localhost/install/upgrade-v2.7.0.php");
$results = json_decode($json, TRUE);
$success = $results['success'];
$message = $results['message'];
$version = "2.7.0";
}
require_once($_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR."admin".DIRECTORY_SEPARATOR."includes".DIRECTORY_SEPARATOR."header.inc.php");
// Display the instalation wizard.

Wyświetl plik

@ -164,7 +164,7 @@
function initMap() {
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 7,
center: {lat: 41.379857, lng: -82.082877},
center: {lat: {setting:advancedMapCenterLatitude}, lng: {setting:advancedMapCenterLongitude}},
mapTypeId: google.maps.MapTypeId.TERRAIN
});

Wyświetl plik

@ -167,6 +167,12 @@ DUMP978_DEVICE_ID="1"
ADSBEXCHANGE_INSTALL="false"
ADSBEXCHANGE_UPGRADE="false"
# ---------------------------------------------------------------------------------
# ADSBHub
# ---------------------------------------------------------------------------------
ADSBHUB_INSTALL="false"
# The receiver name should be a unique name specific to this receiver which you can
# use to identify your receiver on the ADS-B Exchange MLAT status pages. This
# variable is required in order to setup the MLAT client to feed ADS-B Exchange
@ -185,6 +191,16 @@ ADSBEXCHANGE_RECEIVER_USERNAME="I_DID_NOT_READ_THE_COMMENTS"
FLIGHTRADAR24_INSTALL="false"
# ---------------------------------------------------------------------------------
# OPENSKY NETWORK FEEDER CLIENT
# ---------------------------------------------------------------------------------
#
# Installation includes the addition of the OpenSky Network apt repository to your
# device. After the repository has been added apt will be used to install and keep
# the client up to date.
OPENSKY_NETWORK_INSTALL="false"
# ---------------------------------------------------------------------------------
# PIAWARE
# ---------------------------------------------------------------------------------