2016-02-12 13:36:46 +00:00
#!/bin/bash
2024-07-22 03:30:05 +00:00
## PRE INSTALLATION OPERATIONS
2024-06-30 03:49:36 +00:00
source $RECEIVER_BASH_DIRECTORY /variables.sh
source $RECEIVER_BASH_DIRECTORY /functions.sh
2024-06-19 00:12:48 +00:00
clear
2024-07-22 03:30:05 +00:00
LogProjectName ${ RECEIVER_PROJECT_TITLE }
LogTitleHeading "Setting up the FlightRadar24 client"
LogTitleMessage "------------------------------------------------------------------------------"
echo ""
if ! whiptail --backtitle " ${ RECEIVER_PROJECT_TITLE } " \
--title "FlightRadar24 feeder client Setup" \
--yesno "The FlightRadar24 feeder client takes data from a local dump1090 instance and shares this with FlightRadar24 using the fr24feed package, for more information please see their website:\n\n https://www.flightradar24.com/share-your-data\n\nContinue setup by installing the FlightRadar24 feeder client?" \
13 78; then
LogAlertHeading "INSTALLATION HALTED"
LogAlertMessage "Setup has been halted at the request of the user"
echo ""
LogTitleMessage "------------------------------------------------------------------------------"
LogTitleHeading "FlightRadar24 client setup halted"
echo ""
2016-09-06 20:19:14 +00:00
exit 1
fi
2016-02-12 13:36:46 +00:00
2024-06-30 03:49:36 +00:00
2024-07-22 03:30:05 +00:00
## DOWNLOAD AND EXECUTE THE FLIGHTRADAR24 CLIENT INSTALL SCRIPT
2017-10-02 19:36:29 +00:00
2024-07-22 03:30:05 +00:00
LogHeading "Begining the FlightRadar24 client installation process"
2017-10-02 19:36:29 +00:00
2024-06-30 03:49:36 +00:00
if [ [ ! -d $RECEIVER_BUILD_DIRECTORY /flightradar24 ] ] ; then
2024-07-22 03:30:05 +00:00
LogMessage "Creating the FlightRadar24 build directory"
2017-10-03 00:40:46 +00:00
echo ""
2024-06-30 03:49:36 +00:00
mkdir -vp $RECEIVER_BUILD_DIRECTORY /flightradar24
2017-10-03 00:40:46 +00:00
echo ""
2017-10-02 19:36:29 +00:00
fi
2024-07-22 03:30:05 +00:00
LogMessage "Entering the FlightRadar24 build directory"
cd $RECEIVER_BUILD_DIRECTORY /flightradar24
2017-10-02 19:36:29 +00:00
2024-07-22 03:30:05 +00:00
LogMessage "Downloading the airplanes.live client installation script"
2024-06-19 00:12:48 +00:00
echo ""
2024-07-22 03:30:05 +00:00
wget -v -O $RECEIVER_BUILD_DIRECTORY /flightradar24/install.sh https://fr24.com/install.sh
2024-06-19 00:12:48 +00:00
echo ""
2017-10-02 19:36:29 +00:00
2024-07-22 03:30:05 +00:00
LogMessage "Executing the airplanes.live client installation script"
2024-06-19 00:12:48 +00:00
echo ""
2024-06-30 03:49:36 +00:00
sudo bash $RECEIVER_BUILD_DIRECTORY /flightradar24/install.sh
2024-06-19 00:12:48 +00:00
echo ""
2017-10-02 19:36:29 +00:00
2024-06-19 00:12:48 +00:00
2024-07-22 03:30:05 +00:00
## CHECK THE STATUS OF THE CLIENT
LogHeading "Checking if the FlightRadar24 client was installed successfully"
echo -e "\e[94m Checking that the FlightRadar24 client package was installed"
2024-06-30 03:49:36 +00:00
if [ [ $( dpkg-query -W -f= '${STATUS}' fr24feed 2>/dev/null | grep -c "ok installed" ) -eq 0 ] ] ; then
2024-07-22 03:30:05 +00:00
echo ""
LogAlertHeading "INSTALLATION HALTED"
echo ""
LogAlertMessage "FlightRadar24 package installation failed"
LogAlertMessage "Setup has been terminated"
echo ""
LogTitleMessage "------------------------------------------------------------------------------"
LogTitleHeading "FlightRadar24 client setup failed"
echo ""
read -p "Press enter to continue..." discard
2024-06-19 00:12:48 +00:00
exit 1
fi
2017-10-02 19:36:29 +00:00
2024-06-30 03:49:36 +00:00
2024-07-22 03:30:05 +00:00
## POST INSTALLATION OPERATIONS
LogHeading "Performing post installation operations"
2017-10-02 19:36:29 +00:00
2024-07-22 03:30:05 +00:00
LogMessage "Flightradar24 asks that MLAT be disabled if sharing with other networks"
2024-06-19 00:12:48 +00:00
ChangeConfig "mlat" "no" "/etc/fr24feed.ini"
ChangeConfig "mlat-without-gps" "no" "/etc/fr24feed.ini"
2024-07-22 03:30:05 +00:00
LogMessage "Restarting the Flightradar24 client"
2024-06-19 00:12:48 +00:00
sudo systemctl restart fr24feed
2016-02-12 13:36:46 +00:00
2024-07-22 03:30:05 +00:00
LogWarningMessage "If the Flightradar24 client is the only feeder utilizing MLAT execute the following commands to enable MLAT"
LogWarningMessage 'sudo sed -i -e "s/\(mlat *= *\).*/\1\"yes\"/" /etc/fr24feed.ini'
LogWarningMessage 'sudo sed -i -e "s/\(mlat-without-gps *= *\).*/\1\"yes\"/" /etc/fr24feed.ini'
2016-02-12 13:36:46 +00:00
2024-06-30 03:49:36 +00:00
## SETUP COMPLETE
2024-07-22 03:30:05 +00:00
LogMessage " Returning to ${ RECEIVER_PROJECT_TITLE } root directory "
cd $RECEIVER_ROOT_DIRECTORY
2016-02-12 13:36:46 +00:00
2024-07-22 03:30:05 +00:00
echo ""
LogTitleMessage "------------------------------------------------------------------------------"
LogTitleHeading "FlightRadar24 client setup is complete"
echo ""
2024-06-30 03:49:36 +00:00
read -p "Press enter to continue..." discard
2016-09-06 20:19:14 +00:00
exit 0