2016-09-27 01:28:04 +00:00
#!/bin/bash
## INCLUDE EXTERNAL SCRIPTS
2017-10-02 19:36:29 +00:00
source ${ RECEIVER_BASH_DIRECTORY } /variables.sh
source ${ RECEIVER_BASH_DIRECTORY } /functions.sh
2016-09-27 01:28:04 +00:00
2024-08-02 20:11:23 +00:00
## ADS-B DECODERS
2024-07-23 18:45:59 +00:00
2024-08-15 19:58:45 +00:00
adsb_decoder_installed = "false"
2024-08-02 20:11:23 +00:00
install_adsb_decoder = "false"
2024-08-15 19:58:45 +00:00
2024-08-22 16:17:15 +00:00
if [ [ $( dpkg-query -W -f= '${STATUS}' dump1090-fa 2>/dev/null | grep -c "ok installed" ) = = 1 ] ] ; then
2024-08-15 19:58:45 +00:00
adsb_decoder_installed = "true"
2024-08-02 20:11:23 +00:00
chosen_adsb_decoder = "dump1090-fa"
2024-08-22 16:17:15 +00:00
if [ [ $( sudo dpkg -s dump1090-fa 2>/dev/null | grep -c " Version: ${ dump1090_fa_current_version } " ) = = 0 ] ] ; then
2024-07-23 18:45:59 +00:00
whiptail --backtitle " ${ RECEIVER_PROJECT_TITLE } " \
--title "FlightAware Dump1090 Upgrade Available" \
--defaultno \
--yesno "An updated version of FlightAware dump1090 is available.\n\nWould you like to install the new version?" \
16 65
if [ [ $? = = 0 ] ] ; then
2024-08-02 20:11:23 +00:00
install_adsb_decoder = "true"
2024-07-23 18:45:59 +00:00
fi
2024-08-05 20:58:58 +00:00
else
whiptail --backtitle " ${ RECEIVER_PROJECT_TITLE } " \
--title "Reinstall FlightAware dump1090" \
--defaultno --yesno "The option to rebuild and reinstall FlightAware dump1090 is available.\n\nWould you like to rebuild and reinstall FlightAware dump1090?" \
9 65
if [ [ $? = = 0 ] ] ; then
install_adsb_decoder = "true"
fi
2016-09-27 01:28:04 +00:00
fi
2024-08-15 19:58:45 +00:00
fi
2024-08-22 16:17:15 +00:00
if [ [ $( dpkg-query -W -f= '${STATUS}' readsb 2>/dev/null | grep -c "ok installed" ) = = 1 ] ] ; then
adsb_decoder_installed = "true"
chosen_adsb_decoder = "readsb"
whiptail --backtitle " ${ RECEIVER_PROJECT_TITLE } " \
--title "Reinstall Readsb Decoder" \
--defaultno \
--yesno "The option to rebuild and reinstall Readsb is available.\n\nWould you like to rebuild and reinstall Readsb?" \
9 65
if [ [ $? = = 0 ] ] ; then
install_adsb_decoder = "true"
fi
fi
2024-08-15 19:58:45 +00:00
if [ [ " ${ adsb_decoder_installed } " = = "false" ] ] ; then
2024-08-22 17:48:01 +00:00
install_adsb_decoder = "true"
2024-08-15 19:58:45 +00:00
chosen_adsb_decoder = $( whiptail --backtitle " ${ RECEIVER_PROJECT_TITLE } " \
--title "ADS-B Decoder Selection" \
--menu "The following ADS-B decoders are available for installation." \
16 100 9 \
"None" "Do not install an ADS-B decoder." \
"dump1090-fa" "FlightAware's version of the dump1090 decoder." \
2024-08-22 16:17:15 +00:00
"readsb" "Wiedehopf's detached fork of readsb." \
2024-08-15 19:58:45 +00:00
3>& 2 2>& 1 1>& 3)
exit_status = $?
if [ [ $exit_status != 0 || " ${ chosen_uat_decoder } " = = "None" ] ] ; then
2024-08-22 17:48:01 +00:00
install_adsb_decoder = "false"
2017-10-02 19:36:29 +00:00
fi
2024-07-23 18:45:59 +00:00
fi
2016-09-27 01:28:04 +00:00
2024-08-02 20:11:23 +00:00
function install_dump1090_fa( ) {
2024-08-05 20:03:31 +00:00
chmod +x ${ RECEIVER_BASH_DIRECTORY } /decoders/dump1090-fa.sh
2024-07-23 18:45:59 +00:00
${ RECEIVER_BASH_DIRECTORY } /decoders/dump1090-fa.sh
if [ [ $? != 0 ] ] ; then
2016-09-27 01:28:04 +00:00
exit 1
fi
}
2024-08-22 16:17:15 +00:00
function install_readsb( ) {
chmod +x ${ RECEIVER_BASH_DIRECTORY } /decoders/readsb.sh
${ RECEIVER_BASH_DIRECTORY } /decoders/readsb.sh
if [ [ $? != 0 ] ] ; then
exit 1
fi
}
2024-07-13 19:32:48 +00:00
2024-08-02 20:11:23 +00:00
## UAT DECODERS
2024-07-23 18:45:59 +00:00
2024-08-15 19:58:45 +00:00
uat_decoder_installed = "false"
2024-08-02 20:11:23 +00:00
install_uat_decoder = "false"
2024-08-15 19:58:45 +00:00
2024-07-23 18:45:59 +00:00
if [ [ $( dpkg-query -W -f= '${STATUS}' dump978-fa 2>/dev/null | grep -c "ok installed" ) = = 1 ] ] ; then
2024-08-15 19:58:45 +00:00
uat_decoder_installed = "true"
2024-08-02 20:11:23 +00:00
chosen_uat_decoder = "dump978-fa"
2024-07-24 00:38:11 +00:00
if [ [ $( sudo dpkg -s dump978-fa 2>/dev/null | grep -c " Version: ${ dump978_fa_current_version } " ) = = 0 ] ] ; then
2024-08-05 20:58:58 +00:00
whiptail --backtitle " ${ RECEIVER_PROJECT_TITLE } " \
--title "FlightAware dump978 Upgrade Available" \
--defaultno --yesno "An updated version of FlightAware dump978 is available.\n\nWould you like to install the new version?" \
16 65
if [ [ $? = = 0 ] ] ; then
install_uat_decoder = "true"
fi
else
whiptail --backtitle " ${ RECEIVER_PROJECT_TITLE } " \
--title "Reinstall FlightAware dump978" \
--defaultno --yesno "The option to rebuild and reinstall FlightAware dump978 is available.\n\nWould you like to rebuild and reinstall FlightAware dump978?" \
9 65
2024-07-23 18:45:59 +00:00
if [ [ $? = = 0 ] ] ; then
2024-08-02 20:11:23 +00:00
install_uat_decoder = "true"
2024-07-23 18:45:59 +00:00
fi
2016-09-27 01:28:04 +00:00
fi
2024-08-15 19:58:45 +00:00
fi
if [ [ " ${ uat_decoder_installed } " = = "false" ] ] ; then
2024-08-22 17:48:01 +00:00
install_uat_decoder = "true"
2024-08-15 19:58:45 +00:00
chosen_uat_decoder = $( whiptail --backtitle " ${ RECEIVER_PROJECT_TITLE } " \
--title "UAT Decoder Selection" \
--menu "The following UAT decoders are available for installation." \
16 100 9 \
"None" "Do not install a UAT decoder." \
"dump978-fa" "FlightAware's version of the dump978 decoder." \
3>& 2 2>& 1 1>& 3)
exit_status = $?
if [ [ $exit_status != 0 || " ${ chosen_uat_decoder } " = = "None" ] ] ; then
install_uat_decoder = "false"
2024-07-07 19:36:38 +00:00
fi
2024-07-23 18:45:59 +00:00
fi
2024-07-07 19:36:38 +00:00
2024-08-02 20:11:23 +00:00
function install_dump978_fa( ) {
2024-08-05 20:03:31 +00:00
chmod +x ${ RECEIVER_BASH_DIRECTORY } /decoders/dump978-fa.sh
2024-07-23 18:45:59 +00:00
${ RECEIVER_BASH_DIRECTORY } /decoders/dump978-fa.sh
if [ [ $? != 0 ] ] ; then
2018-06-26 13:06:46 +00:00
exit 1
fi
}
2024-08-15 19:58:45 +00:00
2024-08-02 20:11:23 +00:00
## ACARS DECODERS
2024-08-15 19:58:45 +00:00
acars_decoder_installed = "false"
2024-08-02 20:11:23 +00:00
install_acars_decoder = "false"
2024-08-15 19:58:45 +00:00
2024-08-02 20:11:23 +00:00
if [ [ -f /etc/systemd/system/acarsdec.service ] ] ; then
2024-08-15 19:58:45 +00:00
acars_decoder_installed = "true"
2024-08-02 20:11:23 +00:00
chosen_acars_decoder = "acarsdec"
whiptail --backtitle " ${ RECEIVER_PROJECT_TITLE } " \
--title "Reinstall ACARSDEC Decoder" \
2024-08-06 18:50:24 +00:00
--defaultno \
--yesno "The option to rebuild and reinstall ACARSDEC is available.\n\nWould you like to rebuild and reinstall ACARSDEC?" \
2024-08-05 20:03:31 +00:00
9 65
2024-08-02 20:11:23 +00:00
if [ [ $? = = 0 ] ] ; then
install_acars_decoder = "true"
fi
2024-08-15 19:58:45 +00:00
fi
if [ [ " ${ acars_decoder_installed } " = = "false" ] ] ; then
2024-08-22 17:48:01 +00:00
install_acars_decoder = "true"
2024-08-15 19:58:45 +00:00
chosen_acars_decoder = $( whiptail --backtitle " ${ RECEIVER_PROJECT_TITLE } " \
--title "ACARS Decoder Selection" \
--menu "The following ACARS decoders are available for installation." \
16 100 9 \
"None" "Do not install an ACARS decoder." \
"acarsdec" "Acarsdec is a multi-channels acars decoder." \
3>& 2 2>& 1 1>& 3)
exit_status = $?
if [ [ $exit_status != 0 || " ${ chosen_acars_decoder } " = = "None" ] ] ; then
install_acars_decoder = "false"
2024-08-02 20:11:23 +00:00
fi
fi
function install_acarsdec( ) {
2024-08-05 20:03:31 +00:00
chmod +x ${ RECEIVER_BASH_DIRECTORY } /decoders/acarsdec.sh
2024-08-02 20:11:23 +00:00
${ RECEIVER_BASH_DIRECTORY } /decoders/acarsdec.sh
if [ [ $? != 0 ] ] ; then
exit 1
fi
}
2024-07-24 00:38:11 +00:00
2024-08-15 19:58:45 +00:00
## VDL MODE 2 DECODERS
2024-08-14 19:19:39 +00:00
2024-08-15 19:58:45 +00:00
vdlm2_decoder_installed = "false"
install_vdlm2_decoder = "false"
2024-08-14 19:19:39 +00:00
if [ [ -f /etc/systemd/system/dumpvdl2.service ] ] ; then
2024-08-15 19:58:45 +00:00
vdlm2_decoder_installed = "true"
chosen_vdlm2_decoder = "dumpvdl2"
2024-08-14 19:19:39 +00:00
whiptail --backtitle " ${ RECEIVER_PROJECT_TITLE } " \
--title "Reinstall dumpvdl2 Decoder" \
--defaultno \
--yesno "The option to rebuild and reinstall dumpvdl2 is available.\n\nWould you like to rebuild and reinstall dumpvdl2?" \
9 65
if [ [ $? = = 0 ] ] ; then
2024-08-15 19:58:45 +00:00
install_vdlm2_decoder = "true"
2024-08-14 19:19:39 +00:00
fi
2024-08-15 19:58:45 +00:00
fi
if [ [ -f /etc/systemd/system/vdlm2dec.service ] ] ; then
vdlm2_decoder_installed = "true"
chosen_vdlm2_decoder = "vdlm2dec"
2024-08-14 19:19:39 +00:00
whiptail --backtitle " ${ RECEIVER_PROJECT_TITLE } " \
2024-08-15 19:58:45 +00:00
--title "Reinstall VDLM2DEC Decoder" \
2024-08-14 19:19:39 +00:00
--defaultno \
2024-08-15 19:58:45 +00:00
--yesno "The option to rebuild and reinstall VDLM2DEC is available.\n\nWould you like to rebuild and reinstall VDLM2DEC?" \
9 65
2024-08-14 19:19:39 +00:00
if [ [ $? = = 0 ] ] ; then
2024-08-15 19:58:45 +00:00
install_vdlm2_decoder = "true"
fi
fi
if [ [ " ${ vdlm2_decoder_installed } " = = "false" ] ] ; then
2024-08-22 17:48:01 +00:00
install_vdlm2_decoder = "true"
2024-08-15 19:58:45 +00:00
chosen_vdlm2_decoder = $( whiptail --backtitle " ${ RECEIVER_PROJECT_TITLE } " \
--title "VLD Mode 2 Decoder Selection" \
--menu "The following VLD Mode 2 decoders are available for installation." \
16 100 9 \
"None" "Do not install a VLD decoder." \
"vdlm2dec" "vdlm2dec is a VDL Mode 2 decoder." \
"dumpvdl2" "dumpvdl2 is a VDL Mode 2 message decoder." \
3>& 2 2>& 1 1>& 3)
exit_status = $?
if [ [ $exit_status != 0 || " ${ chosen_vdlm2_decoder } " = = "None" ] ] ; then
install_vdlm2_decoder = "false"
2024-08-14 19:19:39 +00:00
fi
fi
function install_dumpvdl2( ) {
chmod +x ${ RECEIVER_BASH_DIRECTORY } /decoders/dumpvdl2.sh
${ RECEIVER_BASH_DIRECTORY } /decoders/dumpvdl2.sh
if [ [ $? != 0 ] ] ; then
exit 1
fi
}
2024-08-15 19:58:45 +00:00
function install_vdlm2dec( ) {
chmod +x ${ RECEIVER_BASH_DIRECTORY } /decoders/vdlm2dec.sh
${ RECEIVER_BASH_DIRECTORY } /decoders/vdlm2dec.sh
if [ [ $? != 0 ] ] ; then
exit 1
fi
}
2024-08-14 19:19:39 +00:00
2024-07-23 18:45:59 +00:00
## AGGREGATE SITE CLIENTS
2016-09-27 01:28:04 +00:00
2024-07-23 18:45:59 +00:00
declare array feeder_list
touch ${ RECEIVER_ROOT_DIRECTORY } /FEEDER_CHOICES
# ADS-B Exchange
if [ [ -f /lib/systemd/system/adsbexchange-mlat.service && -f /lib/systemd/system/adsbexchange-feed.service ] ] ; then
echo "ADS-B Exchange Feed Client (reinstall)" >> ${ RECEIVER_ROOT_DIRECTORY } /FEEDER_CHOICES
2024-07-24 00:38:11 +00:00
feeder_list = ( " ${ feeder_list [@] } " 'ADS-B Exchange Feed Client (reinstall/update)' '' OFF)
2024-07-23 18:45:59 +00:00
else
echo "ADS-B Exchange Feed Client" >> ${ RECEIVER_ROOT_DIRECTORY } /FEEDER_CHOICES
feeder_list = ( " ${ feeder_list [@] } " 'ADS-B Exchange Feed Client' '' OFF)
fi
function install_adsbexchange_client( ) {
2024-08-05 20:03:31 +00:00
chmod +x ${ RECEIVER_BASH_DIRECTORY } /feeders/adsbexchange.sh
2024-07-23 18:45:59 +00:00
${ RECEIVER_BASH_DIRECTORY } /feeders/adsbexchange.sh
if [ [ $? != 0 ] ] ; then
2016-09-27 01:28:04 +00:00
exit 1
fi
}
2024-07-23 18:45:59 +00:00
# Airplanes.live
if [ [ -f /lib/systemd/system/airplanes-feed.service && -f /lib/systemd/system/airplanes-mlat.service ] ] ; then
echo "Airplanes.live Feeder (reinstall)" >> ${ RECEIVER_ROOT_DIRECTORY } /FEEDER_CHOICES
feeder_list = ( " ${ feeder_list [@] } " 'Airplanes.live Feeder (reinstall)' '' OFF)
else
echo "Airplanes.live Feeder" >> ${ RECEIVER_ROOT_DIRECTORY } /FEEDER_CHOICES
feeder_list = ( " ${ feeder_list [@] } " 'Airplanes.live Feeder' '' OFF)
fi
2016-09-27 01:28:04 +00:00
2024-07-23 18:45:59 +00:00
function install_airplaneslive_client( ) {
2024-08-05 20:03:31 +00:00
chmod +x ${ RECEIVER_BASH_DIRECTORY } /feeders/airplaneslive.sh
2024-07-23 18:45:59 +00:00
${ RECEIVER_BASH_DIRECTORY } /feeders/airplaneslive.sh
if [ [ $? != 0 ] ] ; then
2017-10-02 19:36:29 +00:00
exit 1
fi
}
2024-07-23 18:45:59 +00:00
# FlightAware PiAware
if [ [ $( dpkg-query -W -f= '${STATUS}' piaware 2>/dev/null | grep -c "ok installed" ) = = 0 ] ] ; then
feeder_list = ( " ${ feeder_list [@] } " 'FlightAware PiAware' '' OFF)
else
if [ [ $( sudo dpkg -s piaware 2>/dev/null | grep -c " Version: ${ piaware_current_version } " ) = = 0 ] ] ; then
feeder_list = ( " ${ feeder_list [@] } " 'FlightAware PiAware (upgrade)' '' OFF)
else
feeder_list = ( " ${ feeder_list [@] } " 'FlightAware PiAware (reinstall)' '' OFF)
2017-10-02 19:36:29 +00:00
fi
2024-07-23 18:45:59 +00:00
fi
2017-10-02 19:36:29 +00:00
2024-07-23 18:45:59 +00:00
function install_flightaware_client( ) {
2024-08-05 20:03:31 +00:00
chmod +x ${ RECEIVER_BASH_DIRECTORY } /feeders/piaware.sh
2024-07-23 18:45:59 +00:00
${ RECEIVER_BASH_DIRECTORY } /feeders/piaware.sh
if [ [ $? != 0 ] ] ; then
2016-09-27 01:28:04 +00:00
exit 1
fi
}
2024-07-23 18:45:59 +00:00
# Flightradar24
if [ [ $( dpkg-query -W -f= '${STATUS}' fr24feed 2>/dev/null | grep -c "ok installed" ) = = 0 ] ] ; then
feeder_list = ( " ${ feeder_list [@] } " 'Flightradar24 Client' '' OFF)
else
if [ [ $( sudo dpkg -s fr24feed 2>/dev/null | grep -c " Version: ${ fr24feed_current_version } " ) = = 0 ] ] ; then
feeder_list = ( " ${ feeder_list [@] } " 'Flightradar24 Client (upgrade)' '' OFF)
else
feeder_list = ( " ${ feeder_list [@] } " 'Flightradar24 Client (reinstall)' '' OFF)
2016-09-27 01:28:04 +00:00
fi
fi
2024-07-23 18:45:59 +00:00
function install_flightradar24_client( ) {
2024-08-05 20:03:31 +00:00
chmod +x ${ RECEIVER_BASH_DIRECTORY } /feeders/flightradar24.sh
2024-07-23 18:45:59 +00:00
${ RECEIVER_BASH_DIRECTORY } /feeders/flightradar24.sh
if [ [ $? != 0 ] ] ; then
exit 1
2024-06-20 17:03:21 +00:00
fi
2024-07-23 18:45:59 +00:00
}
2024-07-13 19:32:48 +00:00
2024-07-23 18:45:59 +00:00
# Fly Italy ADS-B
2024-07-07 19:36:38 +00:00
if [ [ -f /lib/systemd/system/flyitalyadsb-mlat.service && -f /lib/systemd/system/flyitalyadsb-feed.service ] ] ; then
echo "Fly Italy ADS-B Feeder (upgrade)" >> ${ RECEIVER_ROOT_DIRECTORY } /FEEDER_CHOICES
2024-07-24 00:38:11 +00:00
feeder_list = ( " ${ feeder_list [@] } " 'Fly Italy ADS-B Feeder (reinstall)' '' OFF)
2024-07-07 19:36:38 +00:00
else
echo "Fly Italy ADS-B Feeder" >> ${ RECEIVER_ROOT_DIRECTORY } /FEEDER_CHOICES
2024-07-23 18:45:59 +00:00
feeder_list = ( " ${ feeder_list [@] } " 'Fly Italy ADS-B Feeder' '' OFF)
2024-07-07 19:36:38 +00:00
fi
2024-07-23 18:45:59 +00:00
function install_flyitalyadsb_client( ) {
2024-08-05 20:03:31 +00:00
chmod +x ${ RECEIVER_BASH_DIRECTORY } /feeders/flyitalyadsb.sh
2024-07-23 18:45:59 +00:00
${ RECEIVER_BASH_DIRECTORY } /feeders/flyitalyadsb.sh
if [ [ $? != 0 ] ] ; then
exit 1
2024-06-20 17:51:02 +00:00
fi
2024-07-23 18:45:59 +00:00
}
2018-06-26 13:06:46 +00:00
2024-07-23 18:45:59 +00:00
# OpenSky Network
if [ [ $( dpkg-query -W -f= '${STATUS}' opensky-feeder 2>/dev/null | grep -c "ok installed" ) = = 0 ] ] ; then
feeder_list = ( " ${ feeder_list [@] } " 'OpenSky Network Feeder' '' OFF)
2016-09-27 01:28:04 +00:00
else
2024-07-24 00:38:11 +00:00
if [ [ $( sudo dpkg -s opensky-feeder 2>/dev/null | grep -c " Version: ${ opensky_feeder_current_version } " ) = = 0 ] ] ; then
2024-07-23 18:45:59 +00:00
feeder_list = ( " ${ feeder_list [@] } " 'OpenSky Network Feeder (reinstall)' '' OFF)
2016-09-27 01:28:04 +00:00
fi
fi
2024-07-23 18:45:59 +00:00
function install_openskynetwork_client( ) {
2024-08-05 20:03:31 +00:00
chmod +x ${ RECEIVER_BASH_DIRECTORY } /feeders/openskynetwork.sh
2024-07-23 18:45:59 +00:00
${ RECEIVER_BASH_DIRECTORY } /feeders/openskynetwork.sh
if [ [ $? != 0 ] ] ; then
exit 1
2016-09-27 01:28:04 +00:00
fi
2024-07-23 18:45:59 +00:00
}
2016-09-27 01:28:04 +00:00
2024-07-23 18:45:59 +00:00
# Planefinder
if [ [ $( dpkg-query -W -f= '${STATUS}' pfclient 2>/dev/null | grep -c "ok installed" ) = = 0 ] ] ; then
feeder_list = ( " ${ feeder_list [@] } " 'Plane Finder Client' '' OFF)
2016-09-27 01:28:04 +00:00
else
2024-07-23 18:45:59 +00:00
pfclient_installed_version = $( sudo dpkg -s pfclient | grep Version | awk '{print $2}' )
2024-06-20 19:24:54 +00:00
case " ${ CPU_ARCHITECTURE } " in
"armv7l" | "armv6l" )
2024-07-23 18:45:59 +00:00
if [ [ " $pfclient_installed_version " != " ${ pfclient_current_version_armhf } " ] ] ; then
feeder_list = ( " ${ feeder_list [@] } " 'Plane Finder Client (upgrade)' '' OFF)
2024-06-20 19:24:54 +00:00
else
2024-07-23 18:45:59 +00:00
feeder_list = ( " ${ feeder_list [@] } " 'Plane Finder Client (reinstall)' '' OFF)
2024-06-20 19:24:54 +00:00
fi
; ;
"aarch64" )
2024-07-23 18:45:59 +00:00
if [ [ " $pfclient_installed_version " != " ${ pfclient_current_version_arm64 } " ] ] ; then
feeder_list = ( " ${ feeder_list [@] } " 'Plane Finder Client (upgrade)' '' OFF)
2024-06-20 19:24:54 +00:00
else
2024-07-23 18:45:59 +00:00
feeder_list = ( " ${ feeder_list [@] } " 'Plane Finder Client (reinstall)' '' OFF)
2024-06-20 19:24:54 +00:00
fi
; ;
"x86_64" )
2024-07-23 18:45:59 +00:00
if [ [ " $pfclient_installed_version " != " ${ pfclient_current_version_amd64 } " ] ] ; then
feeder_list = ( " ${ feeder_list [@] } " 'Plane Finder Client (upgrade)' '' OFF)
2024-06-20 19:24:54 +00:00
else
2024-07-23 18:45:59 +00:00
feeder_list = ( " ${ feeder_list [@] } " 'Plane Finder Client (reinstall)' '' OFF)
2024-06-20 19:24:54 +00:00
fi
; ;
"i386" )
2024-07-23 18:45:59 +00:00
if [ [ " $pfclient_installed_version " != " ${ pfclient_current_version_i386 } " ] ] ; then
feeder_list = ( " ${ feeder_list [@] } " 'Plane Finder Client (upgrade)' '' OFF)
2024-06-20 19:24:54 +00:00
else
2024-07-23 18:45:59 +00:00
feeder_list = ( " ${ feeder_list [@] } " 'Plane Finder Client (reinstall)' '' OFF)
2024-06-20 19:24:54 +00:00
fi
; ;
*)
2024-07-23 18:45:59 +00:00
feeder_list = ( " ${ feeder_list [@] } " 'Plane Finder Client (reinstall)' '' OFF)
2024-06-20 19:24:54 +00:00
esac
2016-09-27 01:28:04 +00:00
fi
2024-07-23 18:45:59 +00:00
function install_planefinder_client( ) {
2024-08-05 20:03:31 +00:00
chmod +x ${ RECEIVER_BASH_DIRECTORY } /feeders/planefinder.sh
2024-07-23 18:45:59 +00:00
${ RECEIVER_BASH_DIRECTORY } /feeders/planefinder.sh
if [ [ $? != 0 ] ] ; then
exit 1
fi
}
2016-09-27 01:28:04 +00:00
2024-07-23 18:45:59 +00:00
whiptail --backtitle " ${ RECEIVER_PROJECT_TITLE } " \
--title "Client Installation Options" \
--checklist \
--nocancel \
--separate-output "The following clients are available for installation.\nChoose the clients you wish to install." \
15 65 7 " ${ feeder_list [@] } " 2>${ RECEIVER_ROOT_DIRECTORY } /FEEDER_CHOICES
## PORTALS
# ADS-B Portal
install_portal = "false"
whiptail --backtitle " ${ RECEIVER_PROJECT_TITLE } " \
--title "Install The ADS-B Portal" \
--defaultno \
--yesno "The ADS-B Portal is a web interface for your receiver. More information can be found in the ADS-B Receiver Project GitHub repository.\n\nhttps://github.com/jprochazka/adsb-receiver\n\nWould you like to install the ADS-B Portal?" \
2024-08-05 20:03:31 +00:00
12 78
2024-07-23 18:45:59 +00:00
if [ [ $? = = 0 ] ] ; then
install_portal = "true"
2024-07-24 00:38:11 +00:00
fi
2024-07-23 18:45:59 +00:00
2024-08-06 18:50:24 +00:00
function install_adsb_portal( ) {
2024-08-05 20:03:31 +00:00
chmod +x ${ RECEIVER_BASH_DIRECTORY } /portal/install.sh
2024-07-23 18:45:59 +00:00
${ RECEIVER_BASH_DIRECTORY } /portal/install.sh
if [ [ $? != 0 ] ] ; then
exit 1
fi
}
2016-09-27 01:28:04 +00:00
2017-10-02 19:36:29 +00:00
## Extras
2024-07-23 18:45:59 +00:00
declare array extras_list
2017-10-02 19:36:29 +00:00
touch ${ RECEIVER_ROOT_DIRECTORY } /EXTRAS_CHOICES
2024-07-23 18:45:59 +00:00
# Beast-splitter
if [ [ $( dpkg-query -W -f= '${STATUS}' beast-splitter 2>/dev/null | grep -c "ok installed" ) = = 0 ] ] ; then
extras_list = ( " ${ extras_list [@] } " 'beast-splitter' '' OFF)
2017-10-02 19:36:29 +00:00
else
2024-07-23 18:45:59 +00:00
extras_list = ( " ${ extras_list [@] } " 'beast-splitter (reinstall)' '' OFF)
2017-10-02 19:36:29 +00:00
fi
2016-09-27 01:28:04 +00:00
2024-07-24 00:38:11 +00:00
function install_beastsplitter( ) {
2024-07-23 18:45:59 +00:00
chmod +x ${ RECEIVER_BASH_DIRECTORY } /extras/beeastsplitter.sh
${ RECEIVER_BASH_DIRECTORY } /extras/beastsplitter.sh
if [ [ $? != 0 ] ] ; then
exit 1
fi
}
# Duck DNS
2024-06-20 17:03:21 +00:00
if [ [ ! -f " ${ RECEIVER_BUILD_DIRECTORY } /duckdns/duck.sh " ] ] ; then
2024-07-23 18:45:59 +00:00
extras_list = ( " ${ extras_list [@] } " 'Duck DNS Free Dynamic DNS Hosting' '' OFF)
2017-10-02 19:36:29 +00:00
else
2024-07-23 18:45:59 +00:00
extras_list = ( " ${ extras_list [@] } " 'Duck DNS Free Dynamic DNS Hosting (reinstall)' '' OFF)
2017-10-02 19:36:29 +00:00
fi
2016-09-27 01:28:04 +00:00
2024-07-24 00:38:11 +00:00
function install_duckdns( ) {
2024-07-23 18:45:59 +00:00
chmod +x ${ RECEIVER_BASH_DIRECTORY } /extras/duckdns.sh
${ RECEIVER_BASH_DIRECTORY } /extras/duckdns.sh
if [ [ $? -ne 0 ] ] ; then
exit 1
fi
}
2024-08-22 16:17:15 +00:00
# Graphs1090
if [ [ ! -f /lib/systemd/system/graphs1090.service ] ] ; then
extras_list = ( " ${ extras_list [@] } " 'Graphs1090' '' OFF)
else
extras_list = ( " ${ extras_list [@] } " 'Graphs1090 (reinstall)' '' OFF)
fi
function install_graphs1090( ) {
chmod +x ${ RECEIVER_BASH_DIRECTORY } /extras/graphs1090.sh
${ RECEIVER_BASH_DIRECTORY } /extras/graphs1090.sh
if [ [ $? != 0 ] ] ; then
exit 1
fi
}
# tar1090
if [ [ ! -f /lib/systemd/system/tar1090.service ] ] ; then
extras_list = ( " ${ extras_list [@] } " 'tar1090' '' OFF)
else
extras_list = ( " ${ extras_list [@] } " 'tar1090 (reinstall)' '' OFF)
fi
function install_tar1090( ) {
chmod +x ${ RECEIVER_BASH_DIRECTORY } /extras/tar1090.sh
${ RECEIVER_BASH_DIRECTORY } /extras/tar1090.sh
if [ [ $? != 0 ] ] ; then
exit 1
fi
}
2024-07-23 18:45:59 +00:00
whiptail --backtitle " ${ RECEIVER_PROJECT_TITLE } " \
--title "Extras Installation Options" \
--checklist \
--nocancel \
--separate-output "The following extras are available for installation, please select any which you wish to install." \
2024-08-05 20:03:31 +00:00
11 65 4 " ${ extras_list [@] } " 2>${ RECEIVER_ROOT_DIRECTORY } /EXTRAS_CHOICES
2024-07-23 18:45:59 +00:00
2017-10-02 19:36:29 +00:00
## Setup Confirmation
2016-09-27 01:28:04 +00:00
2024-07-23 18:45:59 +00:00
declare confirmation_message
2016-09-27 01:28:04 +00:00
2024-08-15 19:58:45 +00:00
if [ [ " ${ install_adsb_decoder } " = = "false" && " ${ install_uat_decoder } " = = "false" && " ${ install_acars_decoder } " = = "false" && " ${ install_vdlm2_decoder } " = = "false" && " ${ install_portal } " = = "false" && ! -s " ${ RECEIVER_ROOT_DIRECTORY } /FEEDER_CHOICES " && ! -s " ${ RECEIVER_ROOT_DIRECTORY } /EXTRAS_CHOICES " ] ] ; then
2024-07-23 18:45:59 +00:00
whiptail --backtitle " ${ RECEIVER_PROJECT_TITLE } " \
--title "Nothing to be done" \
--msgbox "Nothing has been selected to be installed so the script will exit now." \
2024-08-05 20:03:31 +00:00
8 65
2024-07-23 18:45:59 +00:00
echo ""
2024-07-23 21:39:20 +00:00
log_alert_heading "Nothing was selected to do or be installed"
2024-07-23 18:45:59 +00:00
echo ""
2017-10-02 19:36:29 +00:00
exit 1
else
2024-07-23 18:45:59 +00:00
confirmation_message = "The following software will be installed:\n"
2024-08-02 20:11:23 +00:00
# ADS-B decoders
if [ [ " ${ install_adsb_decoder } " = = "true" ] ] ; then
case ${ chosen_adsb_decoder } in
2024-07-23 18:45:59 +00:00
"dump1090-fa" )
confirmation_message = " ${ confirmation_message } \n * FlightAware dump1090 "
2017-10-02 19:36:29 +00:00
; ;
2024-08-22 16:17:15 +00:00
"readsb" )
confirmation_message = " ${ confirmation_message } \n * Readsb "
; ;
2017-10-02 19:36:29 +00:00
esac
2016-09-27 01:28:04 +00:00
fi
2024-08-02 20:11:23 +00:00
# UAT decoders
if [ [ " ${ install_uat_decoder } " = "true" ] ] ; then
case ${ chosen_uat_decoder } in
2024-07-23 18:45:59 +00:00
"dump978-fa" )
confirmation_message = " ${ confirmation_message } \n * FlightAware dump978 "
; ;
esac
2016-09-27 01:28:04 +00:00
fi
2024-08-02 20:11:23 +00:00
# ACARS decoders
if [ [ " ${ install_acars_decoder } " = "true" ] ] ; then
case ${ chosen_acars_decoder } in
"acarsdec" )
confirmation_message = " ${ confirmation_message } \n * ACARSDEC "
; ;
esac
fi
2024-08-15 19:58:45 +00:00
# VDL Mode 2 decoders
if [ [ " ${ install_vdlm2_decoder } " = "true" ] ] ; then
case ${ chosen_vdlm2_decoder } in
2024-08-14 19:19:39 +00:00
"dumpvdl2" )
confirmation_message = " ${ confirmation_message } \n * dumpvdl2 "
; ;
2024-08-15 19:58:45 +00:00
"vdlm2dec" )
confirmation_message = " ${ confirmation_message } \n * vdlm2dec "
; ;
2024-08-14 19:19:39 +00:00
esac
fi
2024-07-23 18:45:59 +00:00
# Aggragate site clients
2024-06-20 17:03:21 +00:00
if [ [ -s " ${ RECEIVER_ROOT_DIRECTORY } /FEEDER_CHOICES " ] ] ; then
2024-07-23 18:45:59 +00:00
while read feeder_choice
2016-09-27 01:28:04 +00:00
do
2024-07-23 18:45:59 +00:00
confirmation_message = " ${ confirmation_message } \n * ${ feeder_choice } "
2017-10-02 19:36:29 +00:00
done < ${ RECEIVER_ROOT_DIRECTORY } /FEEDER_CHOICES
2016-09-27 01:28:04 +00:00
fi
2024-07-23 18:45:59 +00:00
# Portals
2024-08-05 23:50:34 +00:00
if [ [ " ${ install_portal } " = = "true" ] ] ; then
2024-07-23 18:45:59 +00:00
confirmation_message = " ${ confirmation_message } \n * ADS-B Receiver Project Web Portal "
2017-10-02 19:36:29 +00:00
fi
2024-07-23 18:45:59 +00:00
# Extras
2024-06-20 17:03:21 +00:00
if [ [ -s " ${ RECEIVER_ROOT_DIRECTORY } /EXTRAS_CHOICES " ] ] ; then
2024-07-23 18:45:59 +00:00
while read extra_choice
2017-10-02 19:36:29 +00:00
do
2024-07-23 18:45:59 +00:00
confirmation_message = " ${ confirmation_message } \n * ${ extra_choice } "
2017-10-02 19:36:29 +00:00
done < ${ RECEIVER_ROOT_DIRECTORY } /EXTRAS_CHOICES
2016-09-27 01:28:04 +00:00
fi
2017-10-02 19:36:29 +00:00
2024-07-23 18:45:59 +00:00
confirmation_message = " ${ confirmation_message } \n\n "
2016-09-27 01:28:04 +00:00
fi
2024-07-23 18:45:59 +00:00
confirmation_message = " ${ confirmation_message } Do you wish to continue setup? "
if ! ( whiptail --backtitle " ${ RECEIVER_PROJECT_TITLE } " --title "Confirm You Wish To Continue" --yesno " ${ confirmation_message } " 21 78) ; then
echo ""
2024-07-23 21:39:20 +00:00
log_alert_heading "Installation cancelled by user"
2024-07-23 18:45:59 +00:00
echo ""
2024-06-20 17:03:21 +00:00
exit 1
2016-09-27 01:28:04 +00:00
fi
2024-07-23 18:45:59 +00:00
## BEGIN SETUP
2016-09-27 01:28:04 +00:00
2024-08-02 20:11:23 +00:00
# ADS-B Decoders
if [ [ " ${ install_adsb_decoder } " = = "true" ] ] ; then
case ${ chosen_adsb_decoder } in
2024-07-23 18:45:59 +00:00
"dump1090-fa" )
2024-08-02 20:11:23 +00:00
install_dump1090_fa
2017-10-02 19:36:29 +00:00
; ;
2024-08-22 17:48:01 +00:00
"readsb" )
2024-08-22 16:17:15 +00:00
install_readsb
; ;
2017-10-02 19:36:29 +00:00
esac
2016-09-27 01:28:04 +00:00
fi
2024-08-02 20:11:23 +00:00
# UAT Decoders
if [ [ " ${ install_uat_decoder } " = = "true" ] ] ; then
case ${ chosen_uat_decoder } in
2024-07-23 18:45:59 +00:00
"dump978-fa" )
2024-08-02 20:11:23 +00:00
install_dump978_fa
; ;
esac
fi
# ACARS Decoders
if [ [ " ${ install_acars_decoder } " = = "true" ] ] ; then
case ${ chosen_acars_decoder } in
"acarsdec" )
install_acarsdec
2024-07-23 18:45:59 +00:00
; ;
esac
2016-09-27 01:28:04 +00:00
fi
2024-08-14 19:19:39 +00:00
# VDL Decoders
2024-08-15 19:58:45 +00:00
if [ [ " ${ install_vdlm2_decoder } " = = "true" ] ] ; then
case ${ chosen_vdlm2_decoder } in
2024-08-14 19:19:39 +00:00
"dumpvdl2" )
2024-08-15 19:58:45 +00:00
install_dumpvdl2
; ;
"vdlm2dec" )
install_vdlm2dec
; ;
2024-08-14 19:19:39 +00:00
esac
fi
2024-08-06 18:50:24 +00:00
# Aggragate site clients
2024-07-24 00:38:11 +00:00
run_adsbexchange_script = "false"
run_airplaneslive_script = "false"
run_flightaware_script = "false"
run_flightradar24_script = "false"
run_flyitalyadsb_script = "false"
run_openskynetwork_script = "false"
run_planefinder_script = "false"
2024-06-20 17:03:21 +00:00
if [ [ -s " ${ RECEIVER_ROOT_DIRECTORY } /FEEDER_CHOICES " ] ] ; then
2024-07-23 18:45:59 +00:00
while read feeder_choice
2016-09-27 01:28:04 +00:00
do
2024-07-23 18:45:59 +00:00
case ${ feeder_choice } in
2024-07-24 00:38:11 +00:00
"ADS-B Exchange Feed Client" | "ADS-B Exchange Feed Client (reinstall/update)" )
run_adsbexchange_script = "true"
2018-06-26 13:06:46 +00:00
; ;
2024-07-13 19:32:48 +00:00
"Airplanes.live Feeder" | "Airplanes.live Feeder (reinstall)" )
2024-07-24 00:38:11 +00:00
run_airplaneslive_script = "true"
2024-07-13 19:32:48 +00:00
; ;
2024-06-20 17:51:02 +00:00
"FlightAware PiAware" | "FlightAware PiAware (upgrade)" | "FlightAware PiAware (reinstall)" )
2024-07-24 00:38:11 +00:00
run_flightaware_script = "true"
2017-10-02 19:36:29 +00:00
; ;
2024-06-20 17:51:02 +00:00
"Flightradar24 Client" | "Flightradar24 Client (upgrade)" | "Flightradar24 Client (reinstall)" )
2024-07-24 00:38:11 +00:00
run_flightradar24_script = "true"
2017-10-02 19:36:29 +00:00
; ;
2024-07-24 00:38:11 +00:00
"Fly Italy ADS-B Feeder" | "Fly Italy ADS-B Feeder (reinstall)" )
run_flyitalyadsb_script = "true"
2024-07-07 19:36:38 +00:00
; ;
2024-07-24 00:38:11 +00:00
"OpenSky Network Feeder" | "OpenSky Network Feeder (reinstall)" )
run_openskynetwork_script = "true"
2018-06-26 13:06:46 +00:00
; ;
2024-06-20 19:24:54 +00:00
"Plane Finder Client" | "Plane Finder Client (upgrade)" | "Plane Finder Client (reinstall)" )
2024-07-24 00:38:11 +00:00
run_planefinder_script = "true"
2017-10-02 19:36:29 +00:00
; ;
2016-09-27 01:28:04 +00:00
esac
2017-10-02 19:36:29 +00:00
done < ${ RECEIVER_ROOT_DIRECTORY } /FEEDER_CHOICES
2016-09-27 01:28:04 +00:00
fi
2024-07-24 00:38:11 +00:00
if [ [ " ${ run_adsbexchange_script } " = = "true" ] ] ; then
install_adsbexchange_client
fi
if [ [ " ${ run_airplaneslive_script } " = = "true" ] ] ; then
install_airplaneslive_client
fi
if [ [ " ${ run_flightaware_script } " = = "true" ] ] ; then
install_flightaware_client
fi
if [ [ " ${ run_flightradar24_script } " = = "true" ] ] ; then
install_flightradar24_client
fi
if [ [ " ${ run_flyitalyadsb_script } " = = "true" ] ] ; then
install_flyitalyadsb_client
fi
if [ [ " ${ run_openskynetwork_script } " = = "true" ] ] ; then
install_openskynetwork_client
fi
if [ [ " ${ run_planefinder_script } " = = "true" ] ] ; then
install_planefinder_client
fi
2024-07-23 18:45:59 +00:00
# Portals
if [ [ " ${ install_portal } " = = "true" ] ] ; then
2024-08-06 18:50:24 +00:00
install_adsb_portal
2018-06-26 13:06:46 +00:00
fi
2024-07-23 18:45:59 +00:00
# Extras
2024-07-24 00:38:11 +00:00
run_beastsplitter_script = "false"
run_duckdns_script = "false"
2024-06-20 17:03:21 +00:00
if [ [ -s " ${ RECEIVER_ROOT_DIRECTORY } /EXTRAS_CHOICES " ] ] ; then
2024-07-23 18:45:59 +00:00
while read extras_choice
2017-10-02 19:36:29 +00:00
do
2024-07-23 18:45:59 +00:00
case ${ extras_choice } in
2017-10-02 19:36:29 +00:00
"beast-splitter" | "beast-splitter (reinstall)" )
2024-07-24 00:38:11 +00:00
run_beastsplitter_script = "true"
2017-10-02 19:36:29 +00:00
; ;
"Duck DNS Free Dynamic DNS Hosting" | "Duck DNS Free Dynamic DNS Hosting (reinstall)" )
2024-07-24 00:38:11 +00:00
run_duckdns_script = "true"
2017-10-02 19:36:29 +00:00
; ;
2024-08-22 16:17:15 +00:00
"Graphs1090" | "Graphs1090 (reinstall)" )
run_graphs1090_script = "true"
; ;
"tar1090" | "tar1090 (reinstall)" )
run_tar1090_script = "true"
; ;
2017-10-02 19:36:29 +00:00
esac
done < ${ RECEIVER_ROOT_DIRECTORY } /EXTRAS_CHOICES
fi
2024-08-06 18:50:24 +00:00
if [ [ " ${ run_beastsplitter_script } " = = "true" ] ] ; then
2024-07-24 00:38:11 +00:00
install_beastsplitter
fi
if [ [ " ${ run_duckdns_script } " = = "true" ] ] ; then
install_duckdns
fi
2024-08-22 16:17:15 +00:00
if [ [ " ${ run_graphs1090_script } " = = "true" ] ] ; then
install_graphs1090
fi
if [ [ " ${ run_tar1090_script } " = = "true" ] ] ; then
install_tar1090
fi
2016-09-27 01:28:04 +00:00
exit 0