Porównaj commity

...

126 Commity

Autor SHA1 Wiadomość Data
Joseph Prochazka 8f4b3df96c
Merge pull request #615 from jprochazka/fixes
v2.8.7 (Fixes to issues.)
2024-10-18 20:18:32 -04:00
jprochazka f869054b8f Bumped version to 2.8.8 2024-10-18 20:15:00 -04:00
Joseph Prochazka 7428824766
Added trixie branch note. 2024-10-18 15:45:00 -04:00
Joseph Prochazka be156e8c3e
Clone specific branch. 2024-10-18 15:43:04 -04:00
Joseph Prochazka eaae395f0c
Updated date. 2024-10-18 09:30:21 -04:00
Joseph Prochazka ade793fe4d
Added Bullseye tcl-tls change. 2024-10-18 09:29:52 -04:00
Joseph Prochazka 41c0bccb1b
Custom tcl-tls now installed on Bullseye. 2024-10-18 09:11:46 -04:00
Joseph Prochazka 9536582291
Merge pull request #607 from jprochazka/vdlm2
v2.8.7 (VDLM2, Readsb, Graph1090, and tar1090 support added.)
2024-08-23 23:07:20 -04:00
jprochazka f082ed6668 Merge branch 'master' into vdlm2 2024-08-23 14:52:34 -04:00
jprochazka 5ec663cd48 README and CHANGELOG updates. 2024-08-23 14:44:46 -04:00
jprochazka ce78a0142e vdlm2dec.sh now asks for frequencies. 2024-08-23 12:47:32 -04:00
jprochazka e09a5dfe6e Fixed minor device assignment issue. 2024-08-23 12:24:18 -04:00
jprochazka 8ee8e33cad Noble PiAware install fix. 2024-08-23 15:51:56 +00:00
jprochazka aa94ca1bfc Device assignment fixes. 2024-08-23 15:39:30 +00:00
jprochazka 8d64dae690 graph1090 and tar1090 debugging. 2024-08-22 15:33:53 -04:00
jprochazka 9969bc6dc4 Device assignment debugging. 2024-08-22 15:26:13 -04:00
jprochazka 01fc770f6e Readsb debugging. 2024-08-22 17:48:01 +00:00
jprochazka d9e0be390c Modified device assignment functions. 2024-08-22 13:03:07 -04:00
jprochazka d1f8bf9e75 Removed temp Readsb/Noble fix. 2024-08-22 12:44:01 -04:00
jprochazka 7a173fa93e Added support for some of @wiedehopf's offerings. 2024-08-22 12:17:15 -04:00
jprochazka dc56aba0ce Began adding UPPrepeater support. 2024-08-21 16:50:03 -04:00
Joseph Prochazka 1779d023bf
Source functions and variables. 2024-08-17 13:40:31 -04:00
jprochazka e85f6b1169 Moved device assignment scripting to functions. 2024-08-15 15:58:45 -04:00
jprochazka 78cd6230a9 begun adding dumpvdl2 and vdlm2dec support. 2024-08-14 15:19:39 -04:00
Joseph Prochazka 7807e1a641
Merge pull request #601 from RensHijdra/portal-install-fix
Portal setup import functions and variables
2024-08-14 10:21:38 -04:00
Rens Hijdra 9deef66663 portal setup import functions and variables 2024-08-13 22:07:22 +02:00
Joseph Prochazka 8f31b05929
Merge pull request #600 from RensHijdra/heywhatsthat-exitcode
Fix HeyWhatThat rangering setup
2024-08-13 15:39:10 -04:00
Rens Hijdra 82629cd5f7 invert HeyWhatsThat whiptail exitcode conditions 2024-08-13 21:24:33 +02:00
Joseph Prochazka 0c3e238274
Merge pull request #599 from jprochazka/acars
v2.8.6 (ACARS support and portal installer fix.)
2024-08-13 12:34:37 -04:00
jprochazka b73b8ea016 Script clean up. 2024-08-13 12:27:56 -04:00
jprochazka 6f8c727ced ACARS display fixes. 2024-08-12 11:52:25 -04:00
jprochazka 67e24fc5e5 ACARS portal fixes. 2024-08-08 12:55:00 -04:00
jprochazka 13cdf96bdb Troubleshooting portal install 2024-08-06 14:50:24 -04:00
Joseph Prochazka 402593ee2a Lite portal fixes. 2024-08-05 19:50:34 -04:00
Joseph Prochazka 9dcf3fbb9d Possible fixes. 2024-08-05 19:15:27 -04:00
jprochazka b4c22caca0 Tested and debugged dump978-fa installer. 2024-08-05 17:18:59 -04:00
jprochazka 824f228eb3 Tested and debugged dump1090-fa installer. 2024-08-05 16:58:58 -04:00
jprochazka df3da90e81 Tested and debugged acarsdec installer. 2024-08-05 16:03:31 -04:00
jprochazka 710c972ecd Completed a rough draft of the ACARS portal template. 2024-08-05 12:45:39 -04:00
Joseph Prochazka e8c1bd2ea3 Clean up. 2024-08-03 00:27:35 -04:00
Joseph Prochazka f97e468c35 Bumped version to 2.8.6. 2024-08-02 22:18:38 -04:00
Joseph Prochazka 9a7eb4ee99 Work done to display ACARS data via the portal. 2024-08-02 18:44:31 -04:00
jprochazka 72fdb27422 Finished acarsdec installer but still needs tested. 2024-08-02 16:11:23 -04:00
jprochazka f23a4fedc2 Added ACARSDEC service script writing and decoder selection options. 2024-08-02 12:43:58 -04:00
jprochazka 365c6f35e6 Added device selection and acarserv install. 2024-07-24 15:13:05 -04:00
Joseph Prochazka a8fdf780dc Updated function to match merged changes. 2024-07-23 22:48:24 -04:00
Joseph Prochazka f759837fd9 Merge branch 'master' into acars 2024-07-23 22:00:16 -04:00
Joseph Prochazka dec90d9b13
Merge pull request #593 from jprochazka/noble
v2.8.4 (Temporary Trixie support and cleanup.)
2024-07-23 21:50:30 -04:00
jprochazka 77bfdc5f62 Marked as v2.8.5. 2024-07-23 21:48:53 -04:00
jprochazka af5b30d07c Testing and debugging after changes. 2024-07-23 20:38:11 -04:00
jprochazka 6e5727ad36 Use jprochazka fork until Trixie fix is merged. 2024-07-23 17:50:50 -04:00
jprochazka 3c074669b4 Renamed functions. 2024-07-23 17:39:20 -04:00
jprochazka 3be72462da Main.sh and miscellaneous clean up. 2024-07-23 14:45:59 -04:00
jprochazka a9569d4722 Additional logging testing and debugging. 2024-07-22 19:54:38 -04:00
jprochazka 87d6bb64f8 Fixes to PiAware installer. 2024-07-22 19:06:11 -04:00
jprochazka 9b9a7c7d47 Fixes to dump978-fa installer. 2024-07-22 18:54:17 -04:00
jprochazka 6c88cd0476 Added file logging. 2024-07-22 17:57:59 -04:00
jprochazka 9b474c1939 A handful of fixes. 2024-07-22 02:52:36 -04:00
jprochazka 062cd7ec3a The main.sh script now uses new logging functions. 2024-07-22 02:33:33 -04:00
jprochazka 99642de229 The Duck DNS script now uses new logging functions. 2024-07-22 02:04:59 -04:00
jprochazka 28719e728d Removed image creation and setup support. 2024-07-22 01:29:55 -04:00
jprochazka caa8f86738 The beast-splitter script now uses new logging functions. 2024-07-22 01:21:51 -04:00
jprochazka 18b23be270 The PlaneFinder script now uses new logging functions. 2024-07-22 00:43:50 -04:00
jprochazka 4920790504 The Opensky Network script now uses new logging functions. 2024-07-22 00:17:45 -04:00
jprochazka b83cd9c1ca The Fly Italy ADS-B script now uses new logging functions. 2024-07-21 23:54:47 -04:00
jprochazka 9532843685 The FlightRadar24 script now uses new logging functions. 2024-07-21 23:30:05 -04:00
jprochazka ca3ba03f6a The airplaneslive.sh script now uses new logging functions. 2024-07-21 23:06:44 -04:00
jprochazka 278fb3e895 The adsbexchange.sh script now utilizes color variables. 2024-07-21 22:33:59 -04:00
jprochazka 1251ae858f The dump978-fa.sh script now utilizes color variables. 2024-07-21 22:04:26 -04:00
jprochazka 143331a7d5 Updated dump1090.fa script and fixed color variables. 2024-07-21 20:58:36 -04:00
Joseph Prochazka ee411ea7be Display and installer fixes. 2024-07-19 21:01:06 -04:00
Joseph Prochazka 736fdd9c34 Work started on the ACARSDEC installer. 2024-07-19 20:35:33 -04:00
jprochazka 398f16bf8b Skip tcltls-rebuild installation on most distros. 2024-07-19 17:00:17 -04:00
jprochazka 6489731ebc Added notes on tcltls-rebuild. 2024-07-19 16:04:56 -04:00
jprochazka 0bd32ef097 Added untested Nobel support and logging foundations. 2024-07-19 15:58:45 -04:00
Joseph Prochazka 7c91ec632b
Merge pull request #590 from jprochazka/maintenance
Forgot to reenable purge jobs after a test.
2024-07-15 11:47:38 -04:00
jprochazka 3e9e73b755 Forgot to reenable purge jobs after a test. 2024-07-15 11:46:30 -04:00
Joseph Prochazka 5a365c7e61
Merge pull request #589 from jprochazka/jprochazka-patch-1
Update README.md
2024-07-14 00:16:47 -04:00
Joseph Prochazka ec23f966ac
Update README.md 2024-07-14 00:16:33 -04:00
Joseph Prochazka 1792d3ee02
Merge pull request #586 from jprochazka/jobs
v2.8.4 (Should be back to where we were now.)
2024-07-13 20:50:05 -04:00
jprochazka b7afe4ac02 Updated CHANGELOG.md 2024-07-13 20:42:33 -04:00
jprochazka ca261da841 Added missing data and images. 2024-07-13 20:15:59 -04:00
Joseph Prochazka 729519377d
Update CHANGELOG.md 2024-07-13 15:54:39 -04:00
Joseph Prochazka f317b99a59
Update CHANGELOG.md 2024-07-13 15:54:17 -04:00
jprochazka 75839b3a09 Added support for airplanes.live. 2024-07-13 15:32:48 -04:00
jprochazka 1892ac1462 Can now set up automated maintenance. 2024-07-13 01:24:38 -04:00
jprochazka ece83487ee Filter flights without positions. 2024-07-13 00:04:48 -04:00
jprochazka d5c698c9f5 Rewrote flights.py and maintenance.py. 2024-07-12 23:05:48 -04:00
jprochazka f6533814b5 Updated README.md 2024-07-12 16:44:47 -04:00
jprochazka 4d964302b1 Rewrote python jobs. 2024-07-12 15:30:18 -04:00
Joseph Prochazka 68671e17a8
Merge pull request #583 from jprochazka/quick-fix
CPU arch variable was wrong.
2024-07-10 22:36:47 -04:00
jprochazka 0e1bff187f CPU arch varible was wrong. 2024-07-10 22:34:59 -04:00
Joseph Prochazka a5c879a3a9
Grammer fixes. 2024-07-07 18:58:44 -04:00
Joseph Prochazka e769638ec6
Added missing parenthesis. 2024-07-07 18:53:09 -04:00
Joseph Prochazka 6f6606959b
Merge pull request #580 from jprochazka/next
v2.8.3 (Fixes, Cleanup, and Fly Italy ADS-B Support)
2024-07-07 15:47:37 -04:00
jprochazka c87643c78e Added Fly Italy ADS-B support and set as v2.8.3. 2024-07-07 15:36:38 -04:00
jprochazka 3ac250c3b5 Process booleans properly. 2024-07-07 14:35:11 -04:00
Joseph Prochazka 4ccb935832
Update README.md 2024-07-04 01:15:43 -04:00
Joseph Prochazka 7ec51e68bb
Update README.md 2024-07-04 00:50:29 -04:00
Joseph Prochazka d7a2bdaf2d
Update CHANGELOG.md 2024-06-30 02:45:48 -04:00
jprochazka c2afc1454b Merge branch 'master' into next 2024-06-30 00:28:09 -04:00
jprochazka a9add7a790 Removed unused variable. 2024-06-30 00:26:37 -04:00
jprochazka a4df2a1c55 Code cleanup commited for testing. 2024-06-29 23:49:36 -04:00
jprochazka 1d37c0fa84 RPi CPU graph fix and RTL-SDR modules blocked. 2024-06-29 21:12:16 -04:00
jprochazka d729e00a1b Fixed repository update procedures. 2024-06-29 20:11:37 -04:00
Joe Prochazka ad56fbc3f6
Merge pull request #576 from jprochazka/point-two
v2.8.2 (A Few More Fixes to Phoenix)
2024-06-29 00:22:07 -04:00
jprochazka 9923c9c023 Changes to mark installs as v2.8.2. 2024-06-29 00:17:01 -04:00
jprochazka ccde75fbd4 Added additional adsbx install options. 2024-06-28 21:39:25 -04:00
jprochazka 4c71b5e857 Fixed broken graphs. 2024-06-28 21:08:03 -04:00
jprochazka 5a24a1a20b Now supports DietPi. 2024-06-29 01:06:54 +01:00
jprochazka 54ca88e81f Added Ubuntu Jammy and Focal support. 2024-06-28 00:32:18 -04:00
jprochazka 78302a47c9 Added eno1 and wlo1 options. 2024-06-27 20:11:51 -04:00
jprochazka 7492de1f17 Fix navigation issue in lite installs. 2024-06-27 20:08:41 -04:00
Joe Prochazka d68c0844d2
Merge pull request #571 from jprochazka/phoenix-fixes
v2.8.1 (Phoenix Fixes)
2024-06-27 18:22:56 -04:00
Joe Prochazka 194490bace
Update CHANGELOG.md 2024-06-27 18:12:00 -04:00
Joe Prochazka f0dc78cfea
Updated dates. 2024-06-27 15:34:29 -04:00
Joe Prochazka 348a48abdc
Updated CREDITS.md 2024-06-27 15:33:57 -04:00
Joe Prochazka 659b7c6e17
Update CHANGELOG.md 2024-06-27 15:15:37 -04:00
Joe Prochazka 5902cad5f1
Update CHANGELOG.md 2024-06-27 15:12:31 -04:00
jprochazka 186ff1b7f2 Preparations for the v2.8.1 release. 2024-06-27 15:08:21 -04:00
Joe Prochazka 329a0f95a0
Update CHANGELOG.md 2024-06-27 00:48:51 -04:00
Joe Prochazka 71fdd850b4
Update CHANGELOG.md 2024-06-27 00:48:01 -04:00
jprochazka a9837fb439 Now adds missing settings on install. 2024-06-27 00:38:39 -04:00
jprochazka c8cca2ced4 Advanced portal feature fixes. 2024-06-26 23:40:40 -04:00
Joe Prochazka eadec87a17
Update CHANGELOG.md 2024-06-24 23:39:13 -04:00
jprochazka eb58ca62ff Planefinder feeder installs on aarch64 now. 2024-06-24 21:59:51 -04:00
116 zmienionych plików z 5592 dodań i 5633 usunięć

23
.gitignore vendored 100644
Wyświetl plik

@ -0,0 +1,23 @@
EXTRAS_CHOICES
FEEDER_CHOICES
build/acarsdec
build/acarsserv
build/adsbexchange
build/airplaneslive
build/beast-splitter
build/duckdns
build/dump1090-fa
build/dump978-fa
build/dumpvld2
build/flightradar24
build/flyitalyadsb
build/graphs1090
build/libacars
build/piaware_builder
build/planefinder
build/package-archive
build/portal/graphs/__pycache__
build/readsb
build/tar1090
build/vdlm2dec
logs

Wyświetl plik

@ -2,9 +2,93 @@
The following is a history of the changes made to this project.
## v2.8.0 *(June 24th, 2024)*
## v2.8.8 *(October 18th, 2024)*
### Installers
* FlightAware's version of the tcl-tls is now built and installed on Bullseye.
* Clones the trixie branch directly when using the forked version of piaware_builder.
* The portal upgrade path to v2.8.7 was missing.
## v2.8.7 *(August 23rd, 2024)*
* The ability to install dumpvdl2 is now available as a decoder option.
* The ability to install vdlm2dec is now available as a decoder option.
* The ability to install Readsb is now available as a decoder option.
* The ability to install Graphs1090 is now available as an extras option.
* The ability to install tar1090 is now available as an extras option.
* Added missing Noble dependency to PiAware install script.
* Fixed Noble detection problem found within the PiAware install script.
* All decoder menus have been modified to support additional installation options.
* Device assignment scripting has been modified to work within functions.sh.
* Cleanup and consolidation performed on the PHP ADS-B Portal installation scripts.
* Merged the dump1090-tools copyright notice into the file dump1090.py.
## v2.8.6 *(August 13th, 2024)*
* The option to install ACARSDEC and ACARSSERV is now available as a decoder option.
* ACARS data stored by ACARSSERV can be viewed via the existing PHP portal.
* Added the ability to reconfigure, rebuild, and reinstall both dump1090-fa and dump978.fa.
* Decoder scripts now ask for device assignments when additional decoders are being installed.
* Added "Contributors" to the copyright notice in the software license.
* Had to remove logging of check_package output due to whiptail issue encountered with pipe.
## v2.8.5 *(July 23rd, 2024)*
* The PiAware installation script now supports Ubuntu Noble Numbat. *(unofficial fix)*
* The installation of PiAware is no longer required when choosing to install dump1090-fa.
* The dump1090-fa installation script now mimics the current dump1090-fa installation instructions.
* All scripts excluding those related to the portal now utilize the new logging functions.
* Logging to the logs directory is enabled by default but can be disabled with --no-logging or -n.
* Added variables which can be modified to adjust text colors used by the bash scripts.
* Added the --version and -v arguments in order to display the current project version.
* Additional script cleanup done to various files.
* Removed scripting used for image setup.
* Updated the latest Flightradar24 Client version to 1.0.48-0.
## v2.8.4 *(July 13th, 2024)* :rooster:
* Added the option to install the airplanes.live feeder client and web interface.
* Can now toggle daily data purges as well specify the number of days to keep within the portal.
* Rewrote the aircraft.py script and fixed issues found with newer versions of dump1090.
* Rewrote the maintenance.py script and addressed issue mentioned in an incompatible pull request.
* The page displaying plots now shows missing data in the side bar revealing when clicking on marker.
* Added images to the side bar displayed when the marker is clicked when viewing the plots page.
* The flights page now only shows links when position information is present in the database.
## v2.8.3 *(July 7th, 2024)* :chicken:
* Added the option to install the Fly Italy ADS-B feeder client.
* Tested installation processes on Armbian Bookworm.
* Tested installation processes on Armbian Jammy.
* Unnecessary RTL-SDR kernel modules are once again blacklisted during decoder installs.
* ADS-B Receiver Project repository updates now work properly when executed by the script.
* Instead of creating a new branch, changes to tracked files are now stashed before updating.
* The --development and -d parameters are now respected by the install scripts.
* The --branch <branch_name> and -b <branch_name> parameters properly specify the branch to use.
* Fixed issue noticed in the line downloading the Duck DNS log during setup.
* Refactoring and standards compliance changes were made to multiple bash scripts.
* The proper collectd CPU temperature configuration is inserted for Raspberry PI 4 Model B devices.
## v2.8.2 *(June 29th, 2024)* :baby_chick:
* Added the option to install the ADS-B Exchange stats package after feeder installation.
* Added the option to install the ADS-B Exchange web interface after feeder installation.
* Added support for Ubuntu Jammy Jellyfish.
* Added support for Ubuntu Focal Fossa.
* Added support for DietPi Bookworm.
* Added support for DietPi Bullseye.
* Fixed issue where navigation element toggling was not working in lite installs.
* Added eno1 and wlo1 to network options in the administration settings section of the portal.
* The ADS-B Max Range temperature graph is now displayed in system performace the graphs collection.
* The Core Temperature graph is now displayed in system performace the graphs collection.
## v2.8.1 *(June 27th, 2024)* :hatched_chick:
* Plane Finder Feeder now installs properly on aarch64 operating systems.
* Fix problem where multiple instances of flights.py and maintenance.py were being launched.
* Addressed portal map centering settings not being added to the database on fresh installs.
* An issue was addressed allowing existing receivers to upgrade to phoenix properly.
## v2.8.0 *(June 24th, 2024)* :hatching_chick:
* The dump1090-fa and piaware_builder install process has been updated to support the latest versions.
* The dump978 script has been rewritten in order to use FlightAwares version of dump978.
@ -22,9 +106,6 @@ The following is a history of the changes made to this project.
* Removed the option to install AboveTustin.
* Removed the option to install ADSBHub support due to the fact it was incomplete.
* Removed incomplete RTL-SDR OGN setup scripting.
### Portal
* The portal install scripts have been updated to work on current operation systems.
* All portal related Python scripts have been updated to work with Python 3.
* TinyMCE has been replace by CKeditor in the portal.

Wyświetl plik

@ -1,60 +1,78 @@
# Credits :airplane:
## People and Places
## Collaborators and Contributors
First off I would like to thank the collaborators and contributors who have contributed to the project
directly. Their time and effort is greatly appreciated by myself as well as many others I am sure.
**Direct Contributors**
First and foremost I would like to thank the collaborators and contributors who have contributed to
the project directly through code contributions made directly to the repository. Their time and effort
is greatly appreciated by myself as well as many others I am sure.
* @adamkaplan
* @atbPy
* @bitpixdigital
* @BudBundi
* @charlie-foxtrot
* @dschaper
* @espinielli
* @g0wfv
* @jdwall
* @jsloyer
* @kuchel77
* @kylegordon
* @leearmstrong
* @mgunther68
* @mkrzysztofowicz
* @RensHijdra
* @Romeo-Golf
* @target-drone
* @ttsak
* @vitaliy-sk
* @wiedehopf
I would like to thank the members and contributors to the following forums for all the time and effort
they have put in in order to create a useful and informative place to discuss aircraft tracking.
## The Flight Tracking Community
* The ADS-B Receiver Project Forums: https://www.adsbreceiver.net
* The FlightAware Forums: http://discussions.flightaware.com
* The PlaneFinder Forums: http://forum.planefinder.net
* The ADS-B Exchange Forums: http://www.adsbexchange.com/forums/
I would like to thank the members and contributors to the following forums for all the time and effort
they have put in in order to create useful and informative places to discuss aircraft tracking.
* The FlightAware Forums: https://discussions.flightaware.com
* The PlaneFinder Forums: https://forum.planefinder.net
* The ADS-B Exchange Forums: https://adsbx.discourse.group
The performance graphs were created thanks in part to the great contributions made by members of both
the FlightAware and PlaneFinder communities. Through their examples and help posted to the following
threads myself and a couple contributors were able to add these very informative graphs.
threads myself along with other contributors to the cause were able to add these informative graphs.
* http://discussions.flightaware.com/ads-b-flight-tracking-f21/system-monitoring-t26999.html
* http://forum.planefinder.net/threads/web-portal-and-collectd-rrd-graphs-automated-installation.256/
* http://forum.planefinder.net/threads/web-portal-and-collectd-rrd-graphs-automated-installation.256
## Third Party Software
## Third Party Software Developers
Thanks to the people over at JetBrains for the complementary licenses for PhpStorm and PyCharms which
is being used to develop the portal portion of this project. https://www.jetbrains.com
I would like to thank the maintainers and contributors of the following projects. Without their
hard work and dedication to their respective projects this project would not have been possible.
I would also like to thank the developers and contributors to the following projects. Without their
hard work and dedication this project would not have been possible.
* ACARSDEC Decoder: https://github.com/TLeconte/acarsdec
* ACARSSERV: https://github.com/TLeconte/acarsserv
* ADS-B Exchange Client: https://github.com/adsbexchange/feedclient
* Airplanes.live Client: https://github.com/airplanes-live/feed
* Beast-Splitter: https://github.com/flightaware/beast-splitter
* Dump1090 (FlightAware): https://github.com/flightaware/dump1090
* Dump1090-Tools: https://github.com/mutability/dump1090-tools
* Dump978 (FlightAware): https://github.com/flightaware/dump978
* Dumpvdl2: https://github.com/szpajder/dumpvdl2
* Fly Italy ADS-B Client: https://github.com/flyitalyadsb/fly-italy-adsb
* Graphs1090: https://github.com/wiedehopf/graphs1090
* PiAware (FlightAware): https://github.com/flightaware/piaware
* Readsb (wiedehopf): https://github.com/wiedehopf/readsb
* tar1090: https://github.com/wiedehopf/tar1090
* VDLM2DEC: https://github.com/TLeconte/vdlm2dec
* Dump1090 (fa): https://github.com/flightaware/dump1090
* Dump978 (fa): https://github.com/flightaware/dump978
* FlightAware's PiAware: http://flightaware.com
* Plane Finder ADS-B Client: https://planefinder.net
* Flightradar24 Client: https://www.flightradar24.com
* Dump1090-Tools: https://github.com/mutability/dump1090-tools
* Beast-Splitter https://github.com/flightaware/beast-splitter
* bootpag http://botmonster.com/jquery-bootpag
* Bootstrap: http://getbootstrap.com/
* jQuery: http://jquery.com/
* jQuery Steps: http://www.jquery-steps.com
* js-cookie: https://github.com/js-cookie/js-cookie/releases
* jquery-validation: https://github.com/jzaefferer/jquery-validation
* Google Charts: https://developers.google.com/chart
* Duck DNS http://www.duckdns.com
Thanks also goes out to the developers and the businesses that employ them who work to supply us
with quality closed source packages which they have made available to the community.
* Flightradar24: https://flightradar24.com
* OpenSky Network: https://opensky-network.org
* Plane Finder: https://planefinder.net
Yet another thanks goes out to those kind enough to share their photographs the community as well as
those hosting these images and make them avaiable for us to use in projects such as this.
* https://www.planespotters.net

Wyświetl plik

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2015-2017 Joseph A. Prochazka
Copyright (c) 2015 Joseph A. Prochazka and Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

109
README.md
Wyświetl plik

@ -1,85 +1,88 @@
# The ADS-B Receiver Project :airplane:
This repository contains a set of scripts and files which can be used to setup an ADS-B receiver on a clean installation of a Debian derived operating system. The scripts are executed in order by the main install script depending on the installation options chosen by the user.
## Easily install ADS-B/UAT/ACARS/VDLM2 related applications!
**ADS-B Receiver Web Portal Features**
This project continues to realize that for some, Docker and premade images are not the most optimal solution.
* Saves all flights seen as well as displays a plot for the flight. (advanced)
* Control what is displayed online via a web based administration area.
* A more uniform website site layout that can be easily navigated.
* Web accessible dump1090 and system performance graphs.
* A web accessible live dump1090 map.
* A web accessible live dump978 map.
* A blog which can be used to share your plane tracking experiences with others.
* Informs visitors when specific flights are being tracked by dump1090.
* Easily customize the look of your portal using the template system.
It would seem as of late the move towards premade as well as Docker and other PaaS images with preinstalled software has become popular within the community. Docker images require additional software and, in some cases, result in additional overhead as well as making trivial configuration changes more complicated than they should be. Most of these solutions also come with preinstalled software one may never use as part of the image as well. This project offers the ability to choose and install only what you want or need natively across a wide range of devices with minimal command line experience.
The ADS-B Receiver Project website is located at https://www.adsbreceiver.net.
## Obtaining And Using This Software
### Obtaining And Using This Software
When setting up the portal you will have to choose between a lite or advanced installation. Advanced features adds flight logging and plotting and should only be chosen on devices running a more sturdy data storage solution.
*It is recommended that anyone using a SD card as they storage medium not attempt to use the advanced features.*
#### Manual installations...
### New installations...
sudo apt-get update
sudo apt-get install git
git clone https://github.com/jprochazka/adsb-receiver.git
git clone https://github.com/jprochazka/adsb-receiver
cd ~/adsb-receiver
chmod +x install.sh
./install.sh
#### Updating existing installations...
### Updating existing installations...
Your local repository will be updated each time install.sh is executed.
Your local repositories master branch will be updated each time install.sh is executed that is unless either the `--development` or `--branch <branch>` switch is used. Unless you are testing an upcoming release or wishing to contribute to the project you will generally not need to use either of these switches.
cd ~/adsb-receiver
./install.sh
#### Portal setup...
This step pertains to both fresh installations as well as when updating an existing installation. After running the installation scripts you will need to setup the portal by visiting the following web address.
http://<IP_ADDRESS_OF_YOUR_DEVICE>/install/
Supply the information asked for and submit the form once done to complete the setup.
### What Can Be Installed
## What Can Be Installed
The following software can be installed using these scripts.
**Decoders**
### The ADS-B Portal
* Dump1090 (FlightAware): https://github.com/flightaware/dump1090
* Dump978 (FlightAware): https://github.com/mutability/dump978
Included is the option to install the ADS-B Portal which offers the following features.
**Site Feeders**
* Saves all flights seen as well as displays a plot for the flight.
* Saves all ACARS and VDLM2 messages received and offers the ability to view them.
* Control what is displayed online via a web based administration area.
* A more uniform website site layout that can be easily navigated.
* Web accessible dump1090 and system performance graphs.
* Easy access to live dump1090 and dump978 maps.
* A blog which can be used to share your aircraft tracking experiences with others.
* Visitors can be informed when specific flights are being tracked.
* Administrators can be informed via email when specific flights are being tracked.
* Easily customize the look of your portal using the custom template system.
* ADS-B Exchange: https://adsbexchange.com
* FlightAware's PiAware: https://flightaware.com
* Flightradar24 Feeder Client: https://flightradar24.com
* OpenSky Feeder: https://opensky-network.org
* Plane Finder ADS-B Client: https://planefinder.net
When setting up the portal you will have to choose between a lite or advanced installation. Advanced features add flight logging and plotting and should only be chosen on devices running a sturdy data storage solution.
**Extras**
*It is highly recommended that anyone using a SD card as thier storage medium not attempt to use the advanced features.*
* ADS-B Receiver Project Portal: https://www.adsbreceiver.net
* Beast-Splitter: https://github.com/flightaware/beast-splitter
* DuckDNS.org Support: https://www.duckdns.org/
### Decoders
### Supported Operating Systems
* ACARSDEC: https://github.com/TLeconte/acarsdec
* Dump1090 (FlightAware): https://github.com/flightaware/dump1090
* Dump978 (FlightAware): https://github.com/flightaware/dump978
* Dumpvdl2: https://github.com/szpajder/dumpvdl2
* Readsb: https://github.com/wiedehopf/readsb
* VDLM2DEC: https://github.com/TLeconte/vdlm2dec
### Feeders
* ADS-B Exchange Feeder Client: https://adsbexchange.com
* Airplanes.live Feeder Client: https://airplanes.live
* FlightAware's PiAware: https://flightaware.com
* Flightradar24 Feeder Client: https://flightradar24.com
* Fly Italy ADS-B Feeder Client: https://flyitalyadsb.com
* OpenSky Feeder Client: https://opensky-network.org
* Plane Finder ADS-B Client: https://planefinder.net
### Extras
* Beast-Splitter: https://github.com/flightaware/beast-splitter
* DuckDNS.org Support: https://www.duckdns.org
* Graphs1090: https://github.com/wiedehopf/graphs1090
* tar1090: https://github.com/wiedehopf/tar1090
## Supported Operating Systems
The project currently supports the following Linux distributions.
* Debian Bookworm
* Debian Bullseye
* Rasbperry PI OS (Bookworm)
* Rasbperry PI OS Legacy (Bullseye)
* Armbian _(Bookworm, Jammy and Noble)_
* Debian _(Bookworm and Bullseye)_
* DietPi _(Bookworm and Bullseye)_
* Raspberry PI OS _(Bookworm and Bullseye)_
* Ubuntu _(Jammy Jellyfish, Focal Fossa and Noble Numbat*)_
### Useful Links
Support is available via this repository through the use of the issue tracker or discussions.
- GitHub Repository - https://github.com/jprochazka/adsb-receiver
- GitHub Wiki - https://github.com/jprochazka/adsb-receiver/wiki
- Changelog - https://github.com/jprochazka/adsb-receiver/blob/master/CHANGELOG.md
_* Please Note that Ubuntu Noble Numbat support employs an unofficial fix for PiAware._

Wyświetl plik

@ -0,0 +1,352 @@
#!/bin/bash
## PRE INSTALLATION OPERATIONS
source $RECEIVER_BASH_DIRECTORY/variables.sh
source $RECEIVER_BASH_DIRECTORY/functions.sh
clear
log_project_title
log_title_heading "Setting up the ACARSDEC decoder"
log_title_message "------------------------------------------------------------------------------"
if ! whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "ACARSDEC decoder Setup" \
--yesno "ACARSDEC is a multi-channels acars decoder with built-in rtl_sdr, airspy front end or sdrplay device. Since 3.0, It comes with a database backend : acarsserv to store received acars messages.\n\nWould you like to begin the setup process now?" \
11 78; then
echo ""
log_alert_heading "INSTALLATION HALTED"
log_alert_message "Setup has been halted at the request of the user"
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "ACARSDEC decoder setup halted"
echo ""
exit 1
fi
## GATHER REQUIRED INFORMATION FROM THE USER
log_heading "Determine the device type to build ACARSDEC for"
log_message "Asking which type of device will be used by ACARSDEC"
device=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "Device Type" \
--menu "Please choose the RTL-SDR device type which is to be used by ACARSDEC." \
11 78 3 \
"RTL-SDR" "" \
"AirSpy" "" \
"SDRPlay" "" \
3>&1 1>&2 2>&3)
exit_status=$?
if [[ $exit_status != 0 ]]; then
echo ""
log_alert_heading "INSTALLATION HALTED"
log_alert_message "Setup has been halted at the request of the user"
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "ACARSDEC decoder setup halted"
echo ""
exit 1
fi
ask_for_device_assignments "acarsdec"
if [[ $? -ne 0 ]] ; then
log_alert_heading "INSTALLATION HALTED"
log_alert_message "Setup has been halted due to lack of required information"
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "ACARSDEC decoder setup halted"
exit 1
fi
if [[ -z $RECEIVER_DEVICE_ASSIGNED_TO_ACARS_DECODER ]]; then
RECEIVER_DEVICE_ASSIGNED_TO_ACARS_DECODER="0"
fi
current_acars_frequencies="130.025 130.425 130.450 131.125 131.550"
if [[ "${acars_decoder_installed}" == "true" ]]; then
log_message "Determining which frequencies are currently assigned"
exec_start=`get_config "ExecStart" "/etc/systemd/system/acarsdec.service"`
current_acars_frequencies=`sed -e "s#.*-r ${RECEIVER_DEVICE_ASSIGNED_TO_ACARS_DECODER} \(\)#\1#" <<< "${exec_start}"`
fi
log_message "Asking the user for ACARS frequencies to monitor"
acars_fequencies_title="Enter ACARS Frequencies"
while [[ -z $acars_fequencies ]] ; do
acars_fequencies=$(whiptail --backtitle "ACARS Frequencies" \
--title "${acars_fequencies_title}" \
--inputbox "\nEnter the ACARS frequencies you would like to monitor." \
8 78 \
"${current_acars_frequencies}" 3>&1 1>&2 2>&3)
exit_status=$?
if [[ $exit_status != 0 ]]; then
log_alert_heading "INSTALLATION HALTED"
log_alert_message "Setup has been halted due to lack of required information"
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "ACARSDEC decoder setup halted"
exit 1
fi
acars_fequencies_title="Enter ACARS Frequencies (REQUIRED)"
done
## CHECK FOR PREREQUISITE PACKAGES
log_heading "Installing packages needed to fulfill dependencies for FlightAware PiAware client"
check_package cmake
check_package libjansson-dev
check_package libpaho-mqtt-dev
check_package libsndfile1-dev
check_package libsqlite3-dev
check_package libusb-1.0-0-dev
check_package libxml2-dev
check_package pkg-config
check_package zlib1g-dev
case $RECEIVER_OS_DISTRIBUTION in
ubuntu)
distro_php_version=""
;;
debian)
if [[ "${RECEIVER_OS_CODE_NAME}" == "bookworm" ]]; then distro_php_version="8.2"; fi
if [[ "${RECEIVER_OS_CODE_NAME}" == "bullseye" ]]; then distro_php_version="7.4"; fi
;;
esac
check_package sqlite3
check_package php${distro_php_version}-sqlite3
case "${device}" in
"RTL-SDR")
check_package librtlsdr-dev
;;
"AirSpy")
check_package libairspy-dev
;;
"SDRPlay")
check_package libmirisdr-dev
;;
esac
## BLACKLIST UNWANTED RTL-SDR MODULES
log_heading "Blacklist unwanted RTL-SDR kernel modules"
blacklist_modules
## CLONE OR PULL THE LIBACARS GIT REPOSITORY
log_heading "Preparing the libacars Git repository"
if [[ -d $RECEIVER_BUILD_DIRECTORY/libacars && -d $RECEIVER_BUILD_DIRECTORY/libacars/.git ]]; then
log_message "Entering the libacars git repository directory"
cd $RECEIVER_BUILD_DIRECTORY/libacars
log_message "Updating the local libacars git repository"
echo ""
git pull
else
log_message "Entering the libacars build directory"
cd $RECEIVER_BUILD_DIRECTORY
log_message "Cloning the libacars git repository locally"
echo ""
git clone https://github.com/szpajder/libacars.git
fi
## BUILD AND INSTALL THE LIBACARS LIBRARY
log_heading "Building the libacars library"
if [[ ! -d $RECEIVER_BUILD_DIRECTORY/libacars/build ]]; then
log_message "Creating the libacars build directory"
echo ""
mkdir -vp $RECEIVER_BUILD_DIRECTORY/libacars/build
echo ""
fi
if [[ -n "$(ls -A $RECEIVER_BUILD_DIRECTORY/libacars/build 2>/dev/null)" ]]; then
log_message "Deleting all files currently residing in the libacars build directory"
rm -rf $RECEIVER_BUILD_DIRECTORY/libacars/build/*
fi
log_message "Entering the libacars build directory"
cd $RECEIVER_BUILD_DIRECTORY/libacars/build
log_message "Executing cmake"
echo ""
cmake ../
echo ""
log_message "Executing make"
echo ""
make
echo ""
log_message "Executing make install"
echo ""
sudo make install
echo ""
log_message "Running ldconfig"
sudo ldconfig
## CLONE OR PULL THE ACARSDEC GIT REPOSITORY
log_heading "Preparing the ACARSDEC Git repository"
if [[ -d $RECEIVER_BUILD_DIRECTORY/acarsdec && -d $RECEIVER_BUILD_DIRECTORY/acarsdec/.git ]]; then
log_message "Entering the ACARSDEC git repository directory"
cd $RECEIVER_BUILD_DIRECTORY/acarsdec
log_message "Updating the local ACARSDEC git repository"
echo ""
git pull
else
log_message "Entering the build directory"
cd $RECEIVER_BUILD_DIRECTORY
log_message "Cloning the ACARSDEC git repository locally"
echo ""
git clone https://github.com/TLeconte/acarsdec.git
fi
## BUILD AND INSTALL THE ACARSDEC BINARY
log_heading "Building the ACARSDEC binary"
if [[ ! -d $RECEIVER_BUILD_DIRECTORY/acarsdec/build ]]; then
log_message "Creating the ACARSDEC build directory"
echo ""
mkdir -vp $RECEIVER_BUILD_DIRECTORY/acarsdec/build
echo ""
fi
if [[ -n "$(ls -A $RECEIVER_BUILD_DIRECTORY/acarsdec/build 2>/dev/null)" ]]; then
log_message "Deleting all files currently residing in the ACARSDEC build directory"
rm -rf $RECEIVER_BUILD_DIRECTORY/acarsdec/build/*
fi
log_message "Entering the ACARSDEC build directory"
cd $RECEIVER_BUILD_DIRECTORY/acarsdec/build
log_message "Executing cmake"
echo ""
case "${device}" in
"RTL-SDR")
cmake .. -Drtl=ON
;;
"AirSpy")
cmake .. -Dairspy=ON
;;
"SDRPlay")
cmake .. -Dsdrplay=ON
;;
esac
echo ""
log_message "Executing make"
echo ""
make
echo ""
log_message "Executing make install"
echo ""
sudo make install
## CLONE OR PULL THE ACARSSERV GIT REPOSITORY
log_heading "Preparing the acarsserv Git repository"
if [[ -d $RECEIVER_BUILD_DIRECTORY/acarsserv && -d $RECEIVER_BUILD_DIRECTORY/acarsserv/.git ]]; then
log_message "Entering the acarsserv git repository directory"
cd $RECEIVER_BUILD_DIRECTORY/acarsserv
log_message "Updating the local acarsserv git repository"
echo ""
git pull
else
log_message "Entering the build directory"
cd $RECEIVER_BUILD_DIRECTORY
log_message "Cloning the acarsserv git repository locally"
echo ""
git clone https://github.com/TLeconte/acarsserv.git
fi
## BUILD AND INSTALL THE ACARSSERV BINARY
log_heading "Building the ACARSSERV binary"
log_message "Entering the acarsserv build directory"
cd $RECEIVER_BUILD_DIRECTORY/acarsserv
log_message "Executing make"
echo ""
make -f Makefile
echo ""
## RUN ACARSDECO AND ACARSSERV
log_message "Creating the ACARSDEC systemd service script"
sudo tee /etc/systemd/system/acarsdec.service > /dev/null <<EOF
[Unit]
Description=ARCARSDEC multi-channel acars decoder.
After=network.target
[Service]
ExecStart=/usr/local/bin/acarsdec -j 127.0.0.1:5555 -o2 -g280 -r 0 130.025 130.425 130.450 131.125 131.550
WorkingDirectory=/usr/local/bin
StandardOutput=null
TimeoutSec=30
Restart=on-failure
RestartSec=30
StartLimitInterval=350
StartLimitBurst=10
[Install]
WantedBy=multi-user.target
EOF
log_message "Creating the ACARSSERV systemd service script"
sudo tee /etc/systemd/system/acarsserv.service > /dev/null <<EOF
[Unit]
Description=ARCARSSERV saves acars data to SQLite.
After=network.target
[Service]
ExecStart=${RECEIVER_BUILD_DIRECTORY}/acarsserv/acarsserv -j 127.0.0.1:5555
WorkingDirectory=${RECEIVER_BUILD_DIRECTORY}/acarsserv
StandardOutput=null
TimeoutSec=30
Restart=on-failure
RestartSec=30
StartLimitInterval=350
StartLimitBurst=10
[Install]
WantedBy=multi-user.target
EOF
log_message "Enabling then starting the ACARSDEC service"
sudo systemctl enable --now acarsdec.service
log_message "Enabling then starting the acarsserv service"
sudo systemctl enable --now acarsserv.service
## CONFIGURATION
assign_devices_to_decoders
## POST INSTALLATION OPERATIONS
whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "ACARSDEC Decoder Setup Complete" \
--msgbox "The setup process currently sets basic parameters needed to feed acarsserv. You can fine tune your installation by modifying the startup command found in the file /etc/systemd/system/acarsdec.service. Usage information for ACARSDEC can be found in the projects README at https://github.com/TLeconte/acarsdec." \
12 78
## SETUP COMPLETE
log_message "Returning to ${RECEIVER_PROJECT_TITLE} root directory"
cd $RECEIVER_ROOT_DIRECTORY
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "ACARSDEC decoder setup is complete"
echo ""
read -p "Press enter to continue..." discard
exit 0

Wyświetl plik

@ -1,210 +1,222 @@
#!/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-2024 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. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
## PRE INSTALLATION OPERATIONS
### INCLUDE EXTERNAL SCRIPTS
source ${RECEIVER_BASH_DIRECTORY}/variables.sh
source ${RECEIVER_BASH_DIRECTORY}/functions.sh
### BEGIN SETUP
source $RECEIVER_BASH_DIRECTORY/variables.sh
source $RECEIVER_BASH_DIRECTORY/functions.sh
clear
echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
echo ""
echo -e "\e[92m Setting up dump1090-fa..."
echo ""
echo -e "\e[93m ------------------------------------------------------------------------------\e[96m"
echo ""
whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Dump1090-fa Setup" --yesno "Dump 1090 is a Mode-S decoder specifically designed for RTL-SDR devices. Dump1090-fa is a fork of the dump1090-mutability version of dump1090 that is specifically designed for FlightAware's PiAware software.\n\nIn order to use this version of dump1090 FlightAware's PiAware software must be installed as well.\n\n https://github.com/flightaware/dump1090\n\nContinue setup by installing dump1090-fa?" 14 78
if [[ $? -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."
log_project_title
log_title_heading "Setting up the FlightAware Dump1090 decoder"
log_title_message "------------------------------------------------------------------------------"
if ! whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "FlightAware Dump1090 Decoder Setup" \
--yesno "FlightAware Dump1090 is an ADS-B, Mode S, and Mode 3A/3C demodulator and decoder that will receive and decode aircraft transponder messages received via a directly connected software defined radio, or from data provided over a network connection.\n\nWebsite: https://www.flightaware.com/\nGitHub Repository: https://github.com/flightaware/dump1090\n\nWould you like to begin the setup process now?" \
14 78; then
echo ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m Dump1090-fa setup halted.\e[39m"
log_alert_heading "INSTALLATION HALTED"
log_alert_message "Setup has been halted at the request of the user"
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "FlightAware Dump1090 decoder setup halted"
echo ""
read -p "Press enter to continue..." CONTINUE
exit 1
fi
## GATHER REQUIRED INFORMATION FROM THE USER
ask_for_device_assignments "dump1090-fa"
if [[ $? -ne 0 ]] ; then
log_alert_heading "INSTALLATION HALTED"
log_alert_message "Setup has been halted due to lack of required information"
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "ACARSDEC decoder setup halted"
exit 1
fi
## CHECK FOR PREREQUISITE PACKAGES
echo -e "\e[95m Installing packages needed to build and fulfill dependencies...\e[97m"
echo ""
CheckPackage build-essential
CheckPackage fakeroot
CheckPackage debhelper
CheckPackage librtlsdr-dev
CheckPackage pkg-config
CheckPackage libncurses-dev
CheckPackage libbladerf-dev
CheckPackage libhackrf-dev
CheckPackage liblimesuite-dev
CheckPackage libsoapysdr-dev
CheckPackage lighttpd
echo ""
log_heading "Installing packages needed to fulfill FlightAware Dump1090 decoder dependencies"
## DOWNLOAD OR UPDATE THE DUMP1090-FA SOURCE
check_package build-essential
check_package debhelper
check_package devscripts
check_package fakeroot
check_package libbladerf-dev
check_package libhackrf-dev
check_package liblimesuite-dev
check_package libncurses-dev
check_package librtlsdr-dev
check_package libsoapysdr-dev
check_package lighttpd
check_package pkg-config
echo -e "\e[95m Preparing the dump1090-fa Git repository...\e[97m"
echo ""
if [[ -d "${RECEIVER_BUILD_DIRECTORY}/dump1090-fa/dump1090" ]] && [[ -d "${RECEIVER_BUILD_DIRECTORY}/dump1090-fa/dump1090/.git" ]] ; then
# A directory with a git repository containing the source code already exists.
echo -e "\e[94m Entering the dump1090-fa git repository directory...\e[97m"
cd ${RECEIVER_BUILD_DIRECTORY}/dump1090-fa/dump1090 2>&1
echo -e "\e[94m Updating the local dump1090-fa git repository...\e[97m"
## BLACKLIST UNWANTED RTL-SDR MODULES
log_heading "Blacklist unwanted RTL-SDR kernel modules."
blacklist_modules
## CLONE OR PULL THE FLIGHTAWARE DUMP1090 DECODER SOURCE
log_heading "Preparing the FlightAware Dump1090 Git repository"
if [[ -d $RECEIVER_BUILD_DIRECTORY/dump1090-fa/dump1090 && -d $RECEIVER_BUILD_DIRECTORY/dump1090-fa/dump1090/.git ]]; then
log_message "Entering the dump1090 git repository directory"
cd $RECEIVER_BUILD_DIRECTORY/dump1090-fa/dump1090
log_message "Pulling the dump1090 git repository"
echo ""
git pull
git pull 2>&1 | tee -a $RECEIVER_LOG_FILE
else
# A directory containing the source code does not exist in the build directory.
echo -e "\e[94m Creating the ADS-B Receiver Project build directory...\e[97m"
log_message "Creating the FlightAware dump1090 Project build directory"
echo ""
mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/dump1090-fa
mkdir -v $RECEIVER_BUILD_DIRECTORY/dump1090-fa 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
echo -e "\e[94m Entering the dump1090-fa build directory...\e[97m"
cd ${RECEIVER_BUILD_DIRECTORY}/dump1090-fa 2>&1
echo -e "\e[94m Cloning the dump1090-fa git repository locally...\e[97m"
log_message "Entering the FlightAware dump1090 Project build directory"
cd $RECEIVER_BUILD_DIRECTORY/dump1090-fa
log_message "Cloning the dump1090 git repository"
echo ""
git clone https://github.com/flightaware/dump1090.git
git clone https://github.com/flightaware/dump1090.git 2>&1 | tee -a $RECEIVER_LOG_FILE
fi
## BUILD AND INSTALL THE DUMP1090-FA PACKAGE
echo ""
echo -e "\e[95m Building and installing the dump1090-fa package...\e[97m"
echo ""
echo -e "\e[94m Entering the dump1090-fa git repository directory...\e[97m"
cd ${RECEIVER_BUILD_DIRECTORY}/dump1090-fa/dump1090 2>&1
echo -e "\e[94m Building the dump1090-fa package...\e[97m"
echo ""
dpkg-buildpackage -b
echo ""
echo -e "\e[94m Entering the dump1090-fa build directory...\e[97m"
cd ${RECEIVER_BUILD_DIRECTORY}/dump1090-fa 2>&1
echo -e "\e[94m Installing the dump1090-fa package...\e[97m"
echo ""
echo "dump1090-fa_${DUMP1090_FA_VERSION}_*.deb"
sudo dpkg -i dump1090-fa_${DUMP1090_FA_VERSION}_*.deb
log_heading "Building the FlightAware dump1090-fa package"
# Check that the package was installed.
log_message "Entering the dump1090 Git repository"
cd $RECEIVER_BUILD_DIRECTORY/dump1090-fa/dump1090
log_message "Determining which distribution to build the package tree for"
case $RECEIVER_OS_CODE_NAME in
focal)
distro="buster"
;;
bullseye|jammy|bookworm|noble)
distro="bullseye"
;;
esac
log_message "Preparing to build dump1090-fa for ${distro}"
echo ""
echo -e "\e[94m Checking that the dump1090-fa package was installed properly...\e[97m"
if [[ $(dpkg-query -W -f='${STATUS}' dump1090-fa 2>/dev/null | grep -c "ok installed") -eq 0 ]] ; then
# If the dump1090-fa package could not be installed halt setup.
./prepare-build.sh $distro 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
log_message "Entering the package-${distro} directory"
cd $RECEIVER_BUILD_DIRECTORY/dump1090-fa/dump1090/package-$distro
log_message "Building the dump1090-fa Debian package"
echo ""
dpkg-buildpackage -b --no-sign 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
log_message "Installing the dump1090-fa Debian package"
echo ""
sudo dpkg -i $RECEIVER_BUILD_DIRECTORY/dump1090-fa/dump1090/dump1090-fa_$DUMP1090_FA_VERSION_*.deb 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
log_message "Checking that the dump1090-fa Debian package was installed"
if [[ $(dpkg-query -W -f='${STATUS}' dump1090-fa 2>/dev/null | grep -c "ok installed") -eq 0 ]]; then
echo ""
echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
echo -e " UNABLE TO INSTALL A REQUIRED PACKAGE."
echo -e " SETUP HAS BEEN TERMINATED!"
log_alert_heading "INSTALLATION HALTED"
echo ""
echo -e "\e[93mThe package \"dump1090-fa\" could not be installed.\e[39m"
log_alert_message "The dump1090-fa Debian package failed to install"
log_alert_message "Setup has been terminated"
echo ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m Dump1090-fa setup halted.\e[39m"
log_title_message "------------------------------------------------------------------------------"
log_title_heading "FlightAware Dump1090 decoder setup halted"
echo ""
read -p "Press enter to continue..." CONTINUE
read -p "Press enter to continue..." discard
exit 1
fi
# Create binary package archive directory.
if [[ ! -d "${RECEIVER_BUILD_DIRECTORY}/package-archive" ]] ; then
echo -e "\e[94m Creating package archive directory...\e[97m"
echo -e ""
mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/package-archive 2>&1
echo -e ""
if [[ ! -d $RECEIVER_BUILD_DIRECTORY/package-archive ]]; then
log_message "Creating the Debian package archive directory"
echo ""
mkdir -v $RECEIVER_BUILD_DIRECTORY/package-archive 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
fi
# Archive binary package.
echo -e "\e[94m Moving the dump1090-mutability binary package into the archive directory...\e[97m"
echo ""
cp -vf ${RECEIVER_BUILD_DIRECTORY}/dump1090-fa/*.deb ${RECEIVER_BUILD_DIRECTORY}/package-archive/ 2>&1
log_message "Copying the dump1090-fa Debian package into the Debian package archive directory"
echo ""
cp -vf $RECEIVER_BUILD_DIRECTORY/dump1090-fa/dump1090/*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ 2>&1 | tee -a $RECEIVER_LOG_FILE
## DUMP1090-FA POST INSTALLATION CONFIGURATION
# Ask for a Bing Maps API key.
DUMP1090_BING_MAPS_KEY=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Bing Maps API Key" --nocancel --inputbox "\nProvide a Bing Maps API key here to enable the Bing imagery layer.\nYou can obtain a free key at https://www.bingmapsportal.com/\n\nProviding a Bing Maps API key is not required to continue." 11 78 "${DUMP1090_BING_MAPS_KEY}" 3>&1 1>&2 2>&3)
if [[ -n "${DUMP1090_BING_MAPS_KEY}" ]] ; then
echo -e "\e[94m Setting the Bing Maps API Key to ${DUMP1090_BING_MAPS_KEY}...\e[97m"
ChangeConfig "BingMapsAPIKey" "${DUMP1090_BING_MAPS_KEY}" "/usr/share/dump1090-fa/html/config.js"
fi
## CONFIGURATION
# Download Heywhatsthat.com maximum range rings.
if [[ ! -f "/usr/share/dump1090-fa/html/upintheair.json" ]] ; then
if (whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Heywhaststhat.com Maximum Range Rings" --yesno "Maximum range rings can be added to dump1090-fa usings data obtained from Heywhatsthat.com. In order to add these rings to your dump1090-fa map you will first need to visit http://www.heywhatsthat.com and generate a new panorama centered on the location of your receiver. Once your panorama has been generated a link to the panorama will be displayed in the top left hand portion of the page. You will need the view id which is the series of letters and/or numbers after \"?view=\" in this URL.\n\nWould you like to add heywhatsthat.com maximum range rings to your map?" 16 78); then
# Set the DUMP1090_HEYWHATSTHAT_INSTALL variable to true.
DUMP1090_HEYWHATSTHAT_INSTALL="true"
assign_devices_to_decoders
# Ask the user for the Heywhatsthat.com panorama ID.
DUMP1090_HEYWHATSTHAT_ID_TITLE="Heywhatsthat.com Panorama ID"
while [[ -z "${DUMP1090_HEYWHATSTHAT_ID}" ]] ; do
DUMP1090_HEYWHATSTHAT_ID=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${DUMP1090_HEYWHATSTHAT_ID_TITLE}" --nocancel --inputbox "\nEnter your Heywhatsthat.com panorama ID." 8 78 3>&1 1>&2 2>&3)
DUMP1090_HEYWHATSTHAT_ID_TITLE="Heywhatsthat.com Panorama ID (REQUIRED)"
## POST INSTALLATION OPERATIONS
log_heading "Performing post installation operations"
log_message "Checking if a heywhatsthat upintheair.json file exists"
if [[ ! -f "/usr/share/dump1090-fa/html/upintheair.json" ]]; then
log_message "Asking the user if they want to add heywhatsthat maximum range rings"
if (whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "Setup heywhaststhat Maximum Range Rings" \
--yesno "Maximum range rings can be added to the FlightAware Dump1090 map usings data obtained from heywhatsthat. In order to add these rings to your FlightAware dump1090 map you will first need to visit http://www.heywhatsthat.com and generate a new panorama centered on the location of your receiver. Once your panorama has been generated a link to the panorama will be displayed in the top left hand portion of the page. You will need the view ID which is the series of letters and numbers after ?view= in the URL.\n\nWould you like to add heywhatsthat maximum range rings to your map?" \
16 78); then
log_message "Asking the user for the heywhatsthat panarama ID"
heywhatsthat_panorama_id_title="Enter the heywhatsthat Panorama ID"
while [[ -z $heywhatsthat_panorama_id ]] ; do
heywhatsthat_panorama_id=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "${heywhatsthat_panorama_id_title}" \
--inputbox "Please enter your Heywhatsthat panorama ID." \
8 78 3>&1 1>&2 2>&3)
whiptail_exit_status=$?
if [[ $whiptail_exit_status != 0 ]]; then
log_alert_message "Setup of heywhatsthat maximum range rings was cancelled"
break
fi
heywhatsthat_panorama_id_title="Enter the Heywhatsthat Panorama ID [REQUIRED]"
done
if [[ $whiptail_exit_status == 0 ]]; then
log_message "Asking the user what the altitude is for the first ring"
heywhatsthat_ring_one_altitude_title="First heywhatsthat Ring Altitude"
while [[ -z $heywhatsthat_ring_one_altitude ]] ; do
heywhatsthat_ring_one_altitude=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "${heywhatsthat_ring_one_altitude_title}" \
--nocancel \
--inputbox "Enter the first ring's altitude in meters.\n(default 3048 meters or 10000 feet)" \
8 78 \
"3048" 3>&1 1>&2 2>&3)
heywhatsthat_ring_one_altitude_title="First heywhatsthat Ring Altitude [REQUIRED]"
done
log_message "Asking the user what the altitude is for the second ring"
heywhatsthat_ring_two_altitude_title="Second heywhatsthat Ring Altitude"
while [[ -z $heywhatsthat_ring_two_altitude ]] ; do
heywhatsthat_ring_two_altitude=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "${heywhatsthat_ring_two_altitude_title}" \
--nocancel \
--inputbox "Enter the second ring's altitude in meters.\n(default 12192 meters or 40000 feet)" \
8 78 \
"12192" 3>&1 1>&2 2>&3)
heywhatsthat_ring_two_altitude_title="Second heywhatsthat Ring Altitude [REQUIRED]"
done
# Ask the user what altitude in meters to set the first range ring.
DUMP1090_HEYWHATSTHAT_RING_ONE_TITLE="Heywhatsthat.com First Ring Altitude"
while [[ -z "${DUMP1090_HEYWHATSTHAT_RING_ONE}" ]] ; do
DUMP1090_HEYWHATSTHAT_RING_ONE=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${DUMP1090_HEYWHATSTHAT_RING_ONE_TITLE}" --nocancel --inputbox "\nEnter the first ring's altitude in meters.\n(default 3048 meters or 10000 feet)" 8 78 "3048" 3>&1 1>&2 2>&3)
DUMP1090_HEYWHATSTHAT_RING_ONE_TITLE="Heywhatsthat.com First Ring Altitude (REQUIRED)"
done
# Ask the user what altitude in meters to set the second range ring.
DUMP1090_HEYWHATSTHAT_RING_TWO_TITLE="Heywhatsthat.com Second Ring Altitude"
while [[ -z "${DUMP1090_HEYWHATSTHAT_RING_TWO}" ]] ; do
DUMP1090_HEYWHATSTHAT_RING_TWO=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${DUMP1090_HEYWHATSTHAT_RING_TWO_TITLE}" --nocancel --inputbox "\nEnter the second ring's altitude in meters.\n(default 12192 meters or 40000 feet)" 8 78 "12192" 3>&1 1>&2 2>&3)
DUMP1090_HEYWHATSTHAT_RING_TWO_TITLE="Heywhatsthat.com Second Ring Altitude (REQUIRED)"
done
fi
# If the Heywhatsthat.com maximum range rings are to be added download them now.
if [[ "${DUMP1090_HEYWHATSTHAT_INSTALL}" = "true" ]] ; then
echo -e "\e[94m Downloading JSON data pertaining to the supplied panorama ID...\e[97m"
echo ""
sudo wget -O /usr/share/dump1090-fa/html/upintheair.json "http://www.heywhatsthat.com/api/upintheair.json?id=${DUMP1090_HEYWHATSTHAT_ID}&refraction=0.25&alts=${DUMP1090_HEYWHATSTHAT_RING_ONE},${DUMP1090_HEYWHATSTHAT_RING_TWO}"
echo ""
log_message "Downloading JSON data file assigned to panorama ID ${heywhatsthat_panorama_id}"
echo ""
sudo wget -v -O /usr/share/skyaware/html/upintheair.json "http://www.heywhatsthat.com/api/upintheair.json?id=${heywhatsthat_panarama_id}&refraction=0.25&alts=${heywhatsthat_ring_one_altitude},${heywhatsthat_ring_two_altitude}" 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
log_message "Heywhatsthat configuration complete"
fi
else
log_message "Heywhatsthat maximum range rings was skipped"
fi
fi
### SETUP COMPLETE
# Return to the project root directory.
echo -e "\e[94m Entering the ADS-B Receiver Project root directory...\e[97m"
cd ${RECEIVER_ROOT_DIRECTORY} 2>&1
## SETUP COMPLETE
log_message "Returning to ${RECEIVER_PROJECT_TITLE} root directory"
cd $RECEIVER_ROOT_DIRECTORY
echo ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m Dump1090-fa setup is complete.\e[39m"
log_title_message "------------------------------------------------------------------------------"
log_title_heading "FlightAware Dump1090 decoder setup is complete"
echo ""
read -p "Press enter to continue..." CONTINUE
read -p "Press enter to continue..." discard
exit 0

Wyświetl plik

@ -1,203 +1,167 @@
#!/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-2024 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. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
## PRE INSTALLATION OPERATIONS
### INCLUDE EXTERNAL SCRIPTS
source ${RECEIVER_BASH_DIRECTORY}/variables.sh
source ${RECEIVER_BASH_DIRECTORY}/functions.sh
### BEGIN SETUP
source $RECEIVER_BASH_DIRECTORY/variables.sh
source $RECEIVER_BASH_DIRECTORY/functions.sh
clear
echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
echo ""
echo -e "\e[92m Setting up dump978-fa..."
echo ""
echo -e "\e[93m ------------------------------------------------------------------------------\e[96m"
echo ""
whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Dump978-fa Setup" --yesno "This is the FlightAware 978MHz UAT decoder. It is a reimplementation in C++, loosely based on the demodulator from https://github.com/mutability/dump978.\n\n https://github.com/flightaware/dump978\n\nContinue setup by installing dump978-fa?" 14 78
if [[ $? -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."
log_project_title
log_title_heading "Setting up the FlightAware Dump978 decoder"
log_title_message "------------------------------------------------------------------------------"
if ! whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "FlightAware Dump978 Setup" \
--yesno "This is the FlightAware 978MHz UAT decoder. It is a reimplementation in C++, loosely based on the demodulator from https://github.com/mutability/dump978.\n\n https://github.com/flightaware/dump978\n\nContinue setup by installing dump978-fa?" \
14 78; then
echo ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m Dump978-fa setup halted.\e[39m"
log_alert_heading "INSTALLATION HALTED"
log_alert_message "Setup has been halted at the request of the user"
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "FlightAware Dump978 decoder setup halted"
echo ""
read -p "Press enter to continue..." CONTINUE
exit 1
fi
## GATHER REQUIRED INFORMATION FROM THE USER
ask_for_device_assignments "dump978-fa"
if [[ $? -ne 0 ]] ; then
log_alert_heading "INSTALLATION HALTED"
log_alert_message "Setup has been halted due to lack of required information"
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "ACARSDEC decoder setup halted"
exit 1
fi
## CHECK FOR PREREQUISITE PACKAGES
echo -e "\e[95m Installing packages needed to build and fulfill dependencies...\e[97m"
echo ""
CheckPackage build-essential
CheckPackage debhelper
CheckPackage libboost-system-dev
CheckPackage libboost-program-options-dev
CheckPackage libboost-regex-dev
CheckPackage libboost-filesystem-dev
CheckPackage libsoapysdr-dev
CheckPackage soapysdr-module-rtlsdr
echo ""
log_heading "Installing packages needed to fulfill FlightAware Dump978 decoder dependencies"
## DOWNLOAD OR UPDATE THE DUMP978-FA SOURCE
check_package build-essential
check_package debhelper
check_package libboost-filesystem-dev
check_package libboost-program-options-dev
check_package libboost-regex-dev
check_package libboost-system-dev
check_package libsoapysdr-dev
check_package lighttpd
check_package soapysdr-module-rtlsdr
echo -e "\e[95m Preparing the dump978-fa Git repository...\e[97m"
echo ""
if [[ -d "${RECEIVER_BUILD_DIRECTORY}/dump978-fa/dump978" ]] && [[ -d "${RECEIVER_BUILD_DIRECTORY}/dump978-fa/dump978/.git" ]] ; then
# A directory with a git repository containing the source code already exists.
echo -e "\e[94m Entering the dump978-fa git repository directory...\e[97m"
cd ${RECEIVER_BUILD_DIRECTORY}/dump978-fa/dump978 2>&1
echo -e "\e[94m Updating the local dump978-fa git repository...\e[97m"
## BLACKLIST UNWANTED RTL-SDR MODULES
log_heading "Blacklist unwanted RTL-SDR kernel modules"
blacklist_modules
## CLONE OR PULL THE FLIGHTAWARE DUMP978 DECODER SOURCE
log_heading "Preparing the FlightAware Dump978 Git repository"
if [[ -d $RECEIVER_BUILD_DIRECTORY/dump978-fa/dump978 && -d $RECEIVER_BUILD_DIRECTORY/dump978-fa/dump978/.git ]]; then
log_message "Entering the FlightAware dump978 git repository directory"
cd $RECEIVER_BUILD_DIRECTORY/dump978-fa/dump978
log_message "Pulling the dump1090 git repository"
echo ""
git pull
git pull 2>&1 | tee -a $RECEIVER_LOG_FILE
else
# A directory containing the source code does not exist in the build directory.
echo -e "\e[94m Creating the ADS-B Receiver Project build directory...\e[97m"
log_message "Creating the FlightAware dump978 Project build directory"
echo ""
mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/dump978-fa
mkdir -v $RECEIVER_BUILD_DIRECTORY/dump978-fa 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
echo -e "\e[94m Entering the dump978-fa build directory...\e[97m"
cd ${RECEIVER_BUILD_DIRECTORY}/dump978-fa 2>&1
echo -e "\e[94m Cloning the dump978-fa git repository locally...\e[97m"
log_message "Entering the ADS-B Receiver Project build directory"
cd $RECEIVER_BUILD_DIRECTORY/dump978-fa
log_message "Cloning the FlightAware dump978 git repository"
echo ""
git clone https://github.com/flightaware/dump978.git
git clone https://github.com/flightaware/dump978.git 2>&1 | tee -a $RECEIVER_LOG_FILE
fi
## BUILD AND INSTALL THE DUMP978-FA and SKYAWARE978 PACKAGES
log_heading "Building the FlightAware dump978-fa and skyaware978 packages"
log_message "Entering the dump978 Git repository"
cd $RECEIVER_BUILD_DIRECTORY/dump978-fa/dump978
log_message "Building the dump978-fa package"
echo ""
dpkg-buildpackage -b 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
## BUILD AND INSTALL THE DUMP978-FA PACKAGE
log_message "Installing the dump978-fa Debian package"
echo ""
sudo dpkg -i $RECEIVER_BUILD_DIRECTORY/dump978-fa/dump978-fa_*.deb 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
log_message "Installing the skyaware978 Debian package"
echo ""
sudo dpkg -i $RECEIVER_BUILD_DIRECTORY/dump978-fa/skyaware978_*.deb 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
echo -e "\e[95m Building and installing the dump978-fa package...\e[97m"
echo ""
echo -e "\e[94m Entering the dump978-fa git repository directory...\e[97m"
cd ${RECEIVER_BUILD_DIRECTORY}/dump978-fa/dump978 2>&1
echo -e "\e[94m Building the dump978-fa package...\e[97m"
echo ""
dpkg-buildpackage -b
echo ""
echo -e "\e[94m Entering the dump978-fa build directory...\e[97m"
cd ${RECEIVER_BUILD_DIRECTORY}/dump978-fa 2>&1
echo -e "\e[94m Installing the dump978-fa package...\e[97m"
echo ""
sudo dpkg -i ${RECEIVER_BUILD_DIRECTORY}/dump978-fa/dump978-fa_${DUMP978_FA_VERSION}_*.deb
echo ""
echo -e "\e[94m Installing the skyaware978 package...\e[97m"
echo ""
sudo dpkg -i ${RECEIVER_BUILD_DIRECTORY}/dump978-fa/skyaware978_${DUMP978_FA_VERSION}_*.deb
# Check that the package was installed.
echo ""
echo -e "\e[94m Checking that the dump978-fa package was installed properly...\e[97m"
if [[ $(dpkg-query -W -f='${STATUS}' dump978-fa 2>/dev/null | grep -c "ok installed") -eq 0 ]] ; then
# If the dump978-fa package could not be installed halt setup.
log_message "Checking that the dump978-fa Debian package was installed"
if [[ $(dpkg-query -W -f='${STATUS}' dump978-fa 2>/dev/null | grep -c "ok installed") -eq 0 ]]; then
echo ""
echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
echo -e " UNABLE TO INSTALL A REQUIRED PACKAGE."
echo -e " SETUP HAS BEEN TERMINATED!"
log_alert_heading "INSTALLATION HALTED"
echo ""
echo -e "\e[93mThe package \"dump978-fa\" could not be installed.\e[39m"
log_alert_message "The dump978-fa Debian package failed to install"
log_alert_message "Setup has been terminated"
echo ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m Dump978-fa setup halted.\e[39m"
log_title_message "------------------------------------------------------------------------------"
log_title_heading "FlightAware Dump978 decoder setup halted"
echo ""
read -p "Press enter to continue..." CONTINUE
read -p "Press enter to continue..." discard
exit 1
fi
# Create binary package archive directory.
if [[ ! -d "${RECEIVER_BUILD_DIRECTORY}/package-archive" ]] ; then
echo -e "\e[94m Creating package archive directory...\e[97m"
echo -e ""
mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/package-archive 2>&1
echo -e ""
log_message "Checking that the skyaware978 Debian package was installed"
if [[ $(dpkg-query -W -f='${STATUS}' skyaware978 2>/dev/null | grep -c "ok installed") -eq 0 ]]; then
echo ""
log_alert_heading "INSTALLATION HALTED"
echo ""
log_alert_message "The skyaware978 Debian package failed to install"
log_alert_message "Setup has been terminated"
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "FlightAware Dump978 decoder setup halted"
echo ""
read -p "Press enter to continue..." discard
exit 1
fi
# Archive binary package.
echo -e "\e[94m Moving the dump978-fa binary package into the archive directory...\e[97m"
echo ""
cp -vf ${RECEIVER_BUILD_DIRECTORY}/dump978-fa/*.deb ${RECEIVER_BUILD_DIRECTORY}/package-archive/ 2>&1
echo ""
### CONFIGURATION
# Check if the dump1090-fa package is installed.
echo -e "\e[94m Checking if the dump1090-fa package is installed...\e[97m"
if [[ $(dpkg-query -W -f='${STATUS}' dump1090-fa 2>/dev/null | grep -c "ok installed") -eq 1 ]]; then
# Check if dump978-fa has already been configured.
echo -e "\e[94m Checking if the dump978-fa package has been configured...\e[97m"
if grep -wq "driver=rtlsdr,serial=" /etc/default/dump978-fa; then
echo -e "\e[94m This dump978-fa installation appears to have been configured...\e[97m"
else
whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "RTL-SDR Dongle Assignments" --msgbox "It appears one of the dump1090 packages has been installed on this device. In order to run dump978 in tandem with dump1090 you will need to specifiy which RTL-SDR dongle each decoder is to use.\n\nKeep in mind in order to run both decoders on a single device you will need to have two separate RTL-SDR devices connected to your device." 12 78
# Ask the user which USB device is to be used for dump1090.
DUMP1090_DEVICE_SERIAL=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Dump1090 RTL-SDR Dongle" --nocancel --inputbox "\nEnter the serial number for your dump1090 RTL-SDR dongle." 8 78 3>&1 1>&2 2>&3)
while [[ -z "${DUMP1090_DEVICE_SERIAL}" ]] ; do
DUMP1090_DEVICE_SERIAL=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Dump1090 RTL-SDR Dongle (REQUIRED)" --nocancel --inputbox "\nEnter the serial number for your dump1090 RTL-SDR dongle." 8 78 3>&1 1>&2 2>&3)
done
# Ask the user which USB device is to be use for dump978.
DUMP978_DEVICE_SERIAL=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Dump978 RTL-SDR Dongle" --nocancel --inputbox "\nEnter the serial number for your dump978 RTL-SDR dongle." 8 78 3>&1 1>&2 2>&3)
while [[ -z "${DUMP978_DEVICE_SERIAL}" ]] ; do
DUMP978_DEVICE_SERIAL=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Dump978 RTL-SDR Dongle (REQUIRED)" --nocancel --inputbox "\nEnter the serial number for your dump978 RTL-SDR dongle." 8 78 3>&1 1>&2 2>&3)
done
# Assign the specified RTL-SDR dongle to dump978-fa.
echo -e "\e[94m Assigning RTL-SDR dongle \"${DUMP978_DEVICE_SERIAL}\" to dump978-fa...\e[97m"
sudo sed -i -e "s/driver=rtlsdr/driver=rtlsdr,serial=${DUMP978_DEVICE_SERIAL}/g" /etc/default/dump978-fa
echo -e "\e[94m Restarting dump978-fa...\e[97m"
sudo service dump978-fa force-reload
# Assign the specified RTL-SDR dongle to dump1090-fa.
if [[ $(dpkg-query -W -f='${STATUS}' dump1090-fa 2>/dev/null | grep -c "ok installed") -eq 1 ]] ; then
echo -e "\e[94m Assigning RTL-SDR dongle \"${DUMP1090_DEVICE_SERIAL}\" to dump1090-fa...\e[97m"
ChangeConfig "RECEIVER_SERIAL" ${DUMP1090_DEVICE_SERIAL} "/etc/default/dump1090-fa"
echo -e "\e[94m Restarting dump1090-fa...\e[97m"
sudo service dump1090-fa force-reload
fi
fi
if [[ ! -d $RECEIVER_BUILD_DIRECTORY/package-archive ]]; then
log_message "Creating the Debian package archive directory"
echo ""
mkdir -v $RECEIVER_BUILD_DIRECTORY/package-archive 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
fi
log_message "Copying the dump978-fa Debian package into the Debian package archive directory"
echo ""
cp -vf $RECEIVER_BUILD_DIRECTORY/dump978-fa/dump978-fa_*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
log_message "Copying the skyaware978 Debian package into the Debian package archive directory"
echo ""
cp -vf $RECEIVER_BUILD_DIRECTORY/dump978-fa/skyaware978_*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ 2>&1 | tee -a $RECEIVER_LOG_FILE
### SETUP COMPLETE
# Return to the project root directory.
echo -e "\e[94m Entering the ADS-B Receiver Project root directory...\e[97m"
cd ${RECEIVER_ROOT_DIRECTORY} 2>&1
## CONFIGURATION
assign_devices_to_decoders
## SETUP COMPLETE
log_message "Returning to ${RECEIVER_PROJECT_TITLE} root directory"
cd $RECEIVER_ROOT_DIRECTORY
echo ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m Dump978-fa setup is complete.\e[39m"
log_title_message "------------------------------------------------------------------------------"
log_title_heading "FlightAware Dump978 decoder setup is complete"
echo ""
read -p "Press enter to continue..." CONTINUE
read -p "Press enter to continue..." discard
exit 0

Wyświetl plik

@ -0,0 +1,255 @@
#!/bin/bash
## PRE INSTALLATION OPERATIONS
source $RECEIVER_BASH_DIRECTORY/variables.sh
source $RECEIVER_BASH_DIRECTORY/functions.sh
clear
log_project_title
log_title_heading "Setting up the dumpvdl2 decoder"
log_title_message "------------------------------------------------------------------------------"
if ! whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "dumpvdl2 decoder Setup" \
--yesno "dumpvdl2 is a VDL Mode 2 message decoder and protocol analyzer.\n\nWould you like to begin the setup process now?" \
11 78; then
echo ""
log_alert_heading "INSTALLATION HALTED"
log_alert_message "Setup has been halted at the request of the user"
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "dumpvdl2 decoder setup halted"
echo ""
exit 1
fi
## GATHER REQUIRED INFORMATION FROM THE USER
ask_for_device_assignments "dumpvdl2"
if [[ $? -ne 0 ]] ; then
log_alert_heading "INSTALLATION HALTED"
log_alert_message "Setup has been halted due to lack of required information"
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "Dumpvdl2 decoder setup halted"
exit 1
fi
current_vdlm2_frequencies="136.100 136.650 136.700 136.800 136.975"
if [[ -f /etc/systemd/system/dumpvdl2.service ]]; then
log_message "Determining which frequencies are currently assigned"
exec_start=`get_config "ExecStart" "/etc/systemd/system/dumpvdl2.service"`
current_vdlm2_frequencies=`sed -e "s#.*--correction ${vdlm2_correction} \(\)#\1#" <<< "${exec_start}"`
fi
log_message "Asking the user for VDL Mode 2 frequencies to monitor"
vdlm2_fequencies_title="Enter VDL Mode 2 Frequencies"
while [[ -z $vdlm2_fequencies ]] ; do
vdlm2_fequencies=$(whiptail --backtitle "VDL Mode 2 Frequencies" \
--title "${vdlm2_fequencies_title}" \
--inputbox "\nEnter the VDL Mode 2 frequencies you would like to monitor." \
8 78 \
"${current_vdlm2_frequencies}" 3>&1 1>&2 2>&3)
exit_status=$?
if [[ $exit_status != 0 ]]; then
log_alert_heading "INSTALLATION HALTED"
log_alert_message "Setup has been halted due to lack of required information"
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "Dumpvdl2 decoder setup halted"
exit 1
fi
vdlm2_fequencies_title="Enter VDL Frequencies (REQUIRED)"
done
## CHECK FOR PREREQUISITE PACKAGES
log_heading "Installing packages needed to fulfill dependencies for FlightAware PiAware client"
check_package build-essential
check_package cmake
check_package git
check_package libglib2.0-dev
check_package libjansson-dev
check_package libprotobuf-c-dev
check_package librtlsdr-dev
check_package libsqlite3-dev
check_package libxml2-dev
check_package libzmq3-dev
check_package pkg-config
check_package zlib1g-dev
case $RECEIVER_OS_DISTRIBUTION in
ubuntu)
distro_php_version=""
;;
debian)
if [[ "${RECEIVER_OS_CODE_NAME}" == "bookworm" ]]; then distro_php_version="8.2"; fi
if [[ "${RECEIVER_OS_CODE_NAME}" == "bullseye" ]]; then distro_php_version="7.4"; fi
;;
esac
check_package sqlite3
check_package php${distro_php_version}-sqlite3
## BLACKLIST UNWANTED RTL-SDR MODULES
log_heading "Blacklist unwanted RTL-SDR kernel modules"
blacklist_modules
## CLONE OR PULL THE LIBACARS GIT REPOSITORY
log_heading "Preparing the libacars Git repository"
if [[ -d $RECEIVER_BUILD_DIRECTORY/libacars && -d $RECEIVER_BUILD_DIRECTORY/libacars/.git ]]; then
log_message "Entering the libacars git repository directory"
cd $RECEIVER_BUILD_DIRECTORY/libacars
log_message "Updating the local libacars git repository"
echo ""
git pull
else
log_message "Entering the libacars build directory"
cd $RECEIVER_BUILD_DIRECTORY
log_message "Cloning the libacars git repository locally"
echo ""
git clone https://github.com/szpajder/libacars.git
fi
## BUILD AND INSTALL THE LIBACARS LIBRARY
log_heading "Building the libacars library"
if [[ ! -d $RECEIVER_BUILD_DIRECTORY/libacars/build ]]; then
log_message "Creating the libacars build directory"
echo ""
mkdir -vp $RECEIVER_BUILD_DIRECTORY/libacars/build
echo ""
fi
if [[ -n "$(ls -A $RECEIVER_BUILD_DIRECTORY/libacars/build 2>/dev/null)" ]]; then
log_message "Deleting all files currently residing in the libacars build directory"
rm -rf $RECEIVER_BUILD_DIRECTORY/libacars/build/*
fi
log_message "Entering the libacars build directory"
cd $RECEIVER_BUILD_DIRECTORY/libacars/build
log_message "Executing cmake"
echo ""
cmake ../
echo ""
log_message "Executing make"
echo ""
make
echo ""
log_message "Executing make install"
echo ""
sudo make install
echo ""
log_message "Running ldconfig"
sudo ldconfig
## CLONE OR PULL THE DUMPVDL2 GIT REPOSITORY
log_heading "Preparing the dumpvdl2 Git repository"
if [[ -d $RECEIVER_BUILD_DIRECTORY/dumpvdl2 && -d $RECEIVER_BUILD_DIRECTORY/dumpvdl2/.git ]]; then
log_message "Entering the dumpvdl2 git repository directory"
cd $RECEIVER_BUILD_DIRECTORY/dumpvdl2
log_message "Updating the local dumpvdl2 git repository"
echo ""
git pull
else
log_message "Entering the build directory"
cd $RECEIVER_BUILD_DIRECTORY
log_message "Cloning the dumpvdl2 git repository locally"
echo ""
git clone https://github.com/szpajder/dumpvdl2.git
fi
## BUILD AND INSTALL THE DUMPVDL2 BINARY
log_heading "Building the dumpvdl2 binary"
if [[ ! -d $RECEIVER_BUILD_DIRECTORY/dumpvdl2/build ]]; then
log_message "Creating the dumpvdl2 build directory"
echo ""
mkdir -vp $RECEIVER_BUILD_DIRECTORY/dumpvdl2/build
echo ""
fi
if [[ -n "$(ls -A $RECEIVER_BUILD_DIRECTORY/dumpvdl2/build 2>/dev/null)" ]]; then
log_message "Deleting all files currently residing in the dumpvdl2 build directory"
rm -rf $RECEIVER_BUILD_DIRECTORY/dumpvdl2/build/*
fi
log_message "Entering the dumpvdl2 build directory"
cd $RECEIVER_BUILD_DIRECTORY/dumpvdl2/build
log_message "Executing cmake"
echo ""
cmake ../
echo ""
log_message "Executing make"
echo ""
make
echo ""
log_message "Executing make install"
echo ""
sudo make install
## RUN DUMPVDL2
log_message "Creating the dumpvdl2 systemd service script"
sudo tee /etc/systemd/system/dumpvdl2.service > /dev/null <<EOF
[Unit]
Description=Dumpvdl2 VDL Mode 2 message decoder and protocol analyzer.
After=network.target
[Service]
ExecStart=/usr/local/bin/dumpvdl2 --rtlsdr 0 --gain 40 --correction 42 ${current_vdlm2_frequencies}
WorkingDirectory=/usr/local/bin
StandardOutput=null
TimeoutSec=30
Restart=on-failure
RestartSec=30
StartLimitInterval=350
StartLimitBurst=10
[Install]
WantedBy=multi-user.target
EOF
log_message "Enabling then starting the dumpvdl2 service"
sudo systemctl enable --now dumpvdl2.service
log_message "Enabling then starting the dumpvdl2 service"
sudo systemctl enable --now dumpvdl2.service
## CONFIGURATION
assign_devices_to_decoders
## POST INSTALLATION OPERATIONS
whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "Dumpvdl2 Decoder Setup Complete" \
--msgbox "The setup process currently sets basic parameters needed to run a basic dumpvdl2 setup. You can fine tune your installation by modifying the startup command found in the file /etc/systemd/system/dumpvdl2.service. Usage information for dumpvdl2 can be found in the projects README at https://github.com/szpajder/dumpvdl2." \
12 78
## SETUP COMPLETE
log_message "Returning to ${RECEIVER_PROJECT_TITLE} root directory"
cd $RECEIVER_ROOT_DIRECTORY
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "Dumpvdl2 decoder setup is complete"
echo ""
read -p "Press enter to continue..." discard
exit 0

Wyświetl plik

@ -0,0 +1,155 @@
#!/bin/bash
## PRE INSTALLATION OPERATIONS
source $RECEIVER_BASH_DIRECTORY/variables.sh
source $RECEIVER_BASH_DIRECTORY/functions.sh
clear
log_project_title
log_title_heading "Setting up the Readsb decoder"
log_title_message "------------------------------------------------------------------------------"
if ! whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "Readsb Decoder Setup" \
--yesno "Readsb is a Mode-S/ADSB/TIS decoder for RTLSDR, BladeRF, Modes-Beast and GNS5894 devices.\n\nRepository: https://github.com/wiedehopf/readsb\n\nWould you like to begin the setup process now?" \
14 78; then
echo ""
log_alert_heading "INSTALLATION HALTED"
log_alert_message "Setup has been halted at the request of the user"
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "Readsb decoder setup halted"
echo ""
exit 1
fi
## GATHER REQUIRED INFORMATION FROM THE USER
ask_for_device_assignments "readsb"
if [[ $? -ne 0 ]] ; then
log_alert_heading "INSTALLATION HALTED"
log_alert_message "Setup has been halted due to lack of required information"
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "Readsb decoder setup halted"
exit 1
fi
## CHECK FOR PREREQUISITE PACKAGES
log_heading "Installing packages needed to fulfill FlightAware Dump1090 decoder dependencies"
check_package build-essential
check_package debhelper
check_package git
check_package fakeroot
check_package libncurses-dev
check_package librtlsdr-dev
check_package libusb-1.0-0-dev
check_package libzstd1
check_package libzstd-dev
check_package pkg-config
check_package zlib1g
check_package zlib1g-dev
## BLACKLIST UNWANTED RTL-SDR MODULES
log_heading "Blacklist unwanted RTL-SDR kernel modules."
blacklist_modules
## CLONE OR PULL THE READSB DECODER SOURCE
log_heading "Preparing the Readsb Git repository"
if [[ -d $RECEIVER_BUILD_DIRECTORY/readsb/readsb && -d $RECEIVER_BUILD_DIRECTORY/readsb/readsb/.git ]]; then
log_message "Entering the Readsb git repository directory"
cd $RECEIVER_BUILD_DIRECTORY/readsb/readsb
log_message "Pulling the Readsb git repository"
echo ""
git pull 2>&1 | tee -a $RECEIVER_LOG_FILE
else
log_message "Creating the Readsb Project build directory"
echo ""
mkdir -v $RECEIVER_BUILD_DIRECTORY/readsb 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
log_message "Entering the Readsb Project build directory"
cd $RECEIVER_BUILD_DIRECTORY/readsb
log_message "Cloning the readsb git repository"
echo ""
git clone https://github.com/wiedehopf/readsb.git 2>&1 | tee -a $RECEIVER_LOG_FILE
fi
## BUILD AND INSTALL THE DUMP1090-FA PACKAGE
log_heading "Building the FlightAware dump1090-fa package"
log_message "Entering the dump1090 Git repository"
cd $RECEIVER_BUILD_DIRECTORY/readsb/readsb
log_message "Setting build options"
export DEB_BUILD_OPTIONS=noddebs
log_message "Building the Readsb Debian package"
echo ""
dpkg-buildpackage -b -Prtlsdr -ui -uc -us
echo ""
log_message "Installing the Readsb Debian package"
echo ""
sudo dpkg -i $RECEIVER_BUILD_DIRECTORY/readsb/readsb_*.deb
echo ""
log_message "Checking that the Readsb Debian package was installed"
if [[ $(dpkg-query -W -f='${STATUS}' readsb 2>/dev/null | grep -c "ok installed") -eq 0 ]]; then
echo ""
log_alert_heading "INSTALLATION HALTED"
echo ""
log_alert_message "The Readsb Debian package failed to install"
log_alert_message "Setup has been terminated"
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "Readsb decoder setup halted"
echo ""
read -p "Press enter to continue..." discard
exit 1
fi
if [[ ! -d $RECEIVER_BUILD_DIRECTORY/package-archive ]]; then
log_message "Creating the Debian package archive directory"
echo ""
mkdir -v $RECEIVER_BUILD_DIRECTORY/package-archive 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
fi
log_message "Copying the Readsb Debian package into the Debian package archive directory"
echo ""
cp -vf $RECEIVER_BUILD_DIRECTORY/readsb/*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ 2>&1 | tee -a $RECEIVER_LOG_FILE
## CONFIGURATION
assign_devices_to_decoders
## POST INSTALLATION OPERATIONS
log_heading "Performing post installation operations"
log_message "Unsetting build options"
unset DEB_BUILD_OPTIONS
## SETUP COMPLETE
log_message "Returning to ${RECEIVER_PROJECT_TITLE} root directory"
cd $RECEIVER_ROOT_DIRECTORY
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "Readsb decoder setup is complete"
echo ""
read -p "Press enter to continue..." discard
exit 0

Wyświetl plik

@ -0,0 +1,328 @@
#!/bin/bash
## PRE INSTALLATION OPERATIONS
source $RECEIVER_BASH_DIRECTORY/variables.sh
source $RECEIVER_BASH_DIRECTORY/functions.sh
clear
log_project_title
log_title_heading "Setting up the VDLM2DEC decoder"
log_title_message "------------------------------------------------------------------------------"
if ! whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "VDLM2DEC decoder Setup" \
--yesno "VDLM2DEC is a vdl mode 2 decoder with built-in rtl_sdr or airspy front end.\n\nWould you like to begin the setup process now?" \
11 78; then
echo ""
log_alert_heading "INSTALLATION HALTED"
log_alert_message "Setup has been halted at the request of the user"
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "VDLM2DEC decoder setup halted"
echo ""
exit 1
fi
## GATHER REQUIRED INFORMATION FROM THE USER
log_heading "Determine the device type to build VDLM2DEC for"
log_message "Asking which type of device will be used by VDLM2DEC"
device=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "Device Type" \
--menu "Please choose the RTL-SDR device type which is to be used by VDLM2DEC." \
11 78 3 \
"RTL-SDR" "" \
"AirSpy" "" \
3>&1 1>&2 2>&3)
exit_status=$?
if [[ $exit_status != 0 ]]; then
echo ""
log_alert_heading "INSTALLATION HALTED"
log_alert_message "Setup has been halted at the request of the user"
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "VDLM2DEC decoder setup halted"
echo ""
exit 1
fi
ask_for_device_assignments "vdlm2dec"
if [[ $? -ne 0 ]] ; then
log_alert_heading "INSTALLATION HALTED"
log_alert_message "Setup has been halted due to lack of required information"
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "VDLM2DEC decoder setup halted"
exit 1
fi
current_vdlm2_frequencies="136.100 136.650 136.700 136.800 136.975"
if [[ -f /etc/systemd/system/dumpvdl2.service ]]; then
log_message "Determining which frequencies are currently assigned"
exec_start=`get_config "ExecStart" "/etc/systemd/system/vdlm2dec.service"`
current_vdlm2_frequencies=`sed -e "s#.*-r ${RECEIVER_DEVICE_ASSIGNED_TO_VDLM2_DECODER} \(\)#\1#" <<< "${exec_start}"`
fi
log_message "Asking the user for VDL Mode 2 frequencies to monitor"
vdlm2_fequencies_title="Enter VDL Mode 2 Frequencies"
while [[ -z $vdlm2_fequencies ]] ; do
vdlm2_fequencies=$(whiptail --backtitle "VDL Mode 2 Frequencies" \
--title "${vdlm2_fequencies_title}" \
--inputbox "\nEnter the VDL Mode 2 frequencies you would like to monitor." \
8 78 \
"${current_vdlm2_frequencies}" 3>&1 1>&2 2>&3)
exit_status=$?
if [[ $exit_status != 0 ]]; then
log_alert_heading "INSTALLATION HALTED"
log_alert_message "Setup has been halted due to lack of required information"
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "VDLM2DEC decoder setup halted"
exit 1
fi
vdlm2_fequencies_title="Enter VDL Frequencies (REQUIRED)"
done
## CHECK FOR PREREQUISITE PACKAGES
check_package cmake
check_package libjansson-dev
check_package libsqlite3-dev
check_package libxml2-dev
check_package zlib1g-dev
case $RECEIVER_OS_DISTRIBUTION in
ubuntu)
distro_php_version=""
;;
debian)
if [[ "${RECEIVER_OS_CODE_NAME}" == "bookworm" ]]; then distro_php_version="8.2"; fi
if [[ "${RECEIVER_OS_CODE_NAME}" == "bullseye" ]]; then distro_php_version="7.4"; fi
;;
esac
check_package sqlite3
check_package php${distro_php_version}-sqlite3
## BLACKLIST UNWANTED RTL-SDR MODULES
log_heading "Blacklist unwanted RTL-SDR kernel modules"
blacklist_modules
## CLONE OR PULL THE LIBACARS GIT REPOSITORY
log_heading "Preparing the libacars Git repository"
if [[ -d $RECEIVER_BUILD_DIRECTORY/libacars && -d $RECEIVER_BUILD_DIRECTORY/libacars/.git ]]; then
log_message "Entering the libacars git repository directory"
cd $RECEIVER_BUILD_DIRECTORY/libacars
log_message "Updating the local libacars git repository"
echo ""
git pull
else
log_message "Entering the libacars build directory"
cd $RECEIVER_BUILD_DIRECTORY
log_message "Cloning the libacars git repository locally"
echo ""
git clone https://github.com/szpajder/libacars.git
fi
## BUILD AND INSTALL THE LIBACARS LIBRARY
log_heading "Building the libacars library"
if [[ ! -d $RECEIVER_BUILD_DIRECTORY/libacars/build ]]; then
log_message "Creating the libacars build directory"
echo ""
mkdir -vp $RECEIVER_BUILD_DIRECTORY/libacars/build
echo ""
fi
if [[ -n "$(ls -A $RECEIVER_BUILD_DIRECTORY/libacars/build 2>/dev/null)" ]]; then
log_message "Deleting all files currently residing in the libacars build directory"
rm -rf $RECEIVER_BUILD_DIRECTORY/libacars/build/*
fi
log_message "Entering the libacars build directory"
cd $RECEIVER_BUILD_DIRECTORY/libacars/build
log_message "Executing cmake"
echo ""
cmake ../
echo ""
log_message "Executing make"
echo ""
make
echo ""
log_message "Executing make install"
echo ""
sudo make install
echo ""
log_message "Running ldconfig"
sudo ldconfig
## CLONE OR PULL THE VDLM2DEC GIT REPOSITORY
log_heading "Preparing the VDLM2DEC Git repository"
if [[ -d $RECEIVER_BUILD_DIRECTORY/vdlm2dec && -d $RECEIVER_BUILD_DIRECTORY/vdlm2dec/.git ]]; then
log_message "Entering the VDLM2DEC git repository directory"
cd $RECEIVER_BUILD_DIRECTORY/vdlm2dec
log_message "Updating the local VDLM2DEC git repository"
echo ""
git pull
else
log_message "Entering the build directory"
cd $RECEIVER_BUILD_DIRECTORY
log_message "Cloning the VDLM2DEC git repository locally"
echo ""
git clone https://github.com/TLeconte/vdlm2dec.git
fi
## BUILD AND INSTALL THE VDLM2DEC BINARY
log_heading "Building the VDLM2DEC binary"
if [[ ! -d $RECEIVER_BUILD_DIRECTORY/vdlm2dec/build ]]; then
log_message "Creating the VDLM2DEC build directory"
echo ""
mkdir -vp $RECEIVER_BUILD_DIRECTORY/vdlm2dec/build
echo ""
fi
if [[ -n "$(ls -A $RECEIVER_BUILD_DIRECTORY/vdlm2dec/build 2>/dev/null)" ]]; then
log_message "Deleting all files currently residing in the VDLM2DEC build directory"
rm -rf $RECEIVER_BUILD_DIRECTORY/vdlm2dec/build/*
fi
log_message "Entering the VDLM2DEC build directory"
cd $RECEIVER_BUILD_DIRECTORY/vdlm2dec/build
log_message "Executing cmake"
echo ""
case "${device}" in
"RTL-SDR")
cmake .. -Drtl=ON
;;
"AirSpy")
cmake .. -Dairspy=ON
;;
esac
echo ""
log_message "Executing make"
echo ""
make
echo ""
log_message "Executing make install"
echo ""
sudo make install
## CLONE OR PULL THE ACARSSERV GIT REPOSITORY
log_heading "Preparing the acarsserv Git repository"
if [[ -d $RECEIVER_BUILD_DIRECTORY/acarsserv && -d $RECEIVER_BUILD_DIRECTORY/acarsserv/.git ]]; then
log_message "Entering the acarsserv git repository directory"
cd $RECEIVER_BUILD_DIRECTORY/acarsserv
log_message "Updating the local acarsserv git repository"
echo ""
git pull
else
log_message "Entering the build directory"
cd $RECEIVER_BUILD_DIRECTORY
log_message "Cloning the acarsserv git repository locally"
echo ""
git clone https://github.com/TLeconte/acarsserv.git
fi
## BUILD AND INSTALL THE ACARSSERV BINARY
log_heading "Building the ACARSSERV binary"
log_message "Entering the acarsserv build directory"
cd $RECEIVER_BUILD_DIRECTORY/acarsserv
log_message "Executing make"
echo ""
make -f Makefile
echo ""
## RUN VDLM2DEC AND ACARSSERV
log_message "Creating the VDLM2DEC systemd service script"
sudo tee /etc/systemd/system/vdlm2dec.service > /dev/null <<EOF
[Unit]
Description=ARCARSDEC multi-channel acars decoder.
After=network.target
[Service]
ExecStart=/usr/local/bin/vdlm2dec -j 127.0.0.1:5555 -G -g280 -r 0 ${current_vdlm2_frequencies}
WorkingDirectory=/usr/local/bin
StandardOutput=null
TimeoutSec=30
Restart=on-failure
RestartSec=30
StartLimitInterval=350
StartLimitBurst=10
[Install]
WantedBy=multi-user.target
EOF
log_message "Creating the ACARSSERV systemd service script"
sudo tee /etc/systemd/system/acarsserv.service > /dev/null <<EOF
[Unit]
Description=ARCARSSERV saves acars data to SQLite.
After=network.target
[Service]
ExecStart=${RECEIVER_BUILD_DIRECTORY}/acarsserv/acarsserv -j 127.0.0.1:5555
WorkingDirectory=${RECEIVER_BUILD_DIRECTORY}/acarsserv
StandardOutput=null
TimeoutSec=30
Restart=on-failure
RestartSec=30
StartLimitInterval=350
StartLimitBurst=10
[Install]
WantedBy=multi-user.target
EOF
log_message "Enabling then starting the VDLM2DEC service"
sudo systemctl enable --now vdlm2dec.service
log_message "Enabling then starting the acarsserv service"
sudo systemctl enable --now acarsserv.service
## CONFIGURATION
assign_devices_to_decoders
## POST INSTALLATION OPERATIONS
whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "VDLM2DEC Decoder Setup Complete" \
--msgbox "The setup process currently sets basic parameters needed to feed acarsserv. You can fine tune your installation by modifying the startup command found in the file /etc/systemd/system/vdlm2dec.service. Usage information for VDLM2DEC can be found in the projects README at https://github.com/TLeconte/vdlm2dec." \
12 78
## SETUP COMPLETE
log_message "Returning to ${RECEIVER_PROJECT_TITLE} root directory"
cd $RECEIVER_ROOT_DIRECTORY
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "VDLM2DEC decoder setup is complete"
echo ""
read -p "Press enter to continue..." discard
exit 0

Wyświetl plik

@ -1,161 +1,180 @@
#!/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-2024 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. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
## PRE INSTALLATION OPERATIONS
source ${RECEIVER_BASH_DIRECTORY}/variables.sh
source ${RECEIVER_BASH_DIRECTORY}/functions.sh
## BEGIN SETUP
source $RECEIVER_BASH_DIRECTORY/variables.sh
source $RECEIVER_BASH_DIRECTORY/functions.sh
clear
echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
echo -e ""
echo -e "\e[92m Setting up beast-splitter..."
echo -e "\e[93m ------------------------------------------------------------------------------\e[96m"
echo -e ""
whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Beast-Splitter Setup" --yesno "beast-splitter is a helper utility for the Mode-S Beast.\n\nThe Beast provides a single data stream over a (USB) serial port. If you have more than one thing that wants to read that data stream, you need something to redistribute the data. This is what beast-splitter does.\n\n https://github.com/flightaware/beast-splitter\n\nContinue beast-splitter setup?" 15 78
if [[ $? -eq 1 ]] ; then
# Setup has been halted by the user.
log_project_title
log_title_heading "Setting up beast-splitter"
log_title_message "------------------------------------------------------------------------------"
if ! whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "Beast-Splitter Setup" \
--yesno "beast-splitter is a helper utility for the Mode-S Beast.\n\nThe Beast provides a single data stream over a (USB) serial port. If you have more than one thing that wants to read that data stream, you need something to redistribute the data. This is what beast-splitter does.\n\n https://github.com/flightaware/beast-splitter\n\nContinue beast-splitter setup?" \
15 78; then
echo ""
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 ------------------------------------------------------------------------------\e[96m"
echo -e "\e[92m beast-splitter setup halted.\e[39m"
echo -e ""
read -p "Press enter to continue..." CONTINUE
read -p "Press enter to continue..." discard
exit 1
fi
## GATHER CONFIGURATION OPTIONS
whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Enable Beast Splitter" --defaultno --yesno "By default Beast Splitter is disabled. Would you like to enable Beast Splitter now?" 8 65
if [[ $? -eq 0 ]]; then
enabled="true"
## GATHER REQUIRED INFORMATION FROM THE USER
log_heading "Gather information required to configure beast-splitter"
log_message "Asking user if beast-splitter should be enabled"
if whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "Enable Beast Splitter" \
--defaultno \
--yesno "By default Beast Splitter is disabled. Would you like to enable Beast Splitter now?" 8 65; then
enable_beastsplitter="true"
else
enabled="false"
enable_beastsplitter="false"
fi
input_options=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Input Options for Beast Splitter" --nocancel --inputbox "Enter the option telling Beast Splitter where to read data from. You should provide one of the following either --net or --serial.\n\nExamples:\n--serial /dev/beast\n--net remotehost:remoteport" 8 78 3>&1 1>&2 2>&3)
output_options=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Output Options for Beast Splitter" --nocancel --inputbox "Enter the option to tell Beast Splitter where to send output data. You can do so by establishing an outgoing connection or accepting inbound connections.\\Examples:\n--connect remotehost:remoteport\n --listen remotehost:remoteport" 8 78 3>&1 1>&2 2>&3)
log_message "Asking user for the beast-splitter input option"
input_options=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "Input Options for Beast Splitter" \
--inputbox "Enter the option telling Beast Splitter where to read data from. You should provide one of the following either --net or --serial.\n\nExamples:\n--serial /dev/beast\n--net remotehost:remoteport" \
8 78 3>&1 1>&2 2>&3)
if [[ $input_options == 0 ]]; then
log_alert_heading "INSTALLATION HALTED"
log_alert_message "Setup has been halted due to lack of required information"
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "beast-splitter setup halted"
exit 1
fi
log_message "Asking user for the beast-splitter output option"
output_options=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "Output Options for Beast Splitter" \
--nocancel --inputbox "Enter the option to tell Beast Splitter where to send output data. You can do so by establishing an outgoing connection or accepting inbound connections.\\Examples:\n--connect remotehost:remoteport\n --listen remotehost:remoteport" \
8 78 3>&1 1>&2 2>&3)
if [[ $output_options == 0 ]]; then
log_alert_heading "INSTALLATION HALTED"
log_alert_message "Setup has been halted due to lack of required information"
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "beast-splitter setup halted"
exit 1
fi
## CHECK FOR PREREQUISITE PACKAGES
echo -e "\e[95m Checking that the required packages are installed...\e[97m"
echo -e ""
CheckPackage build-essential
CheckPackage debhelper
CheckPackage libboost-system-dev
CheckPackage libboost-program-options-dev
CheckPackage libboost-regex-dev
echo ""
log_heading "Installing packages needed to fulfill beast-splitter dependencies"
## DOWNLOAD SOURCE
check_package build-essential
check_package debhelper
check_package libboost-system-dev
check_package libboost-program-options-dev
check_package libboost-regex-dev
echo -e "\e[95m Downloading the beast-splitter repository from GitHub...\e[97m"
echo -e ""
echo -e "\e[94m Checking if the Git repository has already been cloned...\e[97m"
if [[ -d ${RECEIVER_BUILD_DIRECTORY}/beast-splitter/beast-splitter && -d ${RECEIVER_BUILD_DIRECTORY}/beast-splitter/beast-splitter/.git ]] ; then
# A directory with a git repository containing the source code already exists.
echo -e "\e[94m Entering the local beast-splitter git repository directory...\e[97m"
cd ${RECEIVER_BUILD_DIRECTORY}/beast-splitter/beast-splitter 2>&1
echo -e "\e[94m Updating the local beast-splitter git repository...\e[97m"
echo -e ""
git pull 2>&1
## CLONE OR PULL THE BEAST-SPLITTER DECODER SOURCE
log_heading "Preparing the beast-splitter Git repository"
if [[ -d $RECEIVER_BUILD_DIRECTORY/beast-splitter/beast-splitter && -d $RECEIVER_BUILD_DIRECTORY/beast-splitter/beast-splitter/.git ]]; then
log_message "Entering the beast-splitter git repository directory"
cd $RECEIVER_BUILD_DIRECTORY/beast-splitter/beast-splitter
log_message "Pulling the beast-splitter git repository"
echo ""
git pull 2>&1 | tee -a $RECEIVER_LOG_FILE
else
# A directory containing the source code does not exist in the build directory.
echo -e "\e[94m Creating the beast-splitter build directory...\e[97m"
log_message "Creating the beast-splitter build directory"
echo ""
mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/beast-splitter 2>&1
mkdir -v $RECEIVER_BUILD_DIRECTORY/beast-splitter 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
echo -e "\e[94m Entering the beast-splitter build directory...\e[97m"
cd ${RECEIVER_BUILD_DIRECTORY}/beast-splitter 2>&1
echo -e "\e[94m Cloning the beast-splitter git repository locally...\e[97m"
echo -e ""
git clone https://github.com/flightaware/beast-splitter.git 2>&1
log_message "Entering the beast-splitter build directory"
cd $RECEIVER_BUILD_DIRECTORY/beast-splitter
log_message "Cloning the beast-splitter git repository"
echo ""
git clone https://github.com/flightaware/beast-splitter.git 2>&1 | tee -a $RECEIVER_LOG_FILE
fi
## BUILD AND INSTALL THE BEAST-SPLITTER PACKAGE
log_heading "Building the beast-splitter package"
log_message "Entering the beast-splitter Git repository"
cd $RECEIVER_BUILD_DIRECTORY/beast-splitter/beast-splitter
log_message "Building the beast-splitter package"
echo ""
dpkg-buildpackage -b 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
## BUILD AND INSTALL
echo -e "\e[95m Building and installing the beast-splitter package...\e[97m"
echo -e ""
echo -e "\e[94m Entering the beast-splitter git repository directory...\e[97m"
cd ${RECEIVER_BUILD_DIRECTORY}/beast-splitter/beast-splitter 2>&1
echo -e "\e[94m Executing the beast-splitter build script...\e[97m"
echo -e ""
dpkg-buildpackage -b 2>&1
echo -e ""
echo -e "\e[94m Entering the beast-splitter build directory...\e[97m"
cd ${RECEIVER_BUILD_DIRECTORY}/beast-splitter 2>&1
echo -e "\e[94m Installing the beast-splitter package...\e[97m"
log_message "Installing the beast-splitter Debian package"
echo ""
sudo dpkg -i beast-splitter_*.deb 2>&1
sudo dpkg -i $RECEIVER_BUILD_DIRECTORY/beast-splitter/beast-splitter_*.deb 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
# Archive binary package.
if [[ ! -d ${RECEIVER_BUILD_DIRECTORY}/package-archive ]] ; then
echo -e "\e[94m Creating package archive directory...\e[97m"
log_message "Checking that the beast-splitter Debian package was installed"
if [[ $(dpkg-query -W -f='${STATUS}' beast-splitter 2>/dev/null | grep -c "ok installed") -eq 0 ]]; then
echo ""
mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/package-archive 2>&1
log_alert_heading "INSTALLATION HALTED"
echo ""
log_alert_message "The beast-splitter Debian package failed to install"
log_alert_message "Setup has been terminated"
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "beast-splitter setup halted"
echo ""
read -p "Press enter to continue..." discard
exit 1
fi
if [[ ! -d $RECEIVER_BUILD_DIRECTORY/package-archive ]]; then
log_message "Creating the Debian package archive directory"
echo ""
mkdir -v $RECEIVER_BUILD_DIRECTORY/package-archive 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
fi
echo -e "\e[94m Moving the beast-splitter package into the archive directory...\e[97m"
echo ""
cp -vp ${RECEIVER_BUILD_DIRECTORY}/beast-splitter/*.deb ${RECEIVER_BUILD_DIRECTORY}/package-archive/ 2>&1
log_message "Copying the beast-splitter Debian package into the Debian package archive directory"
echo ""
cp -vf $RECEIVER_BUILD_DIRECTORY/beast-splitter/*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ 2>&1 | tee -a $RECEIVER_LOG_FILE
## CONFIGURE BEAST SPLITTER
echo -e "\e[94m Configuring beast-splitter...\e[97m"
ChangeConfig "ENABLED" $enabled "/etc/default/beast-splitter"
ChangeConfig "INPUT_OPTIONS" $input_options "/etc/default/beast-splitter"
ChangeConfig "OUTPUT_OPTIONS" $output_options "/etc/default/beast-splitter"
## CONFIGURATION
log_heading "Configuring beast-splitter"
log_message "Setting ENABLED to ${enable_beastsplitter}"
change_config "ENABLED" "${enable_beastsplitter}" "/etc/default/beast-splitter"
log_message "Setting INPUT_OPTIONS to ${input_options}"
change_config "INPUT_OPTIONS" "${input_options}" "/etc/default/beast-splitter"
log_message "Setting OUTPUT_OPTIONS to ${output_options}"
change_config "OUTPUT_OPTIONS" "${output_options}" "/etc/default/beast-splitter"
if [[ "${enable_beastsplitter}" == "true" ]]; then
log_message "Starting the beast-splitter process"
sudo systemctl start beast-splitter
else
log_message "Making sure beast-splitter is not running"
sudo systemctl stop beast-splitter
fi
## SETUP COMPLETE
# Return to the project root directory.
echo -e "\e[94m Entering the ADS-B Receiver Project root directory...\e[97m"
cd ${RECEIVER_ROOT_DIRECTORY} 2>&1
log_message "Returning to ${RECEIVER_PROJECT_TITLE} root directory"
cd $RECEIVER_ROOT_DIRECTORY
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m beast-splitter setup is complete.\e[39m"
echo -e ""
if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
read -p "Press enter to continue..." CONTINUE
fi
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "beast-splitter setup is complete"
echo ""
read -p "Press enter to continue..." discard
exit 0

Wyświetl plik

@ -1,164 +1,120 @@
#!/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-2024 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. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
## PRE INSTALLATION OPERATIONS
## INCLUDE EXTERNAL SCRIPTS
source ${RECEIVER_BASH_DIRECTORY}/variables.sh
source ${RECEIVER_BASH_DIRECTORY}/functions.sh
## BEGIN SETUP
source $RECEIVER_BASH_DIRECTORY/variables.sh
source $RECEIVER_BASH_DIRECTORY/functions.sh
clear
echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
echo ""
echo -e "\e[92m Setting up Duck DNS..."
echo -e "\e[93m ------------------------------------------------------------------------------\e[96m"
echo ""
whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Duck DNS Dynamic DNS" --yesno "Duck DNS is a free dynamic DNS service hosted on Amazon VPC.\n\nPLEASE NOTE:\n\nBefore continuing this setup it is recommended that you visit the Duck DNS website and signup for then setup a sub domain which will be used by this device. You will need both the domain and token supplied to you after setting up your account.\n\n http://www.duckdns.org\n\nContinue with Duck DNS update script setup?" 18 78
if [[ $? -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."
log_project_title
log_title_heading "Setting up Duck DNS"
log_title_message "------------------------------------------------------------------------------"
if ! whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "Duck DNS Dynamic DNS" \
--yesno "Duck DNS is a free dynamic DNS service hosted on Amazon VPC.\n\nPLEASE NOTE:\n\nBefore continuing this setup it is recommended that you visit the Duck DNS website and signup for then setup a sub domain which will be used by this device. You will need both the domain and token supplied to you after setting up your account.\n\n http://www.duckdns.org\n\nContinue with Duck DNS update script setup?" \
18 78; then
echo ""
echo -e "\e[93m ------------------------------------------------------------------------------\e[96m"
echo -e "\e[92m Duck DNS setup halted.\e[39m"
log_alert_heading "INSTALLATION HALTED"
log_alert_message "Setup has been halted at the request of the user"
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "Duck DNS setup halted"
echo ""
read -p "Press enter to continue..." CONTINUE
exit 1
fi
echo -e "\e[95m Setting up Duck DNS on this device...\e[97m"
echo ""
## CHECK FOR PREREQUISITE PACKAGES
# Check that the required packages are installed.
echo -e "\e[95m Installing packages needed to build and fulfill dependencies...\e[97m"
echo ""
CheckPackage cron
CheckPackage curl
exho ""
log_heading "Installing packages needed to fulfill PlaneFinder client dependencies"
## CONFIRM SETTINGS
check_package cron
check_package curl
# Ask for the user sub domain to be assigned to this device.
DUCKDNS_DOMAIN_TITLE="Duck DNS Sub Domain"
while [[ -z "${DUCKDNS_DOMAIN}" ]] ; do
DUCKDNS_DOMAIN=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${DUCKDNS_DOMAIN_TITLE}" --nocancel --inputbox "\nPlease enter the Duck DNS sub domain you selected after registering.\nIf you do not have one yet visit http://www.ducknds.org to obtain one." 9 78 3>&1 1>&2 2>&3)
DUCKDNS_DOMAIN_TITLE="Duck DNS Sub Domain (REQUIRED)"
done
# Ask for the Duck DNS token to be assigned to this receiver.
DUCKDNS_TOKEN_TITLE="Duck DNS Token"
while [[ -z "${DUCKDNS_TOKEN}" ]] ; do
DUCKDNS_TOKEN=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${DUCKDNS_TOKEN_TITLE}" --nocancel --inputbox "\nPlease enter your Duck DNS token." 8 78 3>&1 1>&2 2>&3)
DUCKDNS_TOKEN_TITLE="Duck DNS Token (REQUIRED)"
done
## GATHER REQUIRED INFORMATION FROM THE USER
## PROJECT BUILD DIRECTORY
log_heading "Gather information required to configure Duck DNS support"
# Create the build directory if it does not already exist.
if [[ ! -d "${RECEIVER_BUILD_DIRECTORY}" ]] ; then
echo -e "\e[94m Creating the ADS-B Receiver Project build directory...\e[97m"
mkdir -vp ${RECEIVER_BUILD_DIRECTORY} 2>&1
fi
# Create a component directory within the build directory if it does not already exist.
if [[ ! -d ${RECEIVER_BUILD_DIRECTORY}/duckdns ]] ; then
echo -e "\e[94m Creating the directory ${RECEIVER_BUILD_DIRECTORY}/duckdns...\e[97m"
echo ""
mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/duckdns 2>&1
echo ""
fi
## CREATE SCRIPT
# Create then set permissions on the file duck.sh.
echo -e "\e[94m Creating the Duck DNS update script...\e[97m"
tee ${RECEIVER_BUILD_DIRECTORY}/duckdns/duck.sh > /dev/null <<EOF
echo url="https://www.duckdns.org/update?domains=${DUCKDNS_DOMAIN}&token=${DUCKDNS_TOKEN}&ip=" | curl -k -o ${RECEIVER_BUILD_DIRECTORY}/duckdns/duck.log -K -
EOF
echo -e "\e[94m Setting execute permissions for only this user on the Duck DNS update script...\e[97m"
echo ""
chmod -v 700 ${RECEIVER_BUILD_DIRECTORY}/duckdns/duck.sh 2>&1
echo ""
## ADD TO CRON
echo -e "\e[94m Adding the DuckDNS cron file...\e[97m"
sudo tee /etc/cron.d/duckdns_ip_address_update > /dev/null <<EOF
# Updates IP address with duckdns.org.
*/5 * * * * ${RECEIVER_BUILD_DIRECTORY}/duckdns/duck.sh >/dev/null 2>&1
EOF
echo ""
## START SCRIPTS
echo -e "\e[95m Starting Duck DNS...\e[97m"
echo ""
# Kill any currently running instances.
PROCS="duck.sh"
for PROC in ${PROCS} ; do
PIDS=`ps -efww | grep -w "${PROC} " | awk -vpid=$$ '$2 != pid { print $2 }'`
if [[ -n "${PIDS}" ]] ; then
echo -e "\e[94m Killing any running ${PROC} processes...\e[97m"
echo ""
sudo kill ${PIDS} 2>&1
sudo kill -9 ${PIDS} 2>&1
log_message "Asking the user for the sub domain to be assigned to this device"
duckdns_domain_title="Duck DNS Sub Domain"
while [[ -z $duckdns_domain ]]; do
duckdns_domain=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "${duckdns_domain_title}" \
--inputbox "\nPlease enter the Duck DNS sub domain you selected after registering.\nIf you do not have one yet visit http://www.ducknds.org to obtain one." \
9 78 3>&1 1>&2 2>&3)
if [[ $duckdns_domain == 0 ]]; then
log_alert_heading "INSTALLATION HALTED"
log_alert_message "Setup has been halted due to lack of required information"
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "Duck DNS decoder setup halted"
exit 1
fi
unset PIDS
duckdns_domain_title="Duck DNS Sub Domain (REQUIRED)"
done
# Run the Duck DNS update script for the first time..
echo -e "\e[94m Executing the Duck DNS update script...\e[97m"
log_message "Asking the user for the Duck DNS token"
duckdns_token_title="Duck DNS Token"
while [[ -z $duckdns_token ]]; do
duckdns_token=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "${duckdns_token_title}" \
--inputbox "\nPlease enter your Duck DNS token." \
8 78 3>&1 1>&2 2>&3)
if [[ $duckdns_domain == 0 ]]; then
log_alert_heading "INSTALLATION HALTED"
log_alert_message "Setup has been halted due to lack of required information"
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "Duck DNS setup halted"
exit 1
fi
duckdns_token_title="Duck DNS Token (REQUIRED)"
done
## CREATE THE DUCK DNS SCRIPT
log_heading "Creating the Duck DNS script"
if [[ ! -d $RECEIVER_BUILD_DIRECTORY/duckdns ]]; then
log_message "Creating the Duck DNS build directory"
echo ""
mkdir -v $RECEIVER_BUILD_DIRECTORY/duckdns 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
fi
log_message "Creating the Duck DNS update script"
tee $RECEIVER_BUILD_DIRECTORY/duckdns/duck.sh > /dev/null <<EOF
echo url="https://www.duckdns.org/update?domains=${duckdns_domain}&token=${duckdns_token}&ip=" | curl -k -o $RECEIVER_BUILD_DIRECTORY/duckdns/duck.log
EOF
log_message "Adding execute permissions for only this user to the Duck DNS update script"
echo ""
${RECEIVER_BUILD_DIRECTORY}/duckdns/duck.sh 2>&1
chmod -v 700 $RECEIVER_BUILD_DIRECTORY/duckdns/duck.sh 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
log_message "Creating the Duck DNS cron file"
sudo tee /etc/cron.d/duckdns_ip_address_update > /dev/null <<EOF
# Updates IP address with duckdns.org
*/5 * * * * $RECEIVER_BUILD_DIRECTORY/duckdns/duck.sh >/dev/null 2>&1
EOF
log_message "Executing the Duck DNS update script"
echo ""
$RECEIVER_BUILD_DIRECTORY/duckdns/duck.sh
echo ""
## SETUP COMPLETE
# Return to the project root directory.
echo -e "\e[94m Entering the ADS-B Receiver Project root directory...\e[97m"
cd ${RECEIVER_ROOT_DIRECTORY} 2>&1
log_message "Returning to ${RECEIVER_PROJECT_TITLE} root directory"
cd $RECEIVER_ROOT_DIRECTORY
echo ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m Duck DNS setup is complete.\e[39m"
log_title_message "------------------------------------------------------------------------------"
log_title_heading "Duck DNS setup is complete"
echo ""
read -p "Press enter to continue..." CONTINUE
read -p "Press enter to continue..." discard
exit 0

Wyświetl plik

@ -0,0 +1,57 @@
#!/bin/bash
## PRE INSTALLATION OPERATIONS
source $RECEIVER_BASH_DIRECTORY/variables.sh
source $RECEIVER_BASH_DIRECTORY/functions.sh
clear
log_project_title
log_title_heading "Setting up Graphs1090"
log_title_message "------------------------------------------------------------------------------"
if ! whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "Beast-Splitter Setup" \
--yesno "Graphs for readsb and dump1090-fa based on dump1090-tools by mutability.\n\nRepository: https://github.com/wiedehopf/graphs1090\n\nWould you like to begin the setup process now?" \
15 78; then
echo ""
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 ------------------------------------------------------------------------------\e[96m"
echo -e "\e[92m Graphs1090 setup halted.\e[39m"
echo -e ""
read -p "Press enter to continue..." discard
exit 1
fi
## DOWNLOAD THEN EXECUTE THE INSTALLATION SCRIPT
log_heading "Preparing to install graphs1090"
if [[ ! -d $RECEIVER_BUILD_DIRECTORY/graphs1090 ]]; then
log_message "Creating the Graphs1090 build directory"
mkdir $RECEIVER_BUILD_DIRECTORY/graphs1090
fi
log_message "Entering the Graphs1090 build directory"
cd $RECEIVER_BUILD_DIRECTORY/graphs1090
log_message "Downloading the Graphs1090 install script"
echo ""
wget -v -O $RECEIVER_BUILD_DIRECTORY/graphs1090/install.sh https://github.com/wiedehopf/graphs1090/raw/master/install.sh 2>&1 | tee -a $RECEIVER_LOG_FILE
log_message "Executing the Graphs1090 install script"
echo ""
sudo bash $RECEIVER_BUILD_DIRECTORY/graphs1090/install.sh
echo ""
## SETUP COMPLETE
log_message "Returning to ${RECEIVER_PROJECT_TITLE} root directory"
cd $RECEIVER_ROOT_DIRECTORY
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "Graphs1090 setup is complete"
echo ""
read -p "Press enter to continue..." discard
exit 0

Wyświetl plik

@ -0,0 +1,63 @@
#!/bin/bash
## PRE INSTALLATION OPERATIONS
source $RECEIVER_BASH_DIRECTORY/variables.sh
source $RECEIVER_BASH_DIRECTORY/functions.sh
clear
log_project_title
log_title_heading "Setting up tar1090"
log_title_message "------------------------------------------------------------------------------"
if ! whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "Beast-Splitter Setup" \
--yesno "Tar1090 provides an improved webinterface for use with ADS-B decoders readsb / dump1090-fa.\n\nRepository: https://github.com/wiedehopf/tar1090\n\nWould you like to begin the setup process now?" \
15 78; then
echo ""
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 ------------------------------------------------------------------------------\e[96m"
echo -e "\e[92m Tar1090 setup halted.\e[39m"
echo -e ""
read -p "Press enter to continue..." discard
exit 1
fi
## CHECK FOR PREREQUISITE PACKAGES
check_package curl
## DOWNLOAD THEN EXECUTE THE INSTALLATION SCRIPT
log_heading "Preparing to install tar1090"
if [[ ! -d $RECEIVER_BUILD_DIRECTORY/tar1090 ]]; then
log_message "Creating the tar1090 build directory"
mkdir $RECEIVER_BUILD_DIRECTORY/tar1090
fi
log_message "Entering the tar1090 build directory"
cd $RECEIVER_BUILD_DIRECTORY/tar1090
log_message "Downloading the tar1090 install script"
echo ""
wget -v -O $RECEIVER_BUILD_DIRECTORY/tar1090/install.sh https://raw.githubusercontent.com/wiedehopf/tar1090/master/install.sh 2>&1 | tee -a $RECEIVER_LOG_FILE
log_message "Executing the tar1090 install script"
echo ""
sudo bash $RECEIVER_BUILD_DIRECTORY/tar1090/install.sh
echo ""
## SETUP COMPLETE
log_message "Returning to ${RECEIVER_PROJECT_TITLE} root directory"
cd $RECEIVER_ROOT_DIRECTORY
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "Tar1090 setup is complete"
echo ""
read -p "Press enter to continue..." discard
exit 0

Wyświetl plik

@ -1,108 +1,118 @@
#!/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) 2016-2024, 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. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
## PRE INSTALLATION OPERATIONS
### INCLUDE EXTERNAL SCRIPTS
source ${RECEIVER_BASH_DIRECTORY}/variables.sh
source ${RECEIVER_BASH_DIRECTORY}/functions.sh
source $RECEIVER_BASH_DIRECTORY/variables.sh
source $RECEIVER_BASH_DIRECTORY/functions.sh
clear
echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
echo -e ""
echo -e "\e[92m Setting up the ADS-B Exchange feed..."
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------\e[96m"
echo -e ""
CONTINUE_SETUP=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "ADS-B Exchange Feed Setup" --yesno "ADS-B Exchange is a co-op of ADS-B/Mode S/MLAT feeders from around the world, and the worlds largest source of unfiltered flight data.\n\n http://www.adsbexchange.com/how-to-feed/\n\nContinue setting up the ADS-B Exchange feed?" 18 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 ADS-B Exchange feed setup halted.\e[39m"
echo -e ""
read -p "Press enter to continue..." CONTINUE
log_project_title
log_title_heading "Setting up the ADS-B Exchange client"
log_title_message "------------------------------------------------------------------------------"
if ! whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "ADS-B Exchange Feed Setup" \
--yesno "ADS-B Exchange is a co-op of ADS-B/Mode S/MLAT feeders from around the world, and the worlds largest source of unfiltered flight data.\n\n http://www.adsbexchange.com/how-to-feed/\n\nContinue setting up the ADS-B Exchange feed?" \
18 78; then
echo ""
log_alert_heading "INSTALLATION HALTED"
log_alert_message "Setup has been halted at the request of the user"
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "ADS-B Exchange client setup halted"
echo ""
exit 1
fi
## DOWNLOAD AND EXECUTE THE INSTALL SCRIPT
# Explain the process.
whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "ADS-B Exchange Feed Setup" --msgbox "Scripts supplied by ADS-B Exchange will be used in order to install or upgrade this system. Interaction with the script exececuted will be required in order to complete the installation." 10 78
## DOWNLOAD AND EXECUTE THE ADS-B EXCHANGE CLIENT INSTALL SCRIPT
echo -e "\e[95m Preparing to execute the ${ACTION_TO_PERFORM} script...\e[97m"
echo ""
log_heading "Downloading the proper ADS-B Exchange client script"
# Create the build directory if needed then enter it.
if [ ! -d "${RECEIVER_BUILD_DIRECTORY}/adsbexchange" ]; then
echo -e "\e[94m Creating the ADSBExchange build directory...\e[97m"
mkdir ${RECEIVER_BUILD_DIRECTORY}/adsbexchange
log_message "Informing the user of how the installation process will work"
whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "ADS-B Exchange Feed Setup" \
--msgbox "Scripts supplied by ADS-B Exchange will be used in order to install or upgrade this system. Interaction with the script exececuted will be required in order to complete the installation." \
10 78
if [[ ! -d $RECEIVER_BUILD_DIRECTORY/adsbexchange ]]; then
log_message "Creating the ADSBExchange build directory"
echo ""
mkdir -v $RECEIVER_BUILD_DIRECTORY/adsbexchange 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
fi
echo -e "\e[94m Entering the ADSBExchange build directory...\e[97m"
cd ${RECEIVER_BUILD_DIRECTORY}/adsbexchange
log_message "Entering the ADSBExchange build directory"
cd $RECEIVER_BUILD_DIRECTORY/adsbexchange
# Determine if the feeder is already installed or not.
ACTION_TO_PERFORM="install"
log_message "Determining whether the installation or upgrade script should be used"
action_to_perform="install"
if [[ -f /lib/systemd/system/adsbexchange-mlat.service && -f /lib/systemd/system/adsbexchange-feed.service ]]; then
ACTION_TO_PERFORM="upgrade"
action_to_perform="upgrade"
fi
# Begin the install or upgrade process.
echo -e "\e[94m Downloading the ${ACTION_TO_PERFORM} script...\e[97m"
log_message "Downloading the ADS-B Exchange client ${action_to_perform} script"
echo ""
if [[ "${ACTION_TO_PERFORM}" = "install" ]]; then
wget -O ${RECEIVER_BUILD_DIRECTORY}/adsbexchange/feed-${ACTION_TO_PERFORM}.sh https://www.adsbexchange.com/feed.sh
if [[ "${action_to_perform}" = "install" ]]; then
wget -v -O $RECEIVER_BUILD_DIRECTORY/adsbexchange/feed-${action_to_perform}.sh https://www.adsbexchange.com/feed.sh 2>&1 | tee -a $RECEIVER_LOG_FILE
else
wget -O ${RECEIVER_BUILD_DIRECTORY}/adsbexchange/feed-${ACTION_TO_PERFORM}.sh https://www.adsbexchange.com/feed-update.sh
wget -v -O $RECEIVER_BUILD_DIRECTORY/adsbexchange/feed-${action_to_perform}.sh https://www.adsbexchange.com/feed-update.sh 2>&1 | tee -a $RECEIVER_LOG_FILE
fi
echo ""
log_message "Executing the ADS-B Exchange client ${action_to_perform} script"
echo ""
sudo bash $RECEIVER_BUILD_DIRECTORY/adsbexchange/feed-${action_to_perform}.sh
echo ""
## INSTALL THE ADS-B EXCHANGE STATS PACKAGE
log_heading "Starting the ADS-B Exchange stats package setup process"
log_message "Asking if the user wishes to install the ADS-B Exchange stats package"
if whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "ADS-B Exchange Feed Setup" \
--yesno "ADS-B Exchange offers the option to install their stats package in order to send your stats to their site.\n\nWould you like to install the stats package now?" \
12 78; then
log_message "Downloading the ADS-B Exchange stats package installation script"
echo ""
wget -v -O $RECEIVER_BUILD_DIRECTORY/adsbexchange/axstats.sh https://adsbexchange.com/stats.sh 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
echo -e "Executing the ADS-B Exchange stats package installation script"
echo ""
sudo bash $RECEIVER_BUILD_DIRECTORY/adsbexchange/axstats.sh
echo ""
else
log_message "The user opted out of installing the ADS-B Exchange stats package"
fi
echo -e "\e[94m Making the ${ACTION_TO_PERFORM} script executable...\e[97m"
chmod -x ${RECEIVER_BUILD_DIRECTORY}/adsbexchange/feed-${ACTION_TO_PERFORM}.sh
echo -e "\e[94m Executing the ${ACTION_TO_PERFORM} script...\e[97m"
echo ""
sudo bash ${RECEIVER_BUILD_DIRECTORY}/adsbexchange/feed-${ACTION_TO_PERFORM}.sh
## ADS-B EXCHANGE FEED SETUP COMPLETE
## INSTALL THE ADS-B EXCHANGE WEB INTERFACE
# Enter into the project root directory.
echo -e "\e[94m Entering the ADS-B Receiver Project root directory...\e[97m"
log_heading "Starting the ADS-B Exchange web interface setup process"
log_message "Asking if the user wishes to install the ADS-B Exchange web interface"
if whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "ADS-B Exchange Feed Setup" \
--yesno "ADS-B Exchange offers the option to install an additional web interface.\n\nWould you like to install the web interface now?" \
12 78; then
echo -e "Executing the ADS-B Exchange web interface installation script"
echo ""
sudo bash /usr/local/share/adsbexchange/git/install-or-update-interface.sh
echo ""
else
log_message "The user opted out of installing the ADS-B Exchange web interface"
fi
## SETUP COMPLETE
log_message "Returning to ${RECEIVER_PROJECT_TITLE} root directory"
cd $RECEIVER_ROOT_DIRECTORY
echo ""
echo -e "\e[93m-------------------------------------------------------------------------------------------------------"
echo -e "\e[92m ADS-B Exchange feed setup is complete.\e[39m"
log_title_message "------------------------------------------------------------------------------"
log_title_heading "ADS-B Exchange client client setup is complete"
echo ""
read -p "Press enter to continue..." CONTINUE
read -p "Press enter to continue..." discard
exit 0

Wyświetl plik

@ -0,0 +1,118 @@
#!/bin/bash
## PRE INSTALLATION OPERATIONS
source $RECEIVER_BASH_DIRECTORY/variables.sh
source $RECEIVER_BASH_DIRECTORY/functions.sh
clear
log_project_title
log_title_heading "Setting up the Airplanes.live client"
log_title_message "------------------------------------------------------------------------------"
if ! whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "Airplanes.live Feeder Client Setup" \
--yesno "The airplanes.live feeder client takes data from a local dump1090 instance and shares this with airplanes.live. for more information please see their website:\n\n https://airplanes.live/how-to-feed/\n\nContinue setup by installing the airplanes.live feeder client?" \
13 78; then
echo ""
log_alert_heading "INSTALLATION HALTED"
log_alert_message "Setup has been halted at the request of the user"
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "Airplanes.live client setup halted"
echo ""
exit 1
fi
## CHECK FOR PREREQUISITE PACKAGES
log_heading "Installing packages needed to fulfill FlightAware Dump1090 decoder dependencies"
check_package net-tools
## DOWNLOAD AND EXECUTE THE AIRPLANES.LIVE CLIENT INSTALL SCRIPT
log_heading "Begining the airplanes.live client installation process"
log_message "Informing the user of how the installation process will work"
whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "Airplanes.live Client Setup" \
--msgbox "Scripts supplied by airplanes.live will be used in order to install or upgrade this system. Interaction with the script exececuted will be required in order to complete the installation." \
10 78
if [[ ! -d $RECEIVER_BUILD_DIRECTORY/airplaneslive ]]; then
log_message "Creating the airplanes.live build directory"
echo ""
mkdir -v $RECEIVER_BUILD_DIRECTORY/airplaneslive 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
fi
log_message "Entering the airplanes.live build directory"
cd $RECEIVER_BUILD_DIRECTORY/airplaneslive
log_message "Downloading the airplanes.live client installation script"
echo ""
wget -v -O $RECEIVER_BUILD_DIRECTORY/airplaneslive/install.sh https://raw.githubusercontent.com/airplanes-live/feed/main/install.sh 2>&1 | tee -a $RECEIVER_LOG_FILE
log_message "Executing the airplanes.live client installation script"
echo ""
sudo bash $RECEIVER_BUILD_DIRECTORY/airplaneslive/install.sh
echo ""
## CHECK THE STATUS OF THE CLIENT
log_heading "Checking if the reciver is now feeding airplanes.live"
log_message "Checking for connections on ports 30004 and 31090 to IP address 78.46.234.18"
netstat_output=`netstat -t -n | grep -E '30004|31090'`
if [[ $netstat_output == *"78.46.234.18:30004 ESTABLISHED"* && $netstat_output == *"78.46.234.18:31090 ESTABLISHED"* ]]; then
log_message "This device appears to be connected to airplanes.live"
else
echo ""
log_alert_message "The receiver does not appear to be feeding airplanes.live at this time"
log_alert_message "Please reboot your device and run the command 'netstat -t -n | grep -E '30004|31090' to see if a connection has been astablished"
log_alert_message "If the issue presists supply the last 20 lines given by the following command on the airplanes.live discord"
log_alert_message " 'sudo journalctl -u airplanes-feed --no-pager'"
log_alert_message " 'sudo journalctl -u airplanes-mlat --no-pager'"
fi
## INSTALL THE AIRPLANES.LIVE WEB INTERFACE
log_heading "Starting the airplanes.live web interface setup process"
log_message "Asking if the user wishes to install the ADS-B Exchange web interface"
if whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "Airplanes.live Web Interface Setup" \
--yesno "Airplanes.live offers the option to install an additional web interface.\n\nWould you like to install the web interface now?" \
12 78; then
echo ""
log_message "Executing the airplanes.live web interface installation script"
echo ""
sudo bash sudo bash /usr/local/share/airplanes/git/install-or-update-interface.sh
else
log_message "The user opted out of installing the airplanes.live web interface"
fi
## POST INSTALLATION OPERATIONS
whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "Airplanes.live Client Setup Complete" \
--msgbox "Setup of the airplanes.live client is now complete. You can check your feeder status at https://airplanes.live/myfeed." \
12 78
## SETUP COMPLETE
log_message "Returning to ${RECEIVER_PROJECT_TITLE} root directory"
cd $RECEIVER_ROOT_DIRECTORY
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "Airplanes.live client setup is complete"
echo ""
read -p "Press enter to continue..." discard
exit 0

Wyświetl plik

@ -1,141 +1,97 @@
#!/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-2024, 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. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
## PRE INSTALLATION OPERATIONS
### INCLUDE EXTERNAL SCRIPTS
source ${RECEIVER_BASH_DIRECTORY}/variables.sh
source ${RECEIVER_BASH_DIRECTORY}/functions.sh
### BEGIN SETUP
source $RECEIVER_BASH_DIRECTORY/variables.sh
source $RECEIVER_BASH_DIRECTORY/functions.sh
clear
echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
echo -e ""
echo -e "\e[92m Setting up FlightRadar24 feeder client..."
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------\e[96m"
echo -e ""
# Check for existing component install.
if [[ $(dpkg-query -W -f='${STATUS}' fr24feed 2>/dev/null | grep -c "ok installed") -eq 0 ]] ; then
COMPONENT_FIRST_INSTALL="true"
fi
# Confirm component installation.
CONTINUE_SETUP=$(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 3>&1 1>&2 2>&3)
if [[ ${CONTINUE_SETUP} -eq 1 ]] ; then
# Setup has been halted by the user.
echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
echo -e " Setup has been halted at the request of the user."
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m FlightRadar24 feeder client setup halted.\e[39m"
echo -e ""
read -p "Press enter to continue..." CONTINUE
log_project_title
log_title_heading "Setting up the FlightRadar24 client"
log_title_message "------------------------------------------------------------------------------"
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
echo ""
log_alert_heading "INSTALLATION HALTED"
log_alert_message "Setup has been halted at the request of the user"
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "FlightRadar24 client setup halted"
echo ""
exit 1
fi
### START INSTALLATION
echo -e ""
echo -e "\e[95m Begining the FlightRadar24 feeder client installation process...\e[97m"
echo -e ""
## DOWNLOAD AND EXECUTE THE FLIGHTRADAR24 CLIENT INSTALL SCRIPT
# Create the component build directory if it does not exist.
if [[ ! -d ${RECEIVER_BUILD_DIRECTORY}/flightradar24 ]] ; then
echo -e "\e[94m Creating the FlightRadar24 feeder client build directory...\e[97m"
log_heading "Begining the FlightRadar24 client installation process"
if [[ ! -d $RECEIVER_BUILD_DIRECTORY/flightradar24 ]]; then
log_message "Creating the FlightRadar24 build directory"
echo ""
mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/flightradar24
mkdir -v $RECEIVER_BUILD_DIRECTORY/flightradar24 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
fi
log_message "Entering the FlightRadar24 build directory"
cd $RECEIVER_BUILD_DIRECTORY/flightradar24
# Change to the component build directory.
echo -e "\e[94m Entering the FlightRadar24 feeder client build directory...\e[97m"
cd ${RECEIVER_BUILD_DIRECTORY}/flightradar24 2>&1
log_message "Downloading the airplanes.live client installation script"
echo ""
wget -v -O $RECEIVER_BUILD_DIRECTORY/flightradar24/install.sh https://fr24.com/install.sh 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
## Download the official Flightradar24 installation script.
echo -e "\e[95m Beginning the Flightradar24 client installation...\e[97m"
echo -e ""
echo -e "\e[94m Downloading the Flightradar24 client installation script...\e[97m"
log_message "Executing the airplanes.live client installation script"
echo ""
wget -v https://fr24.com/install.sh
echo -e "\e[94m Executing the Flightradar24 client installation script...\e[97m"
echo ""
sudo bash ${RECEIVER_BUILD_DIRECTORY}/flightradar24/install.sh
sudo bash $RECEIVER_BUILD_DIRECTORY/flightradar24/install.sh
echo ""
# Check that the component package was installed successfully.
echo -e "\e[94m Checking that the FlightRadar24 feeder client package was installed properly...\e[97m"
if [[ $(dpkg-query -W -f='${STATUS}' fr24feed 2>/dev/null | grep -c "ok installed") -eq 0 ]] ; then
# If the component package could not be installed halt setup.
echo -e ""
echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
echo -e " UNABLE TO INSTALL A REQUIRED PACKAGE."
echo -e " SETUP HAS BEEN TERMINATED!"
echo -e ""
echo -e "\e[93mThe package \"fr24feed\" could not be installed.\e[39m"
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m FlightRadar24 feeder client setup halted.\e[39m"
echo -e ""
read -p "Press enter to continue..." CONTINUE
## CHECK THE STATUS OF THE CLIENT
log_heading "Checking if the FlightRadar24 client was installed successfully"
echo -e "\e[94m Checking that the FlightRadar24 client package was installed"
if [[ $(dpkg-query -W -f='${STATUS}' fr24feed 2>/dev/null | grep -c "ok installed") -eq 0 ]]; then
echo ""
log_alert_heading "INSTALLATION HALTED"
echo ""
log_alert_message "FlightRadar24 package installation failed"
log_alert_message "Setup has been terminated"
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "FlightRadar24 client setup failed"
echo ""
read -p "Press enter to continue..." discard
exit 1
fi
## COMPONENT POST INSTALL ACTIONS
# If sharing to other networks alongside Flightradar24 disable MLAT.
echo -e "\e[94m Flightradar24 asks that MLAT be disabled if sharing with other networks...\e[97m"
ChangeConfig "mlat" "no" "/etc/fr24feed.ini"
ChangeConfig "mlat-without-gps" "no" "/etc/fr24feed.ini"
echo -e "\e[94m Restarting the Flightradar24 client...\e[97m"
## POST INSTALLATION OPERATIONS
log_heading "Performing post installation operations"
log_message "Flightradar24 asks that MLAT be disabled if sharing with other networks"
change_config "mlat" "no" "/etc/fr24feed.ini"
change_config "mlat-without-gps" "no" "/etc/fr24feed.ini"
log_message "Restarting the Flightradar24 client"
sudo systemctl restart fr24feed
### SETUP COMPLETE
log_warning_message "If the Flightradar24 client is the only feeder utilizing MLAT execute the following commands to enable MLAT"
log_warning_message 'sudo sed -i -e "s/\(mlat *= *\).*/\1\"yes\"/" /etc/fr24feed.ini'
log_warning_message 'sudo sed -i -e "s/\(mlat-without-gps *= *\).*/\1\"yes\"/" /etc/fr24feed.ini'
# 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 FlightRadar24 feeder client setup is complete.\e[39m"
echo -e ""
read -p "Press enter to continue..." CONTINUE
## SETUP COMPLETE
log_message "Returning to ${RECEIVER_PROJECT_TITLE} root directory"
cd $RECEIVER_ROOT_DIRECTORY
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "FlightRadar24 client setup is complete"
echo ""
read -p "Press enter to continue..." discard
exit 0

Wyświetl plik

@ -0,0 +1,88 @@
#!/bin/bash
## PRE INSTALLATION OPERATIONS
source $RECEIVER_BASH_DIRECTORY/variables.sh
source $RECEIVER_BASH_DIRECTORY/functions.sh
clear
log_project_title
log_title_heading "Setting up the Fly Italy ADS-B client"
log_title_message "------------------------------------------------------------------------------"
if ! whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "Fly Italy ADS-B feeder client Setup" \
--yesno "The Fly Italy ADS-B feeder client takes data from a local dump1090 instance and shares this with Fly Italy ADS-B. for more information please see their website:\n\n https://flyitalyadsb.com/come-condividere-la-propria-antenna/\n\nContinue setup by installing the Fly Italy ADS-B feeder client?" \
13 78; then
echo ""
log_alert_heading "INSTALLATION HALTED"
log_alert_message "Setup has been halted at the request of the user"
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "Fly Italy ADS-B client setup halted"
echo ""
exit 1
fi
## DOWNLOAD AND EXECUTE THE PROPER FLY ITALY ADS-B CLIENT SCRIPT
log_heading "Begining the Fly Italy ADS-B client installation process"
log_message "Informing the user of how the installation process will work"
whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "Fly Italy ADS-B Client Setup" \
--msgbox "Scripts supplied by Fly Italy ADS-B will be used in order to install or upgrade this system. Interaction with the script exececuted will be required in order to complete the installation." \
10 78
if [[ ! -d $RECEIVER_BUILD_DIRECTORY/flyitalyadsb ]]; then
log_message "Creating the Fly Italy ADS-B build directory"
echo ""
mkdir -v $RECEIVER_BUILD_DIRECTORY/flyitalyadsb 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
fi
log_message "Entering the Fly Italy ADS-B build directory"
cd $RECEIVER_BUILD_DIRECTORY/flyitalyadsb
log_message "Downloading the Fly Italy ADS-B installation script"
echo ""
wget -v -O $RECEIVER_BUILD_DIRECTORY/flyitalyadsb/install.sh https://raw.githubusercontent.com/flyitalyadsb/fly-italy-adsb/master/install.sh 2>&1 | tee -a $RECEIVER_LOG_FILE
log_message "Executing the Fly Italy ADS-B feeder installation script"
echo ""
sudo bash $RECEIVER_BUILD_DIRECTORY/flyitalyadsb/install.sh
log_message "Asking if the user wishes to install the Fly Italy ADS-B updater"
if whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "Install The Fly Italy ADS-B Updater" \
--yesno "It is recommended that the Fly Italy ADS-B updater be installed as well.\n\nWould you like to install the updater at this time?" \
12 78; then
log_message "Downloading the Fly Italy ADS-B updater script"
echo ""
wget -v -O $RECEIVER_BUILD_DIRECTORY/flyitalyadsb/install_updater.sh https://raw.githubusercontent.com/flyitalyadsb/mlat-client/master/scripts/install_updater.sh 2>&1 | tee -a $RECEIVER_LOG_FILE
log_message "Executing the Fly Italy ADS-B feeder updater script"
echo ""
sudo bash $RECEIVER_BUILD_DIRECTORY/flyitalyadsb/install_updater.sh
fi
## POST INSTALLATION OPERATIONS
log_heading "Performing post installation operations"
log_message "Informing user as to how to check client status"
whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "Fly Italy ADS-B Feeder Setup Complete" \
--msgbox "To check the status of your installation vist https://flyitalyadsb.com/stato-ricevitore/.\n\nFor information on configuring your Fly Italy ADS-B feeder visit https://flyitalyadsb.com/configurazione-script/" \
12 78
## SETUP COMPLETE
log_message "Returning to ${RECEIVER_PROJECT_TITLE} root directory"
cd $RECEIVER_ROOT_DIRECTORY
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "Fly Italy ADS-B client setup is complete"
echo ""
read -p "Press enter to continue..." discard
exit 0

Wyświetl plik

@ -1,104 +1,88 @@
#!/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-2024, 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. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
## PRE INSTALLATION OPERATIONS
### INCLUDE EXTERNAL SCRIPTS
source ${RECEIVER_BASH_DIRECTORY}/variables.sh
source ${RECEIVER_BASH_DIRECTORY}/functions.sh
### BEGIN SETUP
source $RECEIVER_BASH_DIRECTORY/variables.sh
source $RECEIVER_BASH_DIRECTORY/functions.sh
clear
echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
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.
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
log_project_title
log_title_heading "Setting up the OpenSky Network client"
log_title_message "------------------------------------------------------------------------------"
if ! 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; then
echo ""
log_alert_heading "INSTALLATION HALTED"
log_alert_message "Setup has been halted at the request of the user"
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "OpenSky Network client setup halted"
echo ""
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 ""
## CHECK FOR PREREQUISITE PACKAGES
log_heading "Installing packages needed to fulfill OpenSky Network client dependencies"
check_package apt-transport-https
## ADD THE OPENSKY NETWORK APT REPOSITORY TO THE SYSTEM IF IT DOES NOT ALREADY EXIST
log_heading "Setting up the OpenSky Network apt repository if it has not yet been setup...\e[97m"
log_message "Checking if the OpenSky Network apt repository is set up"
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"
CheckPackage 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"
log_message "The OpenSky Network apt repository is not set up"
if [[ ! -d $RECEIVER_BUILD_DIRECTORY/openskynetwork ]]; then
log_message "Creating the OpenSky Network build directory"
echo ""
mkdir -v $RECEIVER_BUILD_DIRECTORY/openskynetwork 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
fi
log_message "Entering the OpenSky Network build directory"
cd $RECEIVER_BUILD_DIRECTORY/openskynetwork
log_message "Downloading and adding the OpenSky Network apt repository GPG key"
echo ""
wget -v -O $RECEIVER_BUILD_DIRECTORY/openskynetwork/opensky.gpg.pub https://opensky-network.org/files/firmware/opensky.gpg.pub 2>&1 | tee -a $RECEIVER_LOG_FILE
wget -q -O - https://opensky-network.org/files/firmware/opensky.gpg.pub | sudo apt-key add - 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
log_message "Adding the OpenSky Network apt repository"
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"
log_message "The OpenSky Network apt repository is already set up"
fi
## INSTALL THE OPENSKY NETWORK FEEDER PACKAGE USING APT
log_heading "Installing the OpenSky Network feeder package"
log_message "Downloading the latest package lists for all enabled repositories and PPAs"
echo ""
sudo apt-get update 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
log_message "Installing the OpenSky Network fedder package using apt"
echo ""
sudo apt-get install opensky-feeder
echo ""
### INSTALL THE OPENSKY NETWORK FEEDER PACKAGE USING APT
echo -e "\e[95m Installing the OpenSky Network fedder package...\e[97m"
## SETUP COMPLETE
log_message "Returning to ${RECEIVER_PROJECT_TITLE} root directory"
cd $RECEIVER_ROOT_DIRECTORY
echo ""
echo -e "\e[94m Downloading the latest package lists for all enabled repositories and PPAs...\e[97m"
log_title_message "------------------------------------------------------------------------------"
log_title_heading "OpenSky Network client setup is complete"
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 ""
read -p "Press enter to continue..." CONTINUE
read -p "Press enter to continue..." discard
exit 0

Wyświetl plik

@ -1,271 +1,278 @@
#!/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-2024, 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. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# THE FLIGHTAWARE PIAWARE CLIENT SETUP SCRIPT
### INCLUDE EXTERNAL SCRIPTS
# JPROCHAZKA/PIAWARE_BUILDER REPOSITORY
# -------------------------------------------------------------------------------------
# I submitted a fix to support Debian Trixie and Ubuntu Noble Numbat to FlightAware's
# piaware_builder repository. Until the changes are merged into their Git reposiory
# the installation will be done using the fork I created along with the branch which
# contains the changes needed in order to build the package.
#
# https://github.com/flightaware/piaware_builder/pull/26
source ${RECEIVER_BASH_DIRECTORY}/variables.sh
source ${RECEIVER_BASH_DIRECTORY}/functions.sh
# TCLTLS-REBUILD
# -------------------------------------------------------------------------------------
# Along with PiAware, a version of tcltls maintained by FlightAware can be installed.
# This package is only needed for any distribution utilizing tcl-tls 1.7.22-2 or older.
#
# This fix may need to remain in place until Debian Bullseye hits end of life.
### BEGIN SETUP
## PRE INSTALLATION OPERATIONS
source $RECEIVER_BASH_DIRECTORY/variables.sh
source $RECEIVER_BASH_DIRECTORY/functions.sh
clear
echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
echo ""
echo -e "\e[92m Setting up FlightAware PiAware client..."
echo ""
echo -e "\e[93m ------------------------------------------------------------------------------\e[96m"
echo ""
# Check for existing component install.
if [[ $(dpkg-query -W -f='${STATUS}' piaware 2>/dev/null | grep -c "ok installed") -eq 0 ]] ; then
COMPONENT_FIRST_INSTALL="true"
fi
# Confirm component installation.
CONTINUE_SETUP=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "FlightAware PiAware client Setup" --yesno "The FlightAware PiAware client takes data from a local dump1090 instance and shares this with FlightAware using the piaware package, for more information please see their website:\n\n https://www.flightaware.com/adsb/piaware/\n\nContinue setup by installing the FlightAware PiAware 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."
log_project_title
log_title_heading "Setting up the FlightAware PiAware client"
log_title_message "------------------------------------------------------------------------------"
if ! whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "FlightAware PiAware client Setup" \
--yesno "The FlightAware PiAware client takes data from a local dump1090 instance and shares this with FlightAware using the piaware package, for more information please see their website:\n\n https://www.flightaware.com/adsb/piaware/\n\nContinue setup by installing the FlightAware PiAware client?" \
13 78; then
echo ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m FlightAware PiAware client setup halted.\e[39m"
log_alert_heading "INSTALLATION HALTED"
log_alert_message "Setup has been halted at the request of the user"
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "FlightAware PiAware client setup halted"
echo ""
read -p "Press enter to continue..." CONTINUE
exit 1
fi
### CHECK FOR PREREQUISITE PACKAGES
echo -e "\e[95m Installing packages needed to fulfill dependencies for FlightAware PiAware client...\e[97m"
echo ""
CheckPackage build-essential
CheckPackage git
CheckPackage devscripts
CheckPackage debhelper
CheckPackage tcl8.6-dev
CheckPackage autoconf
CheckPackage python3-dev
CheckPackage python3-venv
CheckPackage python3-setuptools
CheckPackage zlib1g-dev
CheckPackage openssl
CheckPackage libboost-system-dev
CheckPackage libboost-program-options-dev
CheckPackage libboost-regex-dev
CheckPackage libboost-filesystem-dev
CheckPackage patchelf
CheckPackage python3-pip
CheckPackage python3-build
CheckPackage python3-setuptools
CheckPackage python3-wheel
CheckPackage net-tools
CheckPackage tclx8.4
CheckPackage tcllib
CheckPackage itcl3
CheckPackage libssl-dev
CheckPackage tcl-dev
CheckPackage chrpath
echo ""
## CHECK FOR PREREQUISITE PACKAGES
## DOWNLOAD OR UPDATE THE TCLTLS REBUILD SOURCE
log_heading "Installing packages needed to fulfill FlightAware PiAware client dependencies"
echo -e "\e[95m Preparing the tcltls rebuild Git repository...\e[97m"
echo ""
# Build the FlightAware version of tcl-tls to address network issues with the stock package.
if [[ -d ${RECEIVER_BUILD_DIRECTORY}/tcltls-rebuild ]] && [[ -d ${RECEIVER_BUILD_DIRECTORY}/tcltls-rebuild/.git ]] ; then
# A directory with a git repository containing the source code already exists.
echo -e "\e[94m Entering the tcltls-rebuild git repository directory...\e[97m"
cd ${RECEIVER_BUILD_DIRECTORY}/tcltls-rebuild 2>&1
echo -e "\e[94m Updating the local tcltls-rebuild git repository...\e[97m"
echo ""
git pull 2>&1
check_package autoconf
check_package build-essential
check_package chrpath
check_package debhelper
check_package devscripts
check_package git
check_package itcl3
check_package libboost-filesystem-dev
check_package libboost-program-options-dev
check_package libboost-regex-dev
check_package libboost-system-dev
check_package libssl-dev
check_package net-tools
check_package openssl
check_package patchelf
check_package python3-dev
check_package python3-pip
check_package python3-setuptools
check_package python3-venv
check_package python3-wheel
check_package tcl-dev
check_package tcl8.6-dev
check_package tcllib
check_package tclx8.4
check_package zlib1g-dev
if [[ "${RECEIVER_OS_CODE_NAME}" == "noble" ]]; then
check_package python3-filelock
check_package python3-pyasyncore
fi
if [[ "${RECEIVER_OS_CODE_NAME}" == "focal" ]]; then
check_package python3-dev
else
# A directory containing the source code does not exist in the build directory.
echo -e "\e[94m Entering the ADS-B Receiver Project build directory...\e[97m"
cd ${RECEIVER_BUILD_DIRECTORY} 2>&1
echo -e "\e[94m Cloning the tcltls-rebuild git repository locally...\e[97m"
echo ""
git clone https://github.com/flightaware/tcltls-rebuild 2>&1
fi
echo ""
## BUILD AND INSTALL THE DUMP1090-FA PACKAGE
echo -e "\e[95m Building and installing the tcltls rebuild package...\e[97m"
echo -e ""
echo -e "\e[94m Entering the tcltls-rebuild source directory...\e[97m"
cd ${RECEIVER_BUILD_DIRECTORY}/tcltls-rebuild/tcltls-1.7.22 2>&1
echo -e "\e[94m Building the tcltls-rebuild package...\e[97m"
echo ""
dpkg-buildpackage -b 2>&1
echo ""
echo -e "\e[94m Installing the tcltls-rebuild package...\e[97m"
echo ""
sudo dpkg -i ${RECEIVER_BUILD_DIRECTORY}/tcltls-rebuild/tcl-tls_1.7.22-2+fa1_*.deb 2>&1
echo ""
echo -e "\e[94m Moving the tcltls-rebuild binary package into the archive directory...\e[97m"
echo ""
cp -vf ${RECEIVER_BUILD_DIRECTORY}/piaware_builder/*.deb ${RECEIVER_BUILD_DIRECTORY}/package-archive/ 2>&1
echo ""
### STOP ANY RUNNING SERVICES
# Attempt to stop using systemd.
if [[ "`sudo systemctl status piaware 2>&1 | egrep -c "Active: active (running)"`" -gt 0 ]] ; then
echo -e "\e[94m Stopping the FlightAware PiAware client service...\e[97m"
sudo systemctl stop piaware 2>&1
check_package python3-build
check_package tcl-tls
fi
### START INSTALLATION
echo -e "\e[95m Begining the FlightAware PiAware client installation process...\e[97m"
echo ""
## CLONE OR PULL THE TCLTLS REBUILD GIT REPOSITORY
if [[ -d ${RECEIVER_BUILD_DIRECTORY}/piaware_builder ]] && [[ -d ${RECEIVER_BUILD_DIRECTORY}/piaware_builder/.git ]] ; then
# A directory with a git repository containing the source code already exists.
echo -e "\e[94m Entering the piaware_builder git repository directory...\e[97m"
cd ${RECEIVER_BUILD_DIRECTORY}/piaware_builder 2>&1
echo -e "\e[94m Updating the local piaware_builder git repository...\e[97m"
echo ""
git pull 2>&1
else
# A directory containing the source code does not exist in the build directory.
echo -e "\e[94m Entering the ADS-B Receiver Project build directory...\e[97m"
cd ${RECEIVER_BUILD_DIRECTORY} 2>&1
echo -e "\e[94m Cloning the piaware_builder git repository locally...\e[97m"
echo ""
git clone https://github.com/flightaware/piaware_builder.git 2>&1
fi
echo ""
if [[ "${RECEIVER_OS_CODE_NAME}" == "focal" || "${RECEIVER_OS_CODE_NAME}" == "bullseye" ]]; then
## BUILD AND INSTALL THE COMPONENT PACKAGE
log_heading "Preparing the FlightAware tcltls-rebuild Git repository"
echo -e "\e[95m Building and installing the FlightAware PiAware client package...\e[97m"
echo ""
# Change to the component build directory.
if [[ ! ${PWD} = ${RECEIVER_BUILD_DIRECTORY}/piaware_builder ]] ; then
echo -e "\e[94m Entering the piaware_builder git repository directory...\e[97m"
cd ${RECEIVER_BUILD_DIRECTORY}/piaware_builder 2>&1
fi
# Execute build script.
DIST="bookworm"
case ${RECEIVER_OS_CODE_NAME} in
buster)
DIST="buster"
;;
bullseye)
DIST="bullseye"
;;
bookworm)
DIST="bookworm"
;;
esac
echo -e "\e[94m Executing the FlightAware PiAware client build script...\e[97m"
echo ""
./sensible-build.sh ${DIST}
echo ""
# Change to build script directory.
echo -e "\e[94m Entering the FlightAware PiAware client build directory...\e[97m"
cd ${RECEIVER_BUILD_DIRECTORY}/piaware_builder/package-${DIST} 2>&1
# Build binary package.
echo -e "\e[94m Building the FlightAware PiAware client package...\e[97m"
echo ""
dpkg-buildpackage -b 2>&1
echo ""
# Install binary package.
echo -e "\e[94m Installing the FlightAware PiAware client package...\e[97m"
echo ""
sudo dpkg -i ${RECEIVER_BUILD_DIRECTORY}/piaware_builder/piaware_*.deb 2>&1
echo ""
# Check that the component package was installed successfully.
echo -e "\e[94m Checking that the FlightAware PiAware client package was installed properly...\e[97m"
if [[ $(dpkg-query -W -f='${STATUS}' piaware 2>/dev/null | grep -c "ok installed") -eq 0 ]] ; then
# If the component package could not be installed halt setup.
echo ""
echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
echo -e " UNABLE TO INSTALL A REQUIRED PACKAGE."
echo -e " SETUP HAS BEEN TERMINATED!"
echo ""
echo -e "\e[93mThe package \"piaware\" could not be installed.\e[39m"
echo ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m FlightAware PiAware client setup halted.\e[39m"
echo ""
read -p "Press enter to continue..." CONTINUE
exit 1
else
# Create binary package archive directory.
if [[ ! -d "${RECEIVER_BUILD_DIRECTORY}/package-archive" ]] ; then
echo -e "\e[94m Creating package archive directory...\e[97m"
if [[ -d $RECEIVER_BUILD_DIRECTORY/tcltls-rebuild && -d $RECEIVER_BUILD_DIRECTORY/tcltls-rebuild/.git ]]; then
log_message "Entering the tcltls-rebuild git repository directory"
cd $RECEIVER_BUILD_DIRECTORY/tcltls-rebuild
log_message "Updating the local tcltls-rebuild git repository"
echo ""
mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/package-archive 2>&1
git pull 2>&1 | tee -a $RECEIVER_LOG_FILE
else
log_message "Creating the tcltls-rebuild build directory"
echo ""
mkdir -v $RECEIVER_BUILD_DIRECTORY/tcltls-rebuild 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
log_message "Entering the tcltls-rebuild build directory"
cd $RECEIVER_BUILD_DIRECTORY/tcltls-rebuild
log_message "Cloning the tcltls-rebuild git repository locally"
echo ""
git clone https://github.com/flightaware/tcltls-rebuild 2>&1 | tee -a $RECEIVER_LOG_FILE
fi
echo ""
## BUILD AND INSTALL THE TCLTLS-REBUILD PACKAGE
log_heading "Beginning the FlightAware tcltls-rebuild installation process"
log_message "Checking if the FlightAware tcltls-rebuild is required"
log_message "Entering the tcltls-rebuild source directory"
cd $RECEIVER_BUILD_DIRECTORY/tcltls-rebuild/tcltls-1.7.22
log_message "Building the tcltls-rebuild package"
echo ""
dpkg-buildpackage -b 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
log_message "Installing the tcltls-rebuild package"
echo ""
sudo dpkg -i $RECEIVER_BUILD_DIRECTORY/tcltls-rebuild/tcl-tls_1.7.22-2+fa1_*.deb 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
log_message "Checking that the FlightAware tcltls-rebuild package was installed properly"
if [[ $(dpkg-query -W -f='${STATUS}' tcltls 2>/dev/null | grep -c "ok installed") -eq 0 ]]; then
echo ""
log_alert_heading "INSTALLATION HALTED"
echo ""
log_alert_message "FlightAware tcltls-rebuild package installation failed"
log_alert_message "Setup has been terminated"
echo ""
log_title_message "------------------------------------------------------------------------------"
"FlightAware PiAware client setup failed"
echo ""
read -p "Press enter to continue..." discard
exit 1
else
if [[ ! -d $RECEIVER_BUILD_DIRECTORY/package-archive ]]; then
log_message "Creating the package archive directory"
echo ""
mkdir -v $RECEIVER_BUILD_DIRECTORY/package-archive 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
fi
log_message "Copying the FlightAware tcltls-rebuild Debian package into the archive directory"
echo ""
cp -vf $RECEIVER_BUILD_DIRECTORY/tcltls-rebuild/*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ 2>&1 | tee -a $RECEIVER_LOG_FILE
fi
fi
## CLONE OR PULL THE PIAWARE_BUILDER GIT REPOSITORY
log_heading "Preparing the FlightAware piaware_builder Git repository"
if [[ -d $RECEIVER_BUILD_DIRECTORY/piaware_builder && -d $RECEIVER_BUILD_DIRECTORY/piaware_builder/.git ]]; then
log_message "Entering the piaware_builder git repository directory"
cd $RECEIVER_BUILD_DIRECTORY/piaware_builder
log_message "Updating the local piaware_builder git repository"
echo ""
git pull 2>&1 | tee -a $RECEIVER_LOG_FILE
else
log_message "Creating the FlightAware piaware_builder build directory"
echo ""
mkdir -v $RECEIVER_BUILD_DIRECTORY/piaware_builder 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
log_message "Entering the ADS-B Receiver Project build directory"
cd $RECEIVER_BUILD_DIRECTORY
log_message "Cloning the piaware_builder git repository locally"
echo ""
# --- START TEMPORARY NOBLE FIX ---
if [[ "${RECEIVER_OS_CODE_NAME}" == "noble" ]]; then
git clone -b trixie https://github.com/jprochazka/piaware_builder.git 2>&1 | tee -a $RECEIVER_LOG_FILE
else
git clone https://github.com/flightaware/piaware_builder.git 2>&1 | tee -a $RECEIVER_LOG_FILE
fi
# Archive binary package.
echo -e "\e[94m Moving the FlightAware PiAware client binary package into the archive directory...\e[97m"
echo ""
cp -vf ${RECEIVER_BUILD_DIRECTORY}/piaware_builder/*.deb ${RECEIVER_BUILD_DIRECTORY}/package-archive/ 2>&1
echo ""
#git clone https://github.com/flightaware/piaware_builder.git 2>&1 | tee -a $RECEIVER_LOG_FILE
# --- END TEMPORARY NOBLE FIX ---
fi
## COMPONENT POST INSTALL ACTIONS
# Instruct the user as to how they can claim their receiver online.
whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Claiming Your PiAware Device" --msgbox "FlightAware requires you claim your feeder online using the following URL:\n\n http://flightaware.com/adsb/piaware/claim\n\nTo claim your device simply visit the address listed above." 12 78
## BUILD AND INSTALL THE PIAWARE CLIENT PACKAGE
### SETUP COMPLETE
log_heading "Beginning the FlightAware PiAware installation process"
# 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
log_message "Entering the piaware_builder git repository directory"
cd $RECEIVER_BUILD_DIRECTORY/piaware_builder
log_message "Determining which piaware_builder build strategy should be use"
distro="bookworm"
case $RECEIVER_OS_CODE_NAME in
focal)
distro="buster"
;;
bullseye | jammy)
distro="bullseye"
;;
bookworm | Focal)
distro="bookworm"
;;
noble)
distro="trixie"
;;
esac
log_message "Setting distribution to build for to ${distro}"
log_message "Executing the FlightAware PiAware client build script"
echo ""
./sensible-build.sh $distro 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
log_message "Entering the FlightAware PiAware client build directory"
cd $RECEIVER_BUILD_DIRECTORY/piaware_builder/package-${distro}
log_message "Building the FlightAware PiAware client package"
echo ""
dpkg-buildpackage -b 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
log_message "Installing the FlightAware PiAware client package"
echo ""
sudo dpkg -i $RECEIVER_BUILD_DIRECTORY/piaware_builder/piaware_*.deb 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
log_message "Checking that the FlightAware PiAware client package was installed properly"
if [[ $(dpkg-query -W -f='${STATUS}' piaware 2>/dev/null | grep -c "ok installed") -eq 0 ]]; then
log_alert_heading "INSTALLATION HALTED"
echo ""
log_alert_message "FlightAware PiAware package installation failed"
log_alert_message "Setup has been terminated"
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "FlightAware PiAware client setup failed"
echo ""
read -p "Press enter to continue..." discard
exit 1
else
if [[ ! -d $RECEIVER_BUILD_DIRECTORY/package-archive ]]; then
log_message "Creating the package archive directory"
echo ""
mkdir -v $RECEIVER_BUILD_DIRECTORY/package-archive 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
fi
log_message "Copying the FlightAware PiAware client binary package into the archive directory"
echo ""
cp -vf $RECEIVER_BUILD_DIRECTORY/piaware_builder/*.deb $RECEIVER_BUILD_DIRECTORY/package-archive/ 2>&1 | tee -a $RECEIVER_LOG_FILE
fi
## POST INSTALLATION OPERATIONS
log_heading "Performing post installation operations"
log_message "Displaying the message informing the user on how to claim their device"
whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "Claiming Your PiAware Device" \
--msgbox "FlightAware requires you claim your feeder online using the following URL:\n\n http://flightaware.com/adsb/piaware/claim\n\nTo claim your device simply visit the address listed above." \
12 78
## SETUP COMPLETE
log_message "Returning to ${RECEIVER_PROJECT_TITLE} root directory"
cd $RECEIVER_ROOT_DIRECTORY
echo ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m FlightAware PiAware client setup is complete.\e[39m"
log_title_message "------------------------------------------------------------------------------"
log_title_heading "FlightAware PiAware client setup is complete"
echo ""
read -p "Press enter to continue..." CONTINUE
read -p "Press enter to continue..." discard
exit 0

Wyświetl plik

@ -1,169 +1,128 @@
#!/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-2024, 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. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
## PRE INSTALLATION OPERATIONS
### INCLUDE EXTERNAL SCRIPTS
source ${RECEIVER_BASH_DIRECTORY}/variables.sh
source ${RECEIVER_BASH_DIRECTORY}/functions.sh
### BEGIN SETUP
source $RECEIVER_BASH_DIRECTORY/variables.sh
source $RECEIVER_BASH_DIRECTORY/functions.sh
clear
echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
echo -e ""
echo -e "\e[92m Setting up PlaneFinder ADS-B Client..."
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------\e[96m"
echo -e ""
# Confirm component installation.
CONTINUE_SETUP=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "PlaneFinder ADS-B Client Setup" --yesno "The PlaneFinder ADS-B Client is an easy and accurate way to share your ADS-B and MLAT data with Plane Finder. It comes with a beautiful user interface that helps you explore and interact with your data in realtime.\n\n https://planefinder.net/sharing/client\n\nContinue setup by installing PlaneFinder ADS-B Client?" 13 78 3>&1 1>&2 2>&3)
if [[ ${CONTINUE_SETUP} -eq 1 ]] ; then
# Setup has been halted by the user.
echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
echo -e " Setup has been halted at the request of the user."
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m PlaneFinder ADS-B Client setup halted.\e[39m"
echo -e ""
read -p "Press enter to continue..." CONTINUE
log_project_title
log_title_heading "Setting up the PlaneFinder client"
log_title_message "------------------------------------------------------------------------------"
if ! whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "PlaneFinder ADS-B Client Setup" \
--yesno "The PlaneFinder ADS-B Client is an easy and accurate way to share your ADS-B and MLAT data with Plane Finder. It comes with a beautiful user interface that helps you explore and interact with your data in realtime.\n\n https://planefinder.net/sharing/client\n\nContinue setup by installing PlaneFinder ADS-B Client?" \
13 78; then
echo ""
log_alert_heading "INSTALLATION HALTED"
log_alert_message "Setup has been halted at the request of the user"
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "PlaneFinder client setup halted"
echo ""
exit 1
fi
### CHECK FOR PREREQUISITE PACKAGES
echo -e "\e[95m Installing packages needed to fulfill dependencies for PlaneFinder ADS-B Client...\e[97m"
echo -e ""
CheckPackage wget
echo ""
## CHECK FOR PREREQUISITE PACKAGES
### DETERMINE WHICH PACACKAGE TO INSTALL
log_heading "Installing packages needed to fulfill PlaneFinder client dependencies"
echo -e "\e[94m Determining the package to install...\e[97m"
BASE_DOWNLOAD_URL="http://client.planefinder.net/"
case "${CPU_ARCHITECTURE}" in
"armv7l"|"armv6l")
PACKAGE_NAME="pfclient_${PLANEFINDER_CLIENT_VERSION_ARMHF}_armhf.deb"
;;
check_package wget
case "${RECIEVER_CPU_ARCHITECTURE}" in
"aarch64")
PACKAGE_NAME="pfclient_${PLANEFINDER_CLIENT_VERSION_ARM64}_armhf.deb"
sudo dpkg --add-architecture armhf
check_package libc6:armhf
;;
esac
## DOWNLOAD AND INSTALL THE PROPER PLANEFINDER CLIENT DEBIAN PACKAGE
log_heading "Begining the PlaneFinder client installation process"
log_message "Determining which Debian package to install"
case "${RECIEVER_CPU_ARCHITECTURE}" in
"armv7l"|"armv6l"|"aarch64")
package_name="pfclient_${pfclient_current_version_armhf}_armhf.deb"
;;
"x86_64")
PACKAGE_NAME="pfclient_${PLANEFINDER_CLIENT_VERSION_AMD64}_amd64.deb"
package_name="pfclient_${pfclient_current_version_amd64}_amd64.deb"
;;
"i386")
PACKAGE_NAME="pfclient_${PLANEFINDER_CLIENT_VERSION_I386}_i386.deb"
package_name="pfclient_${pfclient_current_version_amd64}_i386.deb"
;;
*)
echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
echo -e " Unsupported CPU archetecture."
echo -e ""
echo -e " Archetecture Detected: ${CPU_ARCHITECTURE}"
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m PlaneFinder ADS-B Client setup halted.\e[39m"
echo -e ""
read -p "Press enter to continue..." CONTINUE
echo ""
log_alert_heading "INSTALLATION HALTED"
echo ""
log_alert_message "Unsupported CPU Archetecture"
log_alert_message "Archetecture Detected: ${CPU_ARCHITECTURE}"
log_alert_message "Setup has been terminated"
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "PlaneFinder client setup failed"
echo ""
read -p "Press enter to continue..." discard
exit 1
;;
esac
### START INSTALLATION
echo -e ""
echo -e "\e[95m Begining the PlaneFinder ADS-B Client installation process...\e[97m"
echo -e ""
# Create the component build directory if it does not exist.
if [[ ! -d ${RECEIVER_BUILD_DIRECTORY}/planefinder ]] ; then
echo -e "\e[94m Creating the PlaneFinder ADS-B Client build directory...\e[97m"
if [[ ! -d $RECEIVER_BUILD_DIRECTORY/planefinder ]]; then
log_message "Creating the PlaneFinder build directory"
echo ""
mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/planefinder
mkdir -vp $RECEIVER_BUILD_DIRECTORY/planefinder
echo ""
fi
echo -e "\e[94m Entering the PlaneFinder ADS-B Client build directory...\e[97m"
cd ${RECEIVER_BUILD_DIRECTORY}/planefinder 2>&1
log_message "Entering the PlaneFinder build directory"
cd $RECEIVER_BUILD_DIRECTORY/planefinder
log_message "Downloading the appropriate PlaneFinder client Debian package"
echo ""
wget -v -O $RECEIVER_BUILD_DIRECTORY/planefinder/$package_name http://client.planefinder.net/$package_name 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
## BUILD AND INSTALL THE COMPONENT PACKAGE
echo -e "\e[95m Installing the PlaneFinder ADS-B Client package...\e[97m"
log_message "Installing the PlaneFinder Client Debian package"
echo -e ""
## DOWNLOAD AND INSTALL THE PACKAGE
# Download the appropriate package depending on the devices architecture.
echo -e "\e[94m Downloading the appropriate deb package...\e[97m"
echo ""
wget --no-check-certificate ${BASE_DOWNLOAD_URL}/${PACKAGE_NAME} -O ${RECEIVER_BUILD_DIRECTORY}/planefinder/${PACKAGE_NAME}
# Install the proper package depending on the devices architecture.
echo -e "\e[94m Installing the PlaneFinder Client...\e[97m"
echo -e ""
sudo dpkg -i ${RECEIVER_BUILD_DIRECTORY}/planefinder/${PACKAGE_NAME} 2>&1
sudo dpkg -i $RECEIVER_BUILD_DIRECTORY/planefinder/$package_name 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
# Archive the deb package..
echo -e "\e[94m Archiving the deb package...\e[97m"
if [[ ! -d "${RECEIVER_BUILD_DIRECTORY}/package-archive" ]] ; then
echo -e "\e[94m Creating package archive directory...\e[97m"
echo -e ""
mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/package-archive 2>&1
echo -e ""
if [[ ! -d $RECEIVER_BUILD_DIRECTORY/package-archive ]]; then
log_message "Creating the package archive directory"
echo ""
mkdir -v $RECEIVER_BUILD_DIRECTORY/package-archive 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
fi
echo -e "\e[94m Moving the PlaneFinder ADS-B Client binary package into the archive directory...\e[97m"
echo -e ""
mv -vf ${RECEIVER_BUILD_DIRECTORY}/planefinder/pfclient_*.deb ${RECEIVER_BUILD_DIRECTORY}/package-archive 2>&1
echo -e ""
log_message "Copying the PlaneFinder client Debian package into the archive directory"
echo ""
cp -vf $RECEIVER_BUILD_DIRECTORY/planefinder/$package_name $RECEIVER_BUILD_DIRECTORY/package-archive/ 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
## COMPONENT POST INSTALL ACTIONS
# Display final setup instructions which cannot be handled by this script.
## POST INSTALLATION OPERATIONS
log_heading "Performing post installation operations"
log_message "Displaying the message informing the user on how to complete setup"
RECEIVER_IP_ADDRESS=`ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/'`
whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "PlaneFinder ADS-B Client Setup Instructions" --msgbox "At this point the PlaneFinder ADS-B Client should be installed and running; however this script is only capable of installing the PlaneFinder ADS-B Client. There are still a few steps left which you must manually do through the PlaneFinder ADS-B Client at the following URL:\n\n http://${RECEIVER_IP_ADDRESS}:30053\n\nThe follow the instructions supplied by the PlaneFinder ADS-B Client.\n\nUse the following settings when asked for them.\n\nData Format: Beast\nTcp Address: 127.0.0.1\nTcp Port: 30005" 20 78
whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "PlaneFinder ADS-B Client Setup Instructions" \
--msgbox "At this point the PlaneFinder ADS-B Client should be installed and running; however this script is only capable of installing the PlaneFinder ADS-B Client. There are still a few steps left which you must manually do through the PlaneFinder ADS-B Client at the following URL:\n\n http://${RECEIVER_IP_ADDRESS}:30053\n\nThe follow the instructions supplied by the PlaneFinder ADS-B Client.\n\nUse the following settings when asked for them.\n\nData Format: Beast\nTcp Address: 127.0.0.1\nTcp Port: 30005" \
20 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
## SETUP COMPLETE
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m PlaneFinder ADS-B Client setup is complete.\e[39m"
echo -e ""
if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
read -p "Press enter to continue..." CONTINUE
fi
log_message "Returning to ${RECEIVER_PROJECT_TITLE} root directory"
cd $RECEIVER_ROOT_DIRECTORY
echo ""
log_title_message "------------------------------------------------------------------------------"
log_title_heading "PlaneFinder client setup is complete"
echo ""
read -p "Press enter to continue..." discard
exit 0

Wyświetl plik

@ -1,177 +1,139 @@
#!/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) 2016-2017, Joseph A. Prochazka & Romeo Golf #
# #
# 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. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
## LOGGING FUNCTIONS
#################################################################################
# Detect if a package is installed and if not attempt to install it.
# Log a <message> to the log file
function log_to_file() {
if [[ "${RECEIVER_LOGGING_ENABLED}" == "true" ]]; then
time_stamp=''
if [[ -z $2 || "${2}" == "true" ]]; then
printf -v time_stamp '[%(%Y-%m-%d %H:%M:%S)T]' -1
fi
function CheckPackage {
ATTEMPT=1
MAXATTEMPTS=5
WAITTIME=5
if [[ ! -z $3 && "${3}" == "inline" ]]; then
printf "${time_stamp} ${1}" >> $RECEIVER_LOG_FILE
else
echo "${time_stamp} ${1}" >> $RECEIVER_LOG_FILE
fi
fi
}
while (( ${ATTEMPT} -le `(($MAXATTEMPTS + 1))` )); do
# Logs the "PROJECT TITLE" to the console
function log_project_title() {
log_to_file "${RECEIVER_PROJECT_TITLE}"
echo -e "${display_project_name} ${RECEIVER_PROJECT_TITLE}${display_default}"
echo ""
}
# If the maximum attempts has been reached...
if [[ "${ATTEMPT}" -gt "${MAXATTEMPTS}" ]] ; then
echo -e ""
echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
echo -e " UNABLE TO INSTALL A REQUIRED PACKAGE."
echo -e " SETUP HAS BEEN TERMINATED!"
echo -e ""
echo -e "\e[93mThe package \"$1\" could not be installed in ${MAXATTEMPTS} attempts.\e[39m"
echo -e ""
# Logs a "HEADING" to the console
function log_heading() {
log_to_file "${1}"
echo ""
echo -e "${display_heading} ${1}${display_default}"
echo ""
}
# Logs a "MESSAGE" to the console
function log_message() {
log_to_file "${1}"
echo -e "${display_message} ${1}${display_default}"
}
# Logs an alert "HEADING" to the console
function log_alert_heading() {
log_to_file "${1}"
echo -e "${display_alert_heading} ${1}${display_default}"
}
# Logs an alert "MESSAGE" to the console
function log_alert_message() {
log_to_file "${1}"
echo -e "${display_alert_message} ${1}${display_default}"
}
# Logs an title "HEADING" to the console
function log_title_heading() {
log_to_file "${1}"
echo -e "${display_title_heading} ${1}${display_default}"
}
# Logs an title "MESSAGE" to the console
function log_title_message() {
log_to_file "${1}"
echo -e "${display_title_message} ${1}${display_default}"
}
# Logs a warning "HEADING" to the console
function log_warning_heading() {
log_to_file "${1}"
echo -e "${display_warning_heading} ${1}${display_default}"
}
# Logs a warning "MESSAGE" to the console
function log_warning_message() {
log_to_file "${1}"
echo -e "${display_warning_message} ${1}${display_default}"
}
function log_message_inline() {
log_to_file "${1}" "true" "inline"
printf "${display_message} ${1}${display_default}"
}
function log_false_inline() {
log_to_file "${1}" "false"
echo -e "${display_false_inline} ${1}${display_default}"
}
function log_true_inline() {
log_to_file "${1}" "false"
echo -e "${display_true_inline} ${1}${display_default}"
}
## CHECK IF THE SUPPLIED PACKAGE IS INSTALLED AND IF NOT ATTEMPT TO INSTALL IT
function check_package() {
attempt=1
max_attempts=5
wait_time=5
while (( $attempt -le `(($max_attempts + 1))` )); do
if [[ $attempt > $max_attempts ]]; then
log_alert_heading "INSTALLATION HALTED"
log_alert_message "Unable to install a required package"
log_alert_message "The package $1 could not be installed in ${max_attempts} attempts"
exit 1
fi
# Check if the package is already installed.
printf "\e[94m Checking if the package $1 is installed..."
if [[ $(dpkg-query -W -f='${STATUS}' $1 2>/dev/null | grep -c "ok installed") -eq 0 ]] ; then
# If this is not the first attempt at installing this package...
if [[ ${ATTEMPT} -gt 1 ]] ; then
echo -e "\e[91m \e[5m[INSTALLATION ATTEMPT FAILED]\e[25m"
echo -e "\e[94m Attempting to Install the package $1 again in ${WAITTIME} seconds (ATTEMPT ${ATTEMPT} OF ${MAXATTEMPTS})..."
sleep ${WAITTIME}
log_message_inline "Checking if the package $1 is installed"
if [[ $(dpkg-query -W -f='${STATUS}' $1 2>/dev/null | grep -c "ok installed") = 0 ]]; then
if [[ $attempt > 1 ]]; then
log_alert_message "Inastallation attempt failed"
log_alert_message "Will attempt to Install the package $1 again in ${wait_time} seconds (attempt ${attempt} of ${max_attempts})"
sleep $wait_time
else
echo -e "\e[91m [NOT INSTALLED]"
echo -e "\e[94m Installing the package $1..."
log_false_inline "[NOT INSTALLED]"
log_message "Installing the package ${1}"
fi
# Attempt to install the required package.
echo -e "\e[97m"
ATTEMPT=$((ATTEMPT+1))
sudo apt-get install -y $1
echo -e "\e[39m"
echo ""
attempt=$((attempt+1))
sudo apt-get install -y $1 #2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
else
# The package appears to be installed.
echo -e "\e[92m [OK]\e[39m"
log_true_inline "[OK]"
break
fi
done
}
#################################################################################
# Change a setting in a configuration file.
# The function expects 3 parameters to be passed to it in the following order.
# ChangeConfig KEY VALUE FILE
function ChangeSwitch {
# Use sed to locate the "SWITCH" then replace the "VALUE", the portion after the equals sign, in the specified "FILE".
# This function wil replace the value assigned to a specific swith contained within a file.
sudo sed -i -re "s/($1)\s+\w+/\1 $2/g" $3
}
## BLACKLIST DVB-T DRIVERS FOR RTL-SDR DEVICES
function ChangeConfig {
# Use sed to locate the "KEY" then replace the "VALUE", the portion after the equals sign, in the specified "FILE".
# This function should work with any configuration file with settings formated as KEY="VALUE".
sudo sed -i -e "s/\($1 *= *\).*/\1\"$2\"/" $3
}
function GetConfig {
# Use sed to locate the "KEY" then read the "VALUE", the portion after the equals sign, in the specified "FILE".
# This function should work with any configuration file with settings formated as KEY="VALUE".
echo `sed -n "/^$1 *= *\"\(.*\)\"$/s//\1/p" $2`
}
function CommentConfig {
if [[ ! `grep -cFx "#${1}" $2` -gt 0 ]] ; then
# Use sed to locate the "KEY" then comment out the line containing it in the specified "FILE".
sudo sed -i "/${1}/ s/^/#/" $2
fi
}
function UncommentConfig {
if [[ `grep -cFx "#${1}" $2` -gt 0 ]] ; then
# Use sed to locate the "KEY" then uncomment the line containing it in the specified "FILE".
sudo sed -i "/#${1}*/ s/#*//" $2
fi
}
#################################################################################
# The following function is used to clean up the log files by removing
# any color escaping sequences from the log file so it is easier to read.
# There are other lines not needed which can be removed as well.
function CleanLogFile {
# Use sed to remove any color sequences from the specified "FILE".
sed -i "s,\x1B\[[0-9;]*[a-zA-Z],,g" $1
# Remove the "Press enter to continue..." lines from the log file.
sed -i "/Press enter to continue.../d" $1
}
#################################################################################
# Detect CPU Architecture.
function Check_CPU () {
if [[ -z "${CPU_ARCHITECTURE}" ]] ; then
echo -en "\e[94m Detecting CPU architecture...\e[97m"
export CPU_ARCHITECTURE=`uname -m | tr -d "\n\r"`
fi
}
#################################################################################
# Detect Platform.
function Check_Platform () {
if [[ -z "${HARDWARE_PLATFORM}" ]] ; then
echo -en "\e[94m Detecting hardware platform...\e[97m"
if [[ `egrep -c "^Hardware.*: BCM" /proc/cpuinfo` -gt 0 ]] ; then
export HARDWARE_PLATFORM="RPI"
elif [[ `egrep -c "^Hardware.*: Allwinner sun4i/sun5i Families$" /proc/cpuinfo` -gt 0 ]] ; then
export HARDWARE_PLATFORM="CHIP"
else
export HARDWARE_PLATFORM="unknown"
fi
fi
}
#################################################################################
# Detect Hardware Revision.
function Check_Hardware () {
if [[ -z "${HARDWARE_REVISION}" ]] ; then
echo -en "\e[94m Detecting Hardware revision...\e[97m"
export HARDWARE_REVISION=`grep "^Revision" /proc/cpuinfo | awk '{print $3}'`
fi
}
#################################################################################
# Blacklist DVB-T drivers for RTL-SDR devices.
function BlacklistModules {
if [[ ! -f /etc/modprobe.d/rtlsdr-blacklist.conf ]] || [[ `cat /etc/modprobe.d/rtlsdr-blacklist.conf | wc -l` -lt 9 ]] ; then
echo -en "\e[94m Installing blacklist to prevent unwanted kernel modules from being loaded...\e[97m"
sudo tee ${RECEIVER_KERNEL_MODULE_BLACKLIST} > /dev/null <<EOF
function blacklist_modules() {
if [[ ! -f /etc/modprobe.d/rtlsdr-blacklist.conf || `cat /etc/modprobe.d/rtlsdr-blacklist.conf | wc -l` < 9 ]]; then
log_message "Blacklisting unwanted RTL-SDR kernel modules so they are not loaded"
sudo tee /etc/modprobe.d/rtlsdr-blacklist.conf > /dev/null <<EOF
blacklist dvb_usb_v2
blacklist dvb_usb_rtl28xxu
blacklist dvb_usb_rtl2830u
@ -183,7 +145,286 @@ blacklist rtl2830
blacklist rtl2832
EOF
else
echo -en "\e[94m Kernel module blacklist already installed...\e[97m"
log_message "Kernel module blacklisting complete"
fi
}
## CONFIGURATION RELATED FUNCTIONS
# Use sed to locate the "KEY" then replace the "VALUE", the portion after the equals sign, in the specified "FILE"
# This function should work with any configuration file with settings formated as KEY="VALUE"
function change_config() {
sudo sed -i -e "s/\($1 *= *\).*/\1\"$2\"/" $3
}
# Use sed to locate the "KEY" then read the "VALUE", the portion after the equals sign, in the specified "FILE"
# This function should work with any configuration file with settings formated as KEY="VALUE"
function get_config() {
setting=`sed -n "/^$1 *= *\"\(.*\)\"$/s//\1/p" $2`
if [[ "${setting}" == "" ]]; then
setting=`sed -n "/^$1 *= *\(.*\)$/s//\1/p" $2`
fi
echo $setting
}
## ASSIGN DEVICES TO DECODERS
function ask_for_device_assignments() {
log_heading "Gather information required to configure the decoder(s)"
decoder_being_installed=$1
decoder_count=1
log_message "Checking if an ACARS decoder is installed"
acars_decoder_installed="false"
if [[ -f /usr/local/bin/acarsdec ]]; then
log_message "The ACARSDEC decoder appears to be installed"
acars_decoder_installed="true"
RECEIVER_ACARS_DECODER_SOFTWARE="acarsdec"
fi
if [[ "${acars_decoder_installed}" == "true" && "${RECEIVER_ACARS_DECODER_SOFTWARE}" != "${decoder_being_installed}" ]]; then
decoder_count=$((decoder_count+1))
fi
log_message "Checking if an ADS-B decoder is installed"
adsb_decoder_installed="false"
if [[ $(dpkg-query -W -f='${STATUS}' dump1090-fa 2>/dev/null | grep -c "ok installed") -eq 1 ]]; then
log_message "The FlightAware dump1090 decoder appears to be installed"
adsb_decoder_installed="true"
RECEIVER_ADSB_DECODER_SOFTWARE="dump1090-fa"
fi
if [[ $(dpkg-query -W -f='${STATUS}' readsb 2>/dev/null | grep -c "ok installed") -eq 1 ]]; then
log_message "The Readsb decoder appears to be installed"
adsb_decoder_installed="true"
RECEIVER_ADSB_DECODER_SOFTWARE="readsb"
fi
if [[ "${adsb_decoder_installed}" == "true" && "${RECEIVER_ADSB_DECODER_SOFTWARE}" != "${decoder_being_installed}" ]]; then
decoder_count=$((decoder_count+1))
fi
log_message "Checking if a UAT decoder is installed"
uat_decoder_installed="false"
if [[ $(dpkg-query -W -f='${STATUS}' dump978-fa 2>/dev/null | grep -c "ok installed") -eq 1 ]]; then
log_message "The FlightAware dump978 decoder appears to be installed"
uat_decoder_installed="true"
RECEIVER_UAT_DECODER_SOFTWARE="dump978-fa"
fi
if [[ "${uat_decoder_installed}" == "true" && "${RECEIVER_UAT_DECODER_SOFTWARE}" != "${decoder_being_installed}" ]]; then
decoder_count=$((decoder_count+1))
fi
log_message "Checking if a VDL Mode 2 decoder is installed"
vdlm2_decoder_installed="false"
if [[ -f /usr/local/bin/dumpvdl2 ]]; then
log_message "The dumpvdl2 decoder appears to be installed"
vdlm2_decoder_installed="true"
RECEIVER_VDLM2_DECODER_SOFTWARE="dumpvdl2"
fi
if [[ -f /usr/local/bin/vdlm2dec ]]; then
log_message "The VDLM2DEC decoder appears to be installed"
vdlm2_decoder_installed="true"
RECEIVER_VDLM2_DECODER_SOFTWARE="vdlm2dec"
fi
if [[ "${vdlm2_decoder_installed}" == "true" && "${RECEIVER_VDLM2_DECODER_SOFTWARE}" != "${decoder_being_installed}" ]]; then
decoder_count=$((decoder_count+1))
fi
if [[ $decoder_count > 1 ]]; then
log_message "Informing the user that existing decoder(s) appears to be installed"
whiptail --backtitle "Decoder Configuration" \
--title "RTL-SDR Dongle Assignments" \
--msgbox "It appears that existing decoder(s) have been installed on this device. In order to run this decoder in tandem with other decoders you will need to specifiy which RTL-SDR dongle each decoder is to use.\n\nKeep in mind in order to run multiple decoders on a single device you will need to have multiple RTL-SDR devices connected to your device." \
12 78
if [[ "${decoder_being_installed}" == "acarsdec" || "${acars_decoder_installed}" == "true" && "${RECEIVER_ACARS_DECODER_SOFTWARE}" == "acarsdec" ]]; then
if [[ "${acars_decoder_installed}" == "true" ]]; then
log_message "Determining which device is currently assigned to ACARSDEC"
exec_start=`get_config "ExecStart" "/etc/systemd/system/acarsdec.service"`
device_assigned_to_acars_decoder=`echo $exec_start | grep -o -P '(?<=-r )[0-9]+'`
fi
log_message "Asking the user to assign a RTL-SDR device number to ACARSDEC"
acars_device_number_title="Enter the ACARSDEC RTL-SDR Device Number"
while [[ -z $RECEIVER_DEVICE_ASSIGNED_TO_ACARS_DECODER ]]; do
RECEIVER_DEVICE_ASSIGNED_TO_ACARS_DECODER=$(whiptail --backtitle "Decoder Configuration" \
--title "${acars_device_number_title}" \
--inputbox "\nEnter the RTL-SDR device number to assign to ACARSDEC." \
8 78 \
"${device_assigned_to_acars_decoder}" 3>&1 1>&2 2>&3)
exit_status=$?
if [[ $exit_status != 0 ]]; then
exit 1
fi
acars_device_number_title="Enter the ACARSDEC RTL-SDR Device Number (REQUIRED)"
done
fi
if [[ "${decoder_being_installed}" == "dump1090-fa" || "${adsb_decoder_installed}" == "true" && "${RECEIVER_ADSB_DECODER_SOFTWARE}" == "dump1090-fa" ]]; then
if [[ "${adsb_decoder_installed}" == "true" ]]; then
log_message "Determining which device is currently assigned to dump1090-fa"
device_assigned_to_adsb_decoder=`get_config "RECEIVER_SERIAL" "/etc/default/dump1090-fa"`
fi
log_message "Asking the user to assign a RTL-SDR device number to dump1090-fa"
adsb_device_number_title="Enter the dump1090-fa RTL-SDR Device Number"
while [[ -z $RECEIVER_DEVICE_ASSIGNED_TO_ADSB_DECODER ]]; do
RECEIVER_DEVICE_ASSIGNED_TO_ADSB_DECODER=$(whiptail --backtitle "Decoder Configuration" \
--title "${adsb_device_number_title}" \
--inputbox "\nEnter the RTL-SDR device number to assign to dump1090-fa." \
8 78 \
"${device_assigned_to_adsb_decoder}" 3>&1 1>&2 2>&3)
exit_status=$?
if [[ $exit_status != 0 ]]; then
exit 1
fi
adsb_device_number_title="Enter the dump1090-fa RTL-SDR Device Number (REQUIRED)"
done
fi
if [[ "${decoder_being_installed}" == "dump978-fa" || "${uat_decoder_installed}" == "true" && "${RECEIVER_UAT_DECODER_SOFTWARE}" == "dump978-fa" ]]; then
if [[ "${uat_decoder_installed}" == "true" ]]; then
log_message "Determining which device is currently assigned to dump978-fa"
receiver_options=`get_config "RECEIVER_OPTIONS" "/etc/default/dump978-fa"`
device_assigned_to_uat_decoder=`echo $receiver_options | grep -o -P '(?<=serial=)[0-9]+'`
fi
log_message "Asking the user to assign a RTL-SDR device number to dump978-fa"
uat_device_number_title="Enter the dump978-fa RTL-SDR Device Number"
while [[ -z $RECEIVER_DEVICE_ASSIGNED_TO_UAT_DECODER ]] ; do
RECEIVER_DEVICE_ASSIGNED_TO_UAT_DECODER=$(whiptail --backtitle "Decoder Configuration" \
--title "${uat_device_number_title}" \
--inputbox "\nEnter the RTL-SDR device number to assign to dump978-fa." \
8 78 \
"${device_assigned_to_uat_decoder}" 3>&1 1>&2 2>&3)
exit_status=$?
if [[ $exit_status != 0 ]]; then
exit 1
fi
uat_device_number_title="Enter the dump978-fa RTL-SDR Device Number (REQUIRED)"
done
fi
if [[ "${decoder_being_installed}" == "dumpvdl2" || "${vdlm2_decoder_installed}" == "true" && "${RECEIVER_VDLM2_DECODER_SOFTWARE}" == "dumpvdl2" ]]; then
if [[ "${vdlm2_decoder_installed}" == "true" ]]; then
log_message "Determining which device is currently assigned to dumpvdl2"
exec_start=`get_config "ExecStart" "/etc/systemd/system/dumpvdl2.service"`
device_assigned_to_vdlm2_decoder=`echo $exec_start | grep -o -P '(?<=--rtlsdr )[0-9]+'`
fi
log_message "Asking the user to assign a RTL-SDR device number to dumpvdl2"
vdlm2_device_number_title="Enter the dumpvdl2 RTL-SDR Device Number"
while [[ -z $RECEIVER_DEVICE_ASSIGNED_TO_VDLM2_DECODER ]]; do
RECEIVER_DEVICE_ASSIGNED_TO_VDLM2_DECODER=$(whiptail --backtitle "Decoder Configuration" \
--title "${vdlm2_device_number_title}" \
--inputbox "Enter the RTL-SDR device number to assign to dumpvdl2." \
8 78 \
"${device_assigned_to_vdlm2_decoder}" 3>&1 1>&2 2>&3)
exit_status=$?
if [[ $exit_status != 0 ]]; then
exit 1
fi
vdlm2_device_number_title="Enter the dumpvdl2 RTL-SDR Device Number (REQUIRED)"
done
fi
if [[ "${decoder_being_installed}" == "readsb" || "${adsb_decoder_installed}" == "true" && "${RECEIVER_ADSB_DECODER_SOFTWARE}" == "readsb" ]]; then
if [[ "${adsb_decoder_installed}" == "true" ]]; then
log_message "Determining which device is currently assigned to Readsb"
receiver_options=`get_config "RECEIVER_OPTIONS" "/etc/default/readsb"`
device_assigned_to_adsb_decoder=`echo $receiver_options | grep -o -P '(?<=--device )[0-9]+'`
fi
log_message "Asking the user to assign a RTL-SDR device number to Readsb"
adsb_device_number_title="Enter the Readsb RTL-SDR Device Number"
while [[ -z $RECEIVER_DEVICE_ASSIGNED_TO_ADSB_DECODER ]]; do
RECEIVER_DEVICE_ASSIGNED_TO_ADSB_DECODER=$(whiptail --backtitle "Decoder Configuration" \
--title "${adsb_device_number_title}" \
--inputbox "\nEnter the RTL-SDR device number to assign to Readsb." \
8 78 \
"${device_assigned_to_adsb_decoder}" 3>&1 1>&2 2>&3)
exit_status=$?
if [[ $exit_status != 0 ]]; then
exit 1
fi
adsb_device_number_title="Enter the Readsb RTL-SDR Device Number (REQUIRED)"
done
fi
if [[ "${decoder_being_installed}" == "vdlm2dec" || "${vdlm2_decoder_installed}" == "true" && "${RECEIVER_VDLM2_DECODER_SOFTWARE}" == "vdlm2dec" ]]; then
if [[ "${vdlm2_decoder_installed}" == "true" ]]; then
log_message "Determining which device is currently assigned to VDLM2DEC"
exec_start=`get_config "ExecStart" "/etc/systemd/system/vdlm2dec.service"`
device_assigned_to_vdlm2_decoder=`echo $exec_start | grep -o -P '(?<=-r )[0-9]+'`
fi
log_message "Asking the user to assign a RTL-SDR device number to VDLM2DEC"
vdlm2_device_number_title="Enter the VDLM2DEC RTL-SDR Device Number"
while [[ -z $RECEIVER_DEVICE_ASSIGNED_TO_VDLM2_DECODER ]]; do
RECEIVER_DEVICE_ASSIGNED_TO_VDLM2_DECODER=$(whiptail --backtitle "Decoder Configuration" \
--title "${vdlm2_device_number_title}" \
--inputbox "\nEnter the RTL-SDR device number to assign to VDLM2DEC." \
8 78 \
"${device_assigned_to_vdlm2_decoder}" 3>&1 1>&2 2>&3)
exit_status=$?
if [[ $exit_status != 0 ]]; then
exit 1
fi
vdlm2_device_number_title="Enter the ACARSDEC RTL-SDR Device Number (REQUIRED)"
done
fi
fi
}
function assign_devices_to_decoders() {
log_heading "Configure decoders if more than one is present"
if [[ ! -z $RECEIVER_DEVICE_ASSIGNED_TO_ACARS_DECODER && "${RECEIVER_ACARS_DECODER_SOFTWARE}" == "acarsdec" ]]; then
log_message "Assigning RTL-SDR device number ${RECEIVER_DEVICE_ASSIGNED_TO_ACARS_DECODER} to ACARSDEC"
sudo sed -i -e "s|\(.*-r \)\([0-9]\+\)\( .*\)|\1${RECEIVER_DEVICE_ASSIGNED_TO_ACARS_DECODER}\3|g" /etc/systemd/system/acarsdec.service
log_message "Reload systemd units"
sudo systemctl daemon-reload
log_message "Restarting ACARSDEC"
sudo systemctl restart acarsdec
fi
if [[ ! -z $RECEIVER_DEVICE_ASSIGNED_TO_ADSB_DECODER && "${RECEIVER_ADSB_DECODER_SOFTWARE}" == "dump1090-fa" ]]; then
log_message "Assigning RTL-SDR device number ${RECEIVER_DEVICE_ASSIGNED_TO_ADSB_DECODER} to FlightAware Dump1090"
change_config "RECEIVER_SERIAL" $RECEIVER_DEVICE_ASSIGNED_TO_ADSB_DECODER "/etc/default/dump1090-fa"
log_message "Restarting dump1090-fa"
sudo systemctl restart dump1090-fa
fi
if [[ ! -z $RECEIVER_DEVICE_ASSIGNED_TO_UAT_DECODER && "${RECEIVER_UAT_DECODER_SOFTWARE}" == "dump978-fa" ]]; then
log_message "Assigning RTL-SDR device number ${RECEIVER_DEVICE_ASSIGNED_TO_UAT_DECODER} to FlightAware Dump978"
serial_assigned=$(cat /etc/default/dump978-fa | grep -c "driver=rtlsdr,serial=")
if [[ $serial_assigned == 1 ]]; then
sudo sed -i -e "s|\(.*driver=rtlsdr,serial=\)\([0-9]\+\)\( .*\)|\1${RECEIVER_DEVICE_ASSIGNED_TO_UAT_DECODER}\3|g" /etc/default/dump978-fa
else
sudo sed -i -e "s|driver=rtlsdr|driver=rtlsdr,serial=${RECEIVER_DEVICE_ASSIGNED_TO_UAT_DECODER}|g" /etc/default/dump978-fa
fi
log_message "Restarting dump978-fa"
sudo systemctl restart dump978-fa
fi
if [[ ! -z $RECEIVER_DEVICE_ASSIGNED_TO_VDLM2_DECODER && "${RECEIVER_VDLM2_DECODER_SOFTWARE}" == "dumpvdl2" ]]; then
log_message "Assigning RTL-SDR device number ${RECEIVER_DEVICE_ASSIGNED_TO_VDLM2_DECODER} to dumpvdl2"
sudo sed -i -e "s|\(.*--rtlsdr \)\([0-9]\+\)\( .*\)|\1${RECEIVER_DEVICE_ASSIGNED_TO_VDLM2_DECODER}\3|g" /etc/systemd/system/dumpvdl2.service
log_message "Reloading systemd units"
sudo systemctl daemon-reload
log_message "Restarting dumpvdl2"
sudo systemctl restart dumpvdl2
fi
if [[ ! -z $RECEIVER_DEVICE_ASSIGNED_TO_ADSB_DECODER && "${RECEIVER_ADSB_DECODER_SOFTWARE}" == "readsb" ]]; then
log_message "Assigning RTL-SDR device number ${RECEIVER_DEVICE_ASSIGNED_TO_ADSB_DECODER} to Readsb"
sudo sed -i -e "s|\(.*--device \)\([0-9]\+\)\( .*\)|\1${RECEIVER_DEVICE_ASSIGNED_TO_ADSB_DECODER}\3|g" /etc/default/readsb
log_message "Restarting Readsb"
sudo systemctl restart readsb
fi
if [[ ! -z $RECEIVER_DEVICE_ASSIGNED_TO_VDLM2_DECODER && "${RECEIVER_VDLM2_DECODER_SOFTWARE}" == "vdlm2dec" ]]; then
log_message "Assigning RTL-SDR device number ${RECEIVER_DEVICE_ASSIGNED_TO_VDLM2_DECODER} to vdlm2dec"
sudo sed -i -e "s|\(.*-r \)\([0-9]\+\)\( .*\)|\1${RECEIVER_DEVICE_ASSIGNED_TO_VDLM2_DECODER}\3|g" /etc/systemd/system/vdlm2dec.service
log_message "Reloading systemd units"
sudo systemctl daemon-reload
log_message "Restarting vdlm2dec"
sudo systemctl restart vdlm2dec
fi
}

Wyświetl plik

@ -1,235 +0,0 @@
#!/bin/bash
#####################################################################################
# ADS-B RECEIVER #
#####################################################################################
# #
# This script is used to complete the setup of the Raspbian image files made #
# available to the public by the projects maintainer(s). #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# 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. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
## 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
# Assign the Lighthttpd document root directory to a variable.
RAWDOCUMENTROOT=`/usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf -p | grep server.document-root`
DOCUMENTROOT=`sed 's/.*"\(.*\)"[^"]*$/\1/' <<< ${RAWDOCUMENTROOT}`
## WELCOME MESSAGE
whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "ADS-B Receiver Project Image Setup" --msgbox "Thank you for choosing to use the ADS-B Receiver Project image.\n\nDuring this setup process the preinstalled dump1090-mutability installation will be configured and the ADS-B Project Web Portal will be installed. If you would like to add additional features to your receiver simply execute ./install.sh again after this initial setup process has been completed." 13 78
## ASK TO UPDATE THE OPERATING SYSTEM
if (whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "ADS-B Receiver Project Image Setup" --yesno "The image comes with the latest updates to Raspbian as of it's release. However updates may have been released for the operating system since the image was released. This being said it is highly recommended you allow the script to check for additional updates now in order to ensure you are in fact running the latest software available.\n\nWould you like the script to check for and install updates now?" 13 78) then
clear
echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
echo -e ""
echo -e "\e[92m Downloading and installing the latest updates for your operating system..."
echo -e "\e[93m ------------------------------------------------------------------------------\e[97m"
echo -e ""
sudo apt-get update
sudo apt-get -y dist-upgrade
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m Your operating system should now be up to date.\e[39m"
echo -e ""
if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
read -p "Press enter to continue..." CONTINUE
fi
fi
## CONFIGURE DUMP1090
clear
echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
echo -e ""
echo -e "\e[92m Configure dump1090..."
echo -e "\e[93m ------------------------------------------------------------------------------\e[96m"
echo -e ""
# If dump1090-mutability is installed...
if [[ $(dpkg-query -W -f='${STATUS}' dump1090-mutability 2>/dev/null | grep -c "ok installed") -eq 1 ]] ; then
# Explain to the user that the receiver's latitude and longitude is required.
RECEIVER_LATLON_DIALOG=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Receiver Latitude and Longitude" --msgbox "Your receivers latitude and longitude are required for distance calculations, you will now be asked to supply these values for your receiver.\n\nIf you do not have this information you can obtain it using the web based \"Geocode by Address\" utility hosted on another of the lead developers websites:\n\n https://www.swiftbyte.com/toolbox/geocode" 15 78 3>&1 1>&2 2>&3)
# Ask the user for the receiver's latitude.
RECEIVER_LATITUDE_TITLE="Receiver Latitude"
while [[ -z "${RECEIVER_LATITUDE}" ]] ; do
RECEIVER_LATITUDE=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${RECEIVER_LATITUDE_TITLE}" --nocancel --inputbox "\nEnter your receiver's latitude.\n(Example: XX.XXXXXXX)" 9 78 3>&1 1>&2 2>&3)
RECEIVER_LATITUDE_TITLE="Receiver Latitude (REQUIRED)"
done
# Ask the user for the receiver's longitude.
RECEIVER_LONGITUDE_TITLE="Receiver Longitude"
while [[ -z "${RECEIVER_LONGITUDE}" ]] ; do
RECEIVER_LONGITUDE=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${RECEIVER_LONGITUDE_TITLE}" --nocancel --inputbox "\nEnter your receeiver's longitude.\n(Example: XX.XXXXXXX)" 9 78 3>&1 1>&2 2>&3)
RECEIVER_LONGITUDE_TITLE="Receiver Longitude (REQUIRED)"
done
echo -e "\e[94m Setting the receiver's latitude to ${RECEIVER_LATITUDE}...\e[97m"
ChangeConfig "LAT" ${RECEIVER_LATITUDE} "/etc/default/dump1090-mutability"
echo -e "\e[94m Setting the receiver's longitude to ${RECEIVER_LONGITUDE}...\e[97m"
ChangeConfig "LON" ${RECEIVER_LONGITUDE} "/etc/default/dump1090-mutability"
# Ask if dump1090-mutability should bind on all IP addresses.
if (whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Bind Dump1090-mutability To All IP Addresses" --defaultno --yesno "By default dump1090-mutability is bound only to the local loopback IP address(s) for security reasons. However some people wish to make dump1090-mutability's data accessable externally by other devices. To allow this dump1090-mutability can be configured to listen on all IP addresses bound to this device. It is recommended that unless you plan to access this device from an external source that dump1090-mutability remain bound only to the local loopback IP address(s).\n\nWould you like dump1090-mutability to listen on all IP addesses?" 15 78) then
echo -e "\e[94m Binding dump1090-mutability to all available IP addresses...\e[97m"
CommentConfig "NET_BIND_ADDRESS" "/etc/default/dump1090-mutability"
else
echo -e "\e[94m Binding dump1090-mutability to the localhost IP addresses...\e[97m"
ChangeConfig "NET_BIND_ADDRESS" "127.0.0.1" "/etc/default/dump1090-mutability"
fi
# Reload dump1090-mutability to ensure all changes take effect.
echo -e "\e[94m Reloading dump1090-mutability...\e[97m"
echo -e ""
sudo service dump1090-mutability force-reload
fi
# Download Heywhatsthat.com maximum range rings if the user wishes them to be displayed.
if [[ ! -f "/usr/share/dump1090-mutability/html/upintheair.json" ]] || [[ ! -f "/usr/share/dump1090-fa/html/upintheair.json" ]] ; then
if (whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Heywhatsthat.com Maximum Range Rings" --yesno "Maximum range rings can be added to dump1090-mutability usings data obtained from Heywhatsthat.com. In order to add these rings to your dump1090-mutability map you will first need to visit http://www.heywhatsthat.com and generate a new panorama centered on the location of your receiver. Once your panorama has been generated a link to the panorama will be displayed in the top left hand portion of the page. You will need the view id which is the series of letters and/or numbers after \"?view=\" in this URL.\n\nWould you like to add heywhatsthat.com maximum range rings to your map?" 16 78); then
HEYWHATSTHATID_TITLE="Heywhatsthat.com Panorama ID"
while [[ -z "${HEYWHATSTHATID}" ]] ; do
HEYWHATSTHATID=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${HEYWHATSTHATID_TITLE}" --nocancel --inputbox "\nEnter your Heywhatsthat.com panorama ID." 8 78 3>&1 1>&2 2>&3)
HEYWHATSTHATID_TITLE="Heywhatsthat.com Panorama ID (REQUIRED)"
done
HEYWHATSTHATRINGONE_TITLE="Heywhatsthat.com First Ring Altitude"
while [[ -z "${HEYWHATSTHATRINGONE}" ]] ; do
HEYWHATSTHATRINGONE=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${HEYWHATSTHATRINGONE_TITLE}" --nocancel --inputbox "\nEnter the first ring's altitude in meters.\n(default 3048 meters or 10000 feet)" 8 78 "3048" 3>&1 1>&2 2>&3)
HEYWHATSTHATRINGONE_TITLE="Heywhatsthat.com First Ring Altitude (REQUIRED)"
done
HEYWHATSTHATRINGTWO_TITLE="Heywhatsthat.com Second Ring Altitude"
while [[ -z "${HEYWHATSTHATRINGTWO}" ]] ; do
HEYWHATSTHATRINGTWO=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${HEYWHATSTHATRINGTWO_TITLE}" --nocancel --inputbox "\nEnter the second ring's altitude in meters.\n(default 12192 meters or 40000 feet)" 8 78 "12192" 3>&1 1>&2 2>&3)
HEYWHATSTHATRINGTWO_TITLE="Heywhatsthat.com Second Ring Altitude (REQUIRED)"
done
echo -e "\e[94m Downloading JSON data pertaining to the supplied panorama ID...\e[97m"
echo -e ""
if [[ $(dpkg-query -W -f='${STATUS}' dump1090-mutability 2>/dev/null | grep -c "ok installed") -eq 1 ]] ; then
HTMLPATH="/usr/share/dump1090-mutability/html/upintheair.json"
else
HTMLPATH="/usr/share/dump1090-fa/html/upintheair.json"
fi
sudo wget -O ${HTMLPATH} "http://www.heywhatsthat.com/api/upintheair.json?id=${HEYWHATSTHATID}&refraction=0.25&alts=${HEYWHATSTHATRINGONE},${HEYWHATSTHATRINGTWO}"
fi
else
echo -e "\e[94m Heywhatsthat.com maximum range rings setup skipped..."
fi
# Dump1090 configuration is now complete.
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m Dump1090 configuration complete.\e[39m"
echo -e ""
if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
read -p "Press enter to continue..." CONTINUE
fi
# CONFIGURE PIAWARE IF NEEDED
if [[ $(dpkg-query -W -f='${STATUS}' dump1090-fa 2>/dev/null | grep -c "ok installed") -eq 1 ]] ; then
clear
echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
echo -e ""
echo -e "\e[92m Configure PiAware..."
echo -e "\e[93m ------------------------------------------------------------------------------\e[96m"
echo -e ""
# Confirm if the user is able to claim their PiAware instance online.
FLIGHTAWARE_LOCAL_CREDENTIALS=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Claim Your PiAware Device" --yesno "Although it is possible to configure your FlightAware credentials locally, these will be stored in plaintext which represents a security risk that should be avoided.\n\nFlightAware recommends claiming your feeder online using the following page:\n\n http://flightaware.com/adsb/piaware/claim\n\nWill you be able to access the FlightAware website from the same public IP address as the feeder will be sending data from?" 16 78 3>&1 1>&2 2>&3)
if [[ "${FLIGHTAWARE_LOCAL_CREDENTIALS}" -eq "1" ]] ; then
# Ask for the users FlightAware login.
FLIGHTAWARE_LOGIN=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Your FlightAware Login" --nocancel --inputbox "\nEnter your FlightAware login.\nLeave this blank to manually claim your PiAware device." 9 78 3>&1 1>&2 2>&3)
if [[ ! "${FLIGHTAWARE_LOGIN}" = "" ]] ; then
# If the user supplied their FlightAware login continue with the device claiming process.
FLIGHTAWARE_PASSWORD1_TITLE="Your FlightAware Password"
while [[ -z "${FLIGHTAWARE_PASSWORD1}" ]] ; do
FLIGHTAWARE_PASSWORD1=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${FLIGHTAWARE_PASSWORD1_TITLE}" --nocancel --passwordbox "\nEnter your FlightAware password." 8 78 3>&1 1>&2 2>&3)
done
FLIGHTAWARE_PASSWORD2_TITLE="Confirm Your FlightAware Password"
while [[ -z "${FLIGHTAWARE_PASSWORD2}" ]] ; do
FLIGHTAWARE_PASSWORD2=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${FLIGHTAWARE_PASSWORD2_TITLE}" --nocancel --passwordbox "\nConfirm your FlightAware password." 8 78 3>&1 1>&2 2>&3)
done
while [[ ! "${FLIGHTAWARE_PASSWORD1}" = "${FLIGHTAWARE_PASSWORD2}" ]] ; do
FLIGHTAWARE_PASSWORD1=""
FLIGHTAWARE_PASSWORD2=""
# Display an error message if the passwords did not match.
whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Claim Your PiAware Device" --msgbox "Passwords did not match.\nPlease enter your password again." 9 78
FLIGHTAWARE_PASSWORD1_TITLE="Your FlightAware Password (REQUIRED)"
while [[ -z "${FLIGHTAWARE_PASSWORD1}" ]] ; do
FLIGHTAWARE_PASSWORD1=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${FLIGHTAWARE_PASSWORD1_TITLE}" --nocancel --passwordbox "\nEnter your FlightAware password." 8 78 3>&1 1>&2 2>&3)
done
FLIGHTAWARE_PASSWORD2_TITLE="Confirm Your FlightAware Password (REQUIRED)"
while [[ -z "${FLIGHTAWARE_PASSWORD2}" ]] ; do
FLIGHTAWARE_PASSWORD2=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${FLIGHTAWARE_PASSWORD2_TITLE}" --nocancel --passwordbox "\nConfirm your FlightAware password." 8 78 3>&1 1>&2 2>&3)
done
done
else
# Display a message to the user stating they need to manually claim their device.
whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Claim Your PiAware Device" --msgbox "Please supply your FlightAware login in order to claim this device, after supplying this you will ask you to enter your password for verification.\n\nIf you decide not to provide a login and password at this time you should still be able to claim your feeder by visting the following site:\n\n http://flightaware.com/adsb/piaware/claim" 13 78
fi
fi
# PiAware configuration is now complete.
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m PiAware configuration complete.\e[39m"
echo -e ""
if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
read -p "Press enter to continue..." CONTINUE
fi
fi
## SETUP THE ADS-B RECEIVER PROJECT WEB PORTAL
chmod +x ${RECEIVER_BASH_DIRECTORY}/portal/install.sh
${RECEIVER_BASH_DIRECTORY}/portal/install.sh
if [[ $? -ne 0 ]] ; then
exit 1
fi
## FINALIZE IMAGE SETUP
# remove the "image" file.
rm -f image
whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "ADS-B Receiver Project Image Setup" --msgbox "Image setup is now complete. If you have any questions or comments on the project let us know on our website.\n\n https://www.adsbreceiver.net\n\nRemember to install additional features simply run ./install.sh again." 12 78
exit 0

Wyświetl plik

@ -1,238 +1,135 @@
#!/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-2024 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. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
## PRE EXECUTION OPERATIONS
## CHECK IF THIS IS THE FIRST RUN USING THE IMAGE RELEASE
source $RECEIVER_BASH_DIRECTORY/variables.sh
source $RECEIVER_BASH_DIRECTORY/functions.sh
if [[ -f "${RECEIVER_ROOT_DIRECTORY}/image" ]] ; then
# Execute image setup script.
chmod +x ${RECEIVER_BASH_DIRECTORY}/image.sh
${RECEIVER_BASH_DIRECTORY}/image.sh
if [[ $? -ne 0 ]] ; then
echo -e ""
echo -e " \e[91m IMAGE SETUP HAS BEEN TERMINISTED.\e[39m"
echo -e ""
exit 1
fi
exit 0
## DISPLAY THE WELCOME SCREEN
log_heading "Displaying the welcome message"
log_message "Displaying the welcome message to the user"
echo ""
if ! whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "The ADS-B Receiver Project" \
--yesno "Thanks for choosing The ADS-B Receiver Project to setup your receiver.\n\nMore information on this project as well as news, support, and discussions can be found on the projects official website located at:\n\n https://www.adsbreceiver.net\n\nWould you like to continue setup?" \
14 78; then
log_alert_heading "INSTALLATION HALTED"
log_alert_message "Setup has been halted at the request of the user"
echo ""
exit 1
fi
## INCLUDE EXTERNAL SCRIPTS
source ${RECEIVER_BASH_DIRECTORY}/functions.sh
## ATTEMPT TO CHANGE AND/OR UPDATE THE REPOSITORY
## SET VARIABLES
if [[ $RECEIVER_DEVELOPMENT_MODE != "true" ]]; then
current_branch=`git rev-parse --abbrev-ref HEAD`
RECEIVER_PROJECT_TITLE="The ADS-B Receiver Project Preliminary Setup Process"
## FUNCTIONS
# Function to update the repository package lists.
function AptUpdate() {
clear
echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
echo -e ""
echo -e "\e[92m Downloading the latest package lists for all enabled repositories and PPAs..."
echo -e "\e[93m ------------------------------------------------------------------------------\e[97m"
echo -e ""
sudo apt-get update
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m Finished downloading and updating package lists.\e[39m"
echo -e ""
read -p "Press enter to continue..." CONTINUE
}
log_project_title
log_title_heading "Fetching the latest version of the ${RECEIVER_PROJECT_BRANCH} branch"
log_title_message "------------------------------------------------------------------------------"
# Function to check that the packages required by this script are installed.
function CheckPrerequisites() {
clear
echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
echo -e ""
echo -e "\e[92m Checking to make sure the whiptail and git packages are installed..."
echo -e "\e[93m ------------------------------------------------------------------------------\e[97m"
echo -e ""
CheckPackage whiptail
CheckPackage git
CheckPackage bc
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m The whiptail and git packages are installed.\e[39m"
echo -e ""
read -p "Press enter to continue..." CONTINUE
}
log_heading "Checking out and updating the appropriate branch"
# Function to update the local git repository.
function UpdateRepository() {
# Update lcoal branches which are set to track remote.
ACTION=$(git remote update 2>&1)
# Check if local branch is behind remote.
if [[ `git status | grep -c "untracked files present"` -gt 0 ]] ; then
# Local branch has untracked files.
clear
# Ask if the user wishes to save any changes made to any core files before resetting them.
whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Backup Current ${RECEIVER_PROJECT_BRANCH} Branch State" --defaultno --yesno "This script will now reset your local copy of the ${RECEIVER_PROJECT_BRANCH} branch. Once this has been done any changes to the files making up this project will be replaced by untouched files from the project's repository.\n\nIf you would like to retain a copy of your current branch's state this script can do so now by migrating it to a new branch.\n\nCreate a new branch containing this branch's current state?" 14 78
case $? in
0) BACKUP_BRANCH_STATE="true" ;;
1) BACKUP_BRANCH_STATE="false" ;;
esac
if [[ "${BACKUP_BRANCH_STATE}" = "true" ]] ; then
# If the user wishes to create a new branch containing the current branches state ask for a name for this new branch.
BACKUP_BRANCH_NAME_TITLE="Name Of Backup Branch"
while [[ -z "${BACKUP_BRANCH_NAME}" ]] ; do
BACKUP_BRANCH_NAME=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "${BACKUP_BRANCH_NAME_TITLE}" --nocancel --inputbox "\nPlease enter a name for this new branch." 10 78 3>&1 1>&2 2>&3)
BACKUP_BRANCH_NAME_TITLE="Name Of Backup Branch (REQUIRED)"
done
if [[ `git status --porcelain --untracked-files=no` && `git ls-remote --heads https://github.com/jprochazka/adsb-receiver.git refs/heads/master | wc -l` = 1 ]]; then
if whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "Stash Changes To Branch ${current_branch}" \
--defaultno \
--yesno "There appears to be changes to the current branch. In order to switch to or fetch the ${current_branch} branch these changes will need to be stashed. Would you like to stash these changes now?" \
14 78; then
log_message "Stashing changes made to the ${current_branch} branch"
git stash 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
else
log_alert_heading "INSTALLATION HALTED"
log_alert_message "Setup has been halted at the request of the user"
echo ""
exit 1
fi
fi
echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
echo -e ""
echo -e "\e[92m Pulling the latest version of the ADS-B Receiver Project repository..."
echo -e "\e[93m ------------------------------------------------------------------------------\e[97m"
echo -e ""
echo -e "\e[94m Switching to branch ${RECEIVER_PROJECT_BRANCH}...\e[97m"
echo -e ""
git checkout ${RECEIVER_PROJECT_BRANCH}
echo -e ""
# Save the current branch state if the user wished to do so.
if [[ "${BACKUP_BRANCH_STATE}" = "true" ]] ; then
echo -e "\e[94m Creating a new branch named ${NEW_BRANCH_NAME} containing the current state of the ${RECEIVER_PROJECT_BRANCH} branch...\e[97m"
echo -e ""
git commit -a -m "Saving current branch state."
git branch ${BACKUP_BRANCH_NAME}
echo -e ""
if [[ "${current_branch}" != "${RECEIVER_PROJECT_BRANCH}" ]]; then
log_message "Switching to branch ${RECEIVER_PROJECT_BRANCH}"
echo ""
git checkout $RECEIVER_PROJECT_BRANCH 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
fi
echo -e "\e[94m Fetching branch ${RECEIVER_PROJECT_BRANCH} from origin...\e[97m"
echo -e ""
git fetch origin
echo -e ""
echo -e "\e[94m Performing hard reset of branch ${RECEIVER_PROJECT_BRANCH} so it matches origin/${RECEIVER_PROJECT_BRANCH}...\e[97m"
echo -e ""
git reset --hard origin/${RECEIVER_PROJECT_BRANCH}
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m Finished pulling the latest version of the ADS-B Receiver Project repository....\e[39m"
echo -e ""
read -p "Press enter to continue..." CONTINUE
}
if [[ `git ls-remote --heads https://github.com/jprochazka/adsb-receiver.git refs/heads/$RECEIVER_PROJECT_BRANCH | wc -l` = 1 ]]; then
log_message "Fetching branch ${RECEIVER_PROJECT_BRANCH} from origin"
echo ""
git fetch origin 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
log_message "Performing hard reset of branch ${RECEIVER_PROJECT_BRANCH} so it matches origin/${RECEIVER_PROJECT_BRANCH}"
echo ""
git reset --hard origin/$RECEIVER_PROJECT_BRANCH
else
log_message "The branch ${RECEIVER_PROJECT_BRANCH} does not appear to be in origin"
fi
# Function to update the operating system.
function UpdateOperatingSystem() {
clear
echo -e "\n\e[91m ${RECEIVER_PROJECT_TITLE}"
echo -e ""
echo -e "\e[92m Downloading and installing the latest updates for your operating system..."
echo -e "\e[93m ------------------------------------------------------------------------------\e[97m"
echo -e ""
sudo apt-get -y dist-upgrade
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m Your operating system should now be up to date.\e[39m"
echo -e ""
read -p "Press enter to continue..." CONTINUE
}
## Update the repository packages and check that prerequisite packages are installed.
# Only call AptUpdate if last update was more than ${APT_UPDATE_THRESHOLD} seconds ago or if the user forced the update.
APT_UPDATE_THRESHOLD="1800"
APT_UPDATE_CURRENT_EPOCH=`date +%s`
APT_UPDATE_LAST_EPOCH=`stat -c %Y /var/cache/apt/pkgcache.bin`
APT_UPDATE_DELTA=`echo $[${APT_UPDATE_CURRENT_EPOCH} - ${APT_UPDATE_LAST_EPOCH}]`
if [[ "${APT_UPDATE_DELTA}" -gt "${APT_UPDATE_THRESHOLD}" ]] || [[ "${RECEIVER_FORCE_APT_UPDATE}" = "true" ]] ; then
AptUpdate
log_title_message "-----------------------------------------------------------------------------"
log_title_heading "Finished fetching the latest version the '${RECEIVER_PROJECT_BRANCH}' branch."
echo ""
read -p "Press enter to continue..." discard
fi
CheckPrerequisites
## DISPLAY WELCOME SCREEN
whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "The ADS-B Receiver Project" --yesno "Thanks for choosing The ADS-B Receiver Project to setup your receiver.\n\nMore information on this project as well as news, support, and discussions can be found on the projects official website located at:\n\n https://www.adsbreceiver.net\n\nWould you like to continue setup?" 14 78
CONTINUE_SETUP=$?
if [[ "${CONTINUE_SETUP}" = 1 ]] ; then
# Setup has been halted by the user.
echo -e ""
echo -e "\e[91m \e[5mSETUP HALTED!\e[25m"
echo -e " Setup has been halted at the request of the user."
echo -e "\e[37m"
read -p "Press enter to continue..." CONTINUE
exit 1
fi
## UPDATE THE REPOSITORY
if [ ! $DEVELOPMENT_MODE = "true" ]; then
UpdateRepository
fi
## ASK IF OPERATING SYSTEM SHOULD BE UPDATED
whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Operating System Updates" --yesno "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.\n\nWould you like to update your operating system now?" 11 78
case $? in
0) UPDATE_OPERATING_SYSTEM="true" ;;
1) UPDATE_OPERATING_SYSTEM="false" ;;
esac
log_heading "Performing operating system updates if so desired"
if [[ "${UPDATE_OPERATING_SYSTEM}" = "true" ]] ; then
UpdateOperatingSystem
log_message "Asking the user if they wish to update the operating system"
if whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "Operating System Updates" \
--yesno "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.\n\nWould you like to update your operating system now?" \
11 78; then
clear
log_project_title
log_title_heading "Downloading and installing the latest updates for your operating system"
log_title_message "------------------------------------------------------------------------------"
log_heading "Updating the operating system"
log_message "Updating the operating system using apt-get"
echo ""
sudo apt-get -y dist-upgrade 2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
log_title_message "------------------------------------------------------------------------"
log_title_heading "Your operating system should now be up to date"
echo ""
read -p "Press enter to continue..." discard
fi
# Use function to detect cpu architecture.
if [[ -z "${CPU_ARCHITECTURE}" ]] ; then
Check_CPU
echo -e ""
fi
## EXECUTE BASH/MAIN.SH
chmod +x ${RECEIVER_BASH_DIRECTORY}/main.sh
${RECEIVER_BASH_DIRECTORY}/main.sh
clear
log_heading "Executing the script bash/main.sh"
log_message "Executing bash/main"
bash $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 ""
echo ""
log_alert_heading "ANY FURTHER SETUP AND/OR INSTALLATION REQUESTS HAVE BEEN TERMINIATED"
echo ""
exit 1
fi
## INSTALLATION COMPLETE
# Display the installation complete message box.
whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Software Installation Complete" --msgbox "INSTALLATION COMPLETE\n\nDO NOT DELETE THIS DIRECTORY!\n\nFiles needed for certain items to run properly are contained within this directory. Deleting this directory may result in your receiver not working properly.\n\nHopefully, these scripts and files were found useful while setting up your ADS-B Receiver. Feedback regarding this software is always welcome. If you have any issues or wish to submit feedback, feel free to do so on GitHub.\n\n https://github.com/jprochazka/adsb-receiver" 20 65
whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
--title "Software Installation Complete" \
--msgbox "INSTALLATION COMPLETE\n\nDO NOT DELETE THIS DIRECTORY!\n\nFiles needed for certain items to run properly are contained within this directory. Deleting this directory may result in your receiver not working properly.\n\nHopefully, these scripts and files were found useful while setting up your ADS-B Receiver. Feedback regarding this software is always welcome. If you have any issues or wish to submit feedback, feel free to do so on GitHub.\n\n https://github.com/jprochazka/adsb-receiver" \
20 65
echo -e "\e[32m"
echo -e "\e[91m Installation complete."
echo -e "\e[37m"
echo ""
log_alert_heading "Installation complete"
echo ""
exit 0

Plik diff jest za duży Load Diff

Wyświetl plik

@ -0,0 +1,33 @@
#!/bin/bash
## INCLUDE EXTERNAL SCRIPTS
source ${RECEIVER_BASH_DIRECTORY}/variables.sh
source ${RECEIVER_BASH_DIRECTORY}/functions.sh
## VARIABLES
python_path=`which python3`
## SETUP ADVANCED PORTAL FEATURES
log_heading "Setting up advanced portal features"
log_message "Creating the Python configuration file needed for logging"
tee ${RECEIVER_BUILD_DIRECTORY}/portal/python/config.json > /dev/null <<EOF
{
"database":{"type":"${ADSB_PORTAL_DATABASE_ENGINE,,}",
"host":"${ADSB_PORTAL_DATABASE_HOSTNAME}",
"user":"${ADSB_PORTAL_DATABASE_USER}",
"passwd":"${ADSB_PORTAL_DATABASE_PASSWORD1}",
"db":"${ADSB_PORTAL_DATABASE_NAME}"}
}
EOF
# Create the cron jobs responsible for logging and maintenance.
log_message "Creating cron file needed to run the Python logging scripts"
sudo tee /etc/cron.d/adsb-receiver-flight-logging > /dev/null <<EOF
* * * * * root ${python_path} ${RECEIVER_BUILD_DIRECTORY}/portal/python/flights.py
0 0 * * * root ${python_path} ${RECEIVER_BUILD_DIRECTORY}/portal/python/maintenance.py
EOF

Wyświetl plik

@ -1,79 +0,0 @@
#!/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-2024 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
PORTAL_BUILD_DIRECTORY="${RECEIVER_BUILD_DIRECTORY}/portal"
PORTAL_PYTHON_DIRECTORY="${PORTAL_BUILD_DIRECTORY}/python"
DATABASEENGINE=${ADSB_DATABASEENGINE}
DATABASEHOSTNAME=${ADSB_DATABASEHOSTNAME}
DATABASEUSER=${ADSB_DATABASEUSER}
DATABASEPASSWORD1=${ADSB_DATABASEPASSWORD1}
DATABASENAME=${ADSB_DATABASENAME}
## SETUP FLIGHT LOGGING
echo -e ""
echo -e "\e[95m Setting up core advanced portal features...\e[97m"
echo -e ""
case ${DATABASEENGINE} in
"MySQL")
echo -e "\e[94m Creating the flight Python configuration file for MySQL...\e[97m"
tee ${PORTAL_PYTHON_DIRECTORY}/config.json > /dev/null <<EOF
{
"database":{"type":"mysql",
"host":"${DATABASEHOSTNAME}",
"user":"${DATABASEUSER}",
"passwd":"${DATABASEPASSWORD1}",
"db":"${DATABASENAME}"}
}
EOF
;;
"SQLite")
echo -e "\e[94m Creating the Python configuration file for SQLite...\e[97m"
tee ${PORTAL_PYTHON_DIRECTORY}/config.json > /dev/null <<EOF
{
"database":{"type":"sqlite",
"host":"${DATABASEHOSTNAME}",
"user":"${DATABASEUSER}",
"passwd":"${DATABASEPASSWORD1}",
"db":"${DATABASENAME}"}
}
EOF
;;
*)
echo -e "\e[94m No core setup required...\e[97m"
;;
esac

Wyświetl plik

@ -1,110 +1,45 @@
#!/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-2024 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
PORTAL_BUILD_DIRECTORY="${RECEIVER_BUILD_DIRECTORY}/portal"
COLLECTD_CONFIG="/etc/collectd/collectd.conf"
COLLECTD_CRON_FILE="/etc/cron.d/adsb-receiver-performance-graphs"
DUMP1090_MAX_RANGE_RRD="/var/lib/collectd/rrd/localhost/dump1090-localhost/dump1090_range-max_range.rrd"
DUMP1090_MESSAGES_LOCAL_RRD="/var/lib/collectd/rrd/localhost/dump1090-localhost/dump1090_messages-local_accepted.rrd"
### INCLUDE EXTERNAL SCRIPTS
## INCLUDE EXTERNAL SCRIPTS
source ${RECEIVER_BASH_DIRECTORY}/variables.sh
source ${RECEIVER_BASH_DIRECTORY}/functions.sh
if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "true" ]] && [[ -s "${RECEIVER_CONFIGURATION_FILE}" ]] ; then
source ${RECEIVER_CONFIGURATION_FILE}
fi
### VARIABLES
collectd_config="/etc/collectd/collectd.conf"
collectd_cron_file="/etc/cron.d/adsb-receiver-performance-graphs"
dump1090_max_range_rrd="/var/lib/collectd/rrd/localhost/dump1090-localhost/dump1090_range-max_range.rrd"
dump1090_messages_local_rrd="/var/lib/collectd/rrd/localhost/dump1090-localhost/dump1090_messages-local_accepted.rrd"
### BEGIN SETUP
echo -e ""
echo -e "\e[95m Setting up collectd performance graphs...\e[97m"
echo -e ""
log_heading "Setting up collectd performance graphs"
## CONFIRM INSTALLED PACKAGES
if [[ -z "${DUMP1090_INSTALLED}" ]] || [[ -z "${DUMP1090_FORK}" ]] ; then
echo -e "\e[94m Checking which dump1090 fork is installed...\e[97m"
if [[ $(dpkg-query -W -f='${STATUS}' dump1090-mutability 2>/dev/null | grep -c "ok installed") -eq 1 ]] ; then
DUMP1090_FORK="mutability"
DUMP1090_INSTALLED="true"
fi
if [[ -z "${dump1090_installed}" || -z "${dump1090_fork}" ]] ; then
log_message "Checking which dump1090 fork is installed"
if [[ $(dpkg-query -W -f='${STATUS}' dump1090-fa 2>/dev/null | grep -c "ok installed") -eq 1 ]] ; then
DUMP1090_FORK="fa"
DUMP1090_INSTALLED="true"
dump1090_fork="fa"
dump1090_installed="true"
fi
fi
if [[ -f "/etc/init.d/rtlsdr-ogn" ]] ; then
RTLSDROGN_INSTALLED="true"
fi
## CONFIRM HARDWARE PLATFORM
if [[ -z "${HARDWARE_PLATFORM}" ]] ; then
Check_Platform
echo -e ""
fi
## MODIFY THE DUMP1090-MUTABILITY INIT SCRIPT TO MEASURE AND RETAIN NOISE DATA
if [[ "${DUMP1090_INSTALLED}" = "true" ]] && [[ "${DUMP1090_FORK}" = "mutability" ]] ; then
echo -e "\e[94m Modifying the dump1090-mutability configuration file to add noise measurements...\e[97m"
EXTRA_ARGS=`GetConfig "EXTRA_ARGS" "/etc/default/dump1090-mutability"`
EXTRA_ARGS=$(sed -e 's/^[[:space:]]*//' <<<"EXTRA_ARGS --measure-noise")
ChangeConfig "EXTRA_ARGS" "${RECEIVER_LONGITUDE}" "/etc/default/dump1090-mutability"
echo -e "\e[94m Reloading the systemd manager configuration...\e[97m"
sudo systemctl daemon-reload
echo -e "\e[94m Reloading dump1090-mutability...\e[97m"
sudo service dump1090-mutability force-reload
fi
## BACKUP AND REPLACE COLLECTD.CONF
# Check if the collectd config file exists and if so back it up.
if [[ -f "${COLLECTD_CONFIG}" ]] ; then
echo -e "\e[94m Backing up the current collectd.conf file...\e[97m"
sudo cp ${COLLECTD_CONFIG} ${COLLECTD_CONFIG}.bak
if [[ -f "${collectd_config}" ]] ; then
log_message "Backing up the current collectd.conf file"
sudo cp ${collectd_config} ${collectd_config}.bak
fi
# Generate new collectd config.
echo -e "\e[94m Replacing the current collectd.conf file...\e[97m"
sudo tee ${COLLECTD_CONFIG} > /dev/null <<EOF
log_message "Replacing the current collectd.conf file"
sudo tee ${collectd_config} > /dev/null <<EOF
# Config file for collectd(1).
##############################################################################
@ -127,19 +62,19 @@ WriteThreads 1
EOF
# Dump1090 specific values.
if [[ "${DUMP1090_INSTALLED}" = "true" ]] ; then
sudo tee -a ${COLLECTD_CONFIG} > /dev/null <<EOF
if [[ "${dump1090_installed}" == "true" ]] ; then
sudo tee -a ${collectd_config} > /dev/null <<EOF
#----------------------------------------------------------------------------#
# Added types for dump1090. #
# Make sure the path to dump1090.db is correct. #
#----------------------------------------------------------------------------#
TypesDB "${PORTAL_BUILD_DIRECTORY}/graphs/dump1090.db" "/usr/share/collectd/types.db"
TypesDB "${RECEIVER_BUILD_DIRECTORY}/portal/graphs/dump1090.db" "/usr/share/collectd/types.db"
EOF
fi
# Config for all installations.
sudo tee -a ${COLLECTD_CONFIG} > /dev/null <<EOF
sudo tee -a ${collectd_config} > /dev/null <<EOF
##############################################################################
# Logging #
##############################################################################
@ -200,9 +135,10 @@ LoadPlugin curl
EOF
# Raspberry Pi specific values.
if [[ "${HARDWARE_PLATFORM}" = "RPI" ]] ; then
sudo tee -a ${COLLECTD_CONFIG} > /dev/null <<EOF
# Device specific values.
# Raspberry Pi: b03112
if [[ "${RECEIVER_CPU_REVISION}" = "b03112" ]] ; then
sudo tee -a ${collectd_config} > /dev/null <<EOF
<Plugin table>
<Table "/sys/class/thermal/thermal_zone0/temp">
Instance localhost
@ -220,42 +156,21 @@ if [[ "${HARDWARE_PLATFORM}" = "RPI" ]] ; then
IgnoreSelected false
</Plugin>
EOF
# CHIP specific values.
elif [[ "${HARDWARE_PLATFORM}" = "CHIP" ]] ; then
sudo tee -a ${COLLECTD_CONFIG} > /dev/null <<EOF
<Plugin table>
<Table "/sys/class/hwmon/hwmon0/temp1_input">
Instance localhost
Separator " "
<Result>
Type gauge
InstancePrefix "cpu_temp"
ValuesFrom 0
</Result>
</Table>
</Plugin>
<Plugin "disk">
Disk "ubi0:rootfs"
IgnoreSelected false
</Plugin>
EOF
fi
# Dump1090 specific values.
if [[ "${DUMP1090_INSTALLED}" = "true" ]] ; then
sudo tee -a ${COLLECTD_CONFIG} > /dev/null <<EOF
if [[ "${dump1090_installed}" == "true" ]] ; then
sudo tee -a ${collectd_config} > /dev/null <<EOF
#----------------------------------------------------------------------------#
# Configure the dump1090 python module. #
# Configure the dump1090-tools python module. #
# #
# Each Instance block collects statistics from a separate named dump1090. #
# The URL should be the base URL of the webmap, i.e. in the examples below, #
# statistics will be loaded from http://localhost/dump1090/data/stats.json #
#----------------------------------------------------------------------------#
<Plugin python>
ModulePath "${PORTAL_BUILD_DIRECTORY}/graphs"
ModulePath "${RECEIVER_BUILD_DIRECTORY}/portal/graphs"
LogTraces true
Import "dump1090"
<Module dump1090>
@ -268,64 +183,8 @@ if [[ "${DUMP1090_INSTALLED}" = "true" ]] ; then
EOF
fi
# RTLSDR-OGN specific values.
if [[ "${RTLSDROGN_INSTALLED}" = "true" ]] ; then
sudo tee -a ${COLLECTD_CONFIG} > /dev/null <<EOF
#----------------------------------------------------------------------------#
# RTLSDR-OGN Graphs #
#----------------------------------------------------------------------------#
<Plugin curl>
<Page "rtlsdr-ogn">
URL "http://localhost:8080/"
# OGN center Frequency
<Match>
Regex "<tr><td>RF.OGN.CenterFreq</td><td align=right><b>([0-9]*\\.[0-9]+) MHz</b></td></tr>"
DSType "GaugeLast"
Type "frequency"
Instance "Center-Frequency-OGN"
</Match>
# GSM center Frequency
<Match>
Regex "<tr><td>RF.GSM.CenterFreq</td><td align=right><b>([0-9]*\\.[0-9]+) MHz</b></td></tr>"
DSType "GaugeLast"
Type "frequency"
Instance "Center-Frequency-GSM"
</Match>
# OGN Frequency Correction
<Match>
Regex "<tr><td>Frequency correction</td><td align=right><b>([\+\-][0-9]*\\.[0-9]+) ppm</b></td></tr>"
DSType "GaugeLast"
Type "frequency_offset"
Instance "Frequency-Correction-OGN"
</Match>
# NTP Frequency Correction
<Match>
Regex "<tr><td>NTP freq. corr.</td><td align=right><b>([\+\-][0-9]*\\.[0-9]+) ppm</b></td></tr>"
DSType "GaugeLast"
Type "frequency_offset"
Instance "Frequency-Correction-NTP"
</Match>
# OGN Gain
<Match>
Regex "<tr><td>RF.OGN.Gain</td><td align=right><b>([0-9]*\\.[0-9]+) dB</b></td></tr>"
DSType "GaugeLast"
Type "gauge"
Instance "Gain-OGN"
</Match>
# GSM Gain
<Match>
Regex "<tr><td>RF.GSM.Gain</td><td align=right><b>([0-9]*\\.[0-9]+) dB</b></td></tr>"
DSType "GaugeLast"
Type "gauge"
Instance "Gain-GSM"
</Match>
</Page>
</Plugin>
EOF
fi
# Remaining config for all installations.
sudo tee -a ${COLLECTD_CONFIG} > /dev/null <<EOF
sudo tee -a ${collectd_config} > /dev/null <<EOF
<Chain "PostCache">
<Rule>
<Match regex>
@ -341,32 +200,27 @@ sudo tee -a ${COLLECTD_CONFIG} > /dev/null <<EOF
</Chain>
EOF
## RELOAD COLLECTD
echo -e "\e[94m Reloading collectd so the new configuration is used...\e[97m"
log_message "Reloading collectd so the new configuration is used"
sudo service collectd force-reload
## EDIT CRONTAB
if [[ ! -x "${PORTAL_BUILD_DIRECTORY}/graphs/make-collectd-graphs.sh" ]] ; then
echo -e "\e[94m Making the make-collectd-graphs.sh script executable...\e[97m"
chmod +x ${PORTAL_BUILD_DIRECTORY}/graphs/make-collectd-graphs.sh
if [[ ! -x "${RECEIVER_BUILD_DIRECTORY}/portal/graphs/make-collectd-graphs.sh" ]] ; then
log_message "Making the make-collectd-graphs.sh script executable"
chmod +x ${RECEIVER_BUILD_DIRECTORY}/portal/graphs/make-collectd-graphs.sh
fi
# The next block is temporary in order to insure this file is
# deleted on older installation before the project renaming.
if [[ -f "/etc/cron.d/adsb-feeder-performance-graphs" ]] ; then
echo -e "\e[94m Removing outdated performance graphs cron file...\e[97m"
sudo rm -f /etc/cron.d/adsb-feeder-performance-graphs
if [[ -f "${collectd_cron_file}" ]] ; then
log_message "Removing previously installed performance graphs cron file"
sudo rm -f ${collectd_cron_file}
fi
if [[ -f "${COLLECTD_CRON_FILE}" ]] ; then
echo -e "\e[94m Removing previously installed performance graphs cron file...\e[97m"
sudo rm -f ${COLLECTD_CRON_FILE}
fi
echo -e "\e[94m Adding performance graphs cron file...\e[97m"
sudo tee ${COLLECTD_CRON_FILE} > /dev/null <<EOF
log_message "Adding performance graphs cron file"
sudo tee ${collectd_cron_file} > /dev/null <<EOF
# Updates the portal's performance graphs.
#
# Every 5 minutes new hourly graphs are generated.
@ -378,32 +232,26 @@ sudo tee ${COLLECTD_CRON_FILE} > /dev/null <<EOF
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
*/5 * * * * root bash ${PORTAL_BUILD_DIRECTORY}/graphs/make-collectd-graphs.sh 1h >/dev/null 2>&1
*/10 * * * * root bash ${PORTAL_BUILD_DIRECTORY}/graphs/make-collectd-graphs.sh 6h >/dev/null 2>&1
2,12,22,32,42,52 * * * * root bash ${PORTAL_BUILD_DIRECTORY}/graphs/make-collectd-graphs.sh 24h >/dev/null 2>&1
4,24,44 * * * * root bash ${PORTAL_BUILD_DIRECTORY}/graphs/make-collectd-graphs.sh 7d >/dev/null 2>&1
6 * * * * root bash ${PORTAL_BUILD_DIRECTORY}/graphs/make-collectd-graphs.sh 30d >/dev/null 2>&1
8 */12 * * * root bash ${PORTAL_BUILD_DIRECTORY}/graphs/make-collectd-graphs.sh 365d >/dev/null 2>&1
*/5 * * * * root bash ${RECEIVER_BUILD_DIRECTORY}/portal/graphs/make-collectd-graphs.sh 1h >/dev/null 2>&1
*/10 * * * * root bash ${RECEIVER_BUILD_DIRECTORY}/portal/graphs/make-collectd-graphs.sh 6h >/dev/null 2>&1
2,12,22,32,42,52 * * * * root bash ${RECEIVER_BUILD_DIRECTORY}/portal/graphs/make-collectd-graphs.sh 24h >/dev/null 2>&1
4,24,44 * * * * root bash ${RECEIVER_BUILD_DIRECTORY}/portal/graphs/make-collectd-graphs.sh 7d >/dev/null 2>&1
6 * * * * root bash ${RECEIVER_BUILD_DIRECTORY}/portal/graphs/make-collectd-graphs.sh 30d >/dev/null 2>&1
8 */12 * * * root bash ${RECEIVER_BUILD_DIRECTORY}/portal/graphs/make-collectd-graphs.sh 365d >/dev/null 2>&1
EOF
# Update max_range.rrd to remove the 500 km / ~270 nmi limit.
if [ -f "/var/lib/collectd/rrd/localhost/dump1090-localhost/dump1090_range-max_range.rrd" ]; then
if [[ `rrdinfo ${DUMP1090_MAX_RANGE_RRD} | grep -c "ds\[value\].max = 1.0000000000e+06"` -eq 0 ]] ; then
echo -e "\e[94m Removing 500km/270mi limit from max_range.rrd...\e[97m"
sudo rrdtool tune ${DUMP1090_MAX_RANGE_RRD} --maximum "value:1000000"
if [[ `rrdinfo ${dump1090_max_range_rrd} | grep -c "ds\[value\].max = 1.0000000000e+06"` -eq 0 ]] ; then
log_message "Removing 500km/270mi limit from max_range.rrd"
sudo rrdtool tune ${dump1090_max_range_rrd} --maximum "value:1000000"
fi
fi
# Increase size of weekly messages table to 8 days
if [ -f ${DUMP1090_MESSAGES_LOCAL_RRD} ]; then
if [[ `rrdinfo ${DUMP1090_MESSAGES_LOCAL_RRD} | grep -c "rra\[6\]\.rows = 1260"` -eq 1 ]] ; then
echo -e "\e[94m Increasing weekly table size to 8 days in messages-local_accepted.rrd...\e[97m"
sudo rrdtool tune ${DUMP1090_MESSAGES_LOCAL_RRD} 'RRA#6:=1440' 'RRA#7:=1440' 'RRA#8:=1440'
if [[ -f ${dump1090_messages_local_rrd} ]]; then
if [[ `rrdinfo ${dump1090_messages_local_rrd} | grep -c "rra\[6\]\.rows = 1260"` -eq 1 ]] ; then
log_message "Increasing weekly table size to 8 days in messages-local_accepted.rrd"
sudo rrdtool tune ${dump1090_messages_local_rrd} 'RRA#6:=1440' 'RRA#7:=1440' 'RRA#8:=1440'
fi
fi
### SETUP COMPLETE
# Return to the project root directory.
echo -e "\e[94m Entering the ADS-B Receiver Project root directory...\e[97m"
cd ${RECEIVER_ROOT_DIRECTORY}

Plik diff jest za duży Load Diff

Wyświetl plik

@ -1,50 +0,0 @@
#!/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-2024 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
PORTAL_PYTHON_DIRECTORY="${RECEIVER_BUILD_DIRECTORY}/python"
PYTHON_PATH=`which python`
## SETUP FLIGHT LOGGING
echo -e ""
echo -e "\e[95m Setting up flight logging...\e[97m"
echo -e ""
# Create the cron jobs responsible for logging and maintenance.
echo -e "\e[94m Creating the maintenance maintenance script...\e[97m"
sudo tee /etc/cron.d/adsb-receiver-flight-logging > /dev/null <<EOF
* * * * * root ${PYTHON_PATH} ${PORTAL_PYTHON_DIRECTORY}/flights.py; sleep 30; root ${PYTHON_PATH} ${PORTAL_PYTHON_DIRECTORY}/flights.py
30 * * * * root ${PYTHON_PATH} ${PORTAL_PYTHON_DIRECTORY}/maintenance.py
EOF

Wyświetl plik

@ -1,230 +0,0 @@
#!/bin/bash
#####################################################################################
# ADS-B RECEIVER #
#####################################################################################
# #
# This script is meant only to create offical Raspbian releases for this project. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# Copyright (c) 2015-2016 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. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
################################################################
## THIS SCRIPT IS ONLY MEANT FOR RASPBIAN IMAGE PREPERATION ##
################################################################
# #
# This script must be ran from the projects root directory. #
# #
# pi@darkstar: ./bash/tools/image_setup.sh #
# #
################################################################
clear
## 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
echo -e ""
echo -e "\e[91m The ADS-B Receiver Project Image Preparation Script\e[97m"
echo -e ""
## UPDATE REPOSITORY LISTS AND OPERATING SYSTEM
echo -e "\e[95m Updating repository lists and operating system...\e[97m"
echo -e ""
sudo apt-get update
sudo apt-get -y dist-upgrade
## INSTALL DUMP1090
echo -e ""
echo -e "\e[95m Installing prerequisite packages...\e[97m"
echo -e ""
CheckPackage git
CheckPackage curl
CheckPackage build-essential
CheckPackage debhelper
CheckPackage cron
CheckPackage rtl-sdr
CheckPackage librtlsdr-dev
CheckPackage libusb-1.0-0-dev
CheckPackage pkg-config
CheckPackage lighttpd
CheckPackage fakeroot
CheckPackage bc
## SETUP RTL-SDR RULES
echo -e "\e[95m Setting up RTL-SDR udev rules...\e[97m"
sudo curl --http1.1 https://raw.githubusercontent.com/osmocom/rtl-sdr/master/rtl-sdr.rules --output /etc/udev/rules.d/rtl-sdr.rules
sudo service udev restart
BlacklistModules
# Ask which version of dump1090 to install.
DUMP1090OPTION=$(whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" --title "Choose Dump1090 Version" --menu "Which version of dump1090 is to be installed?" 12 65 2 "dump1090-mutability" "(Mutability)" "dump1090-fa" "(FlightAware)" 3>&1 1>&2 2>&3)
case ${DUMP1090OPTION} in
"dump1090-mutability")
echo -e "\e[95m Installing dump1090-mutability...\e[97m"
echo -e ""
# Dump1090-mutability
echo -e ""
echo -e "\e[95m Installing dump1090-mutability...\e[97m"
echo -e ""
mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/dump1090-mutability
cd ${RECEIVER_BUILD_DIRECTORY}/dump1090-mutability 2>&1
git clone https://github.com/mutability/dump1090.git
cd ${RECEIVER_BUILD_DIRECTORY}/dump1090-mutability/dump1090 2>&1
dpkg-buildpackage -b
cd ${RECEIVER_BUILD_DIRECTORY}/dump1090-mutability 2>&1
sudo dpkg -i dump1090-mutability_1.15~dev_*.deb
;;
"dump1090-fa")
echo -e "\e[95m Installing dump1090-fa and PiAware...\e[97m"
echo -e ""
# Install prerequisite packages.
echo -e "\e[95m Installing additional dump1090-fa and PiAware prerequisite packages...\e[97m"
echo -e ""
CheckPackage dh-systemd
CheckPackage libncurses5-dev
CheckPackage cmake
CheckPackage doxygen
CheckPackage libtecla-dev
CheckPackage help2man
CheckPackage pandoc
CheckPackage tcl8.6-dev
CheckPackage autoconf
CheckPackage python3-dev
CheckPackage python3-venv
CheckPackage virtualenv
CheckPackage zlib1g-dev
CheckPackage tclx8.4
CheckPackage tcllib
CheckPackage tcl-tls
CheckPackage itcl3
CheckPackage net-tools
# bladeRF
echo ""
echo -e "\e[95m Installing bladeRF...\e[97m"
echo ""
mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/bladeRF
cd ${RECEIVER_BUILD_DIRECTORY}/bladeRF 2>&1
git clone https://github.com/Nuand/bladeRF.git
cd ${RECEIVER_BUILD_DIRECTORY}/bladeRF/bladeRF 2>&1
dpkg-buildpackage -b
cd ${RECEIVER_BUILD_DIRECTORY}/bladeRF 2>&1
sudo dpkg -i libbladerf1_*.deb
sudo dpkg -i libbladerf-dev_*.deb
sudo dpkg -i libbladerf-udev_*.deb
# Dump1090-fa
echo -e ""
echo -e "\e[95m Installing dump1090-fa...\e[97m"
echo -e ""
mkdir -vp ${RECEIVER_BUILD_DIRECTORY}/dump1090-fa
cd ${RECEIVER_BUILD_DIRECTORY}/dump1090-fa 2>&1
git clone https://github.com/flightaware/dump1090.git
cd ${RECEIVER_BUILD_DIRECTORY}/dump1090-fa/dump1090 2>&1
dpkg-buildpackage -b
cd ${RECEIVER_BUILD_DIRECTORY}/dump1090-fa 2>&1
sudo dpkg -i dump1090-fa_*.deb
# PiAware
cd ${RECEIVER_BUILD_DIRECTORY} 2>&1
git clone https://github.com/flightaware/piaware_builder.git
cd ${RECEIVER_BUILD_DIRECTORY}/piaware_builder 2>&1
./sensible-build.sh jessie
cd ${RECEIVER_BUILD_DIRECTORY}/piaware_builder/package-jessie 2>&1
dpkg-buildpackage -b
sudo dpkg -i ${RECEIVER_BUILD_DIRECTORY}/piaware_builder/piaware_*.deb
;;
*)
# Nothing selected.
exit 1
;;
esac
## INSTALL THE BASE PORTAL PREREQUISITES PACKAGES
echo -e ""
echo -e "\e[95m Installing packages needed by the ADS-B Receiver Project Web Portal...\e[97m"
echo -e ""
CheckPackage lighttpd
CheckPackage collectd-core
CheckPackage rrdtool
CheckPackage libpython2.7
CheckPackage php7.0-cgi
CheckPackage php7.0-json
## PREVIOUS LOCALE SCRIPTING THAT SET LOCALE NO LONGER WORKS PROPERLY ON STRETCH.
## The scripting setting this using this script has been removed for now.
## We will manually set this using rasp-config when creating the script in the meantime.
## Later I will look into automating this but time is short on the v2.6.0 release.
## TOUCH THE IMAGE FILE
echo -e "\e[95m Touching the \"image\" file...\e[97m"
cd ${RECEIVER_ROOT_DIRECTORY} 2>&1
touch image
## CHANGE THE PASSWORD FOR THE USER PI
echo -e "\e[95m Changing the password for the user pi...\e[97m"
echo "pi:adsbreceiver" | sudo chpasswd
## ENABLE SSH
echo -e "\e[95m Touching the \"ssh\" file...\e[97m"
sudo touch /boot/ssh
echo -e "\e[95m Reconfiguring openssh-server...\e[97m"
sudo rm -f /etc/ssh/ssh_host_* && sudo dpkg-reconfigure openssh-server
## CLEAR BASH HISTORY
history -c && history -w
## DONE
echo -e ""
echo -e "\e[91m Image preparation completed.)\e[39m"
echo -e "\e[91m Device will be shut down in 5 seconds.\e[39m"
echo -e ""
sleep 5
sudo halt
exit 0

Wyświetl plik

@ -1,38 +1,5 @@
#!/bin/bash
#####################################################################################
# ADS-B RECEIVER #
#####################################################################################
# #
# This script was created to allow users to backup their portal data. At this #
# time this script has not been integrated into the current collection of #
# scripts. However this script, possibly in a modified form, will be integrated #
# for simplified use by those who set up their receivers using this project. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# 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
BACKUPDATE=$(date +"%Y-%m-%d-%H%M%S")
@ -43,64 +10,58 @@ RAWDOCUMENTROOT=`/usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf -p | grep ser
LIGHTTPDDOCUMENTROOT=`sed 's/.*"\(.*\)"[^"]*$/\1/' <<< ${RAWDOCUMENTROOT}`
COLLECTD_RRD_DIRECTORY="/var/lib/collectd/rrd"
## BEGIN THE BACKUP PROCESS
clear
echo -e "\n\e[91m ADSB Receiver Project Maintenance"
echo -e "\n\e[91m ADS-B Portal Maintenance"
echo -e ""
echo -e "\e[92m Backing up portal data..."
echo -e "\e[92m Backing up portal data"
echo -e "\e[93m ------------------------------------------------------------------------------\e[97m"
echo -e ""
echo -e "\e[95m Backing up current portal data...\e[97m"
echo -e ""
## PREPARE TO BEGIN CREATING BACKUPS
# Get the database type used.
echo -e "\e[94m Declare the database engine being used...\e[97m"
DATABASEENGINE=`grep 'db_driver' ${LIGHTTPDDOCUMENTROOT}/classes/settings.class.php | tail -n1 | cut -d\' -f2`
echo -e "\e[94m Declare whether or not the advnaced portal features were installed...\e[97m"
echo -e "\e[94m Declare whether or not the advanaced portal features were installed...\e[97m"
# Decide if the advanced portal features were installed or not.
echo -e "\e[94m Declare whether or not the advnaced portal features were installed...\e[97m"
echo -e "\e[94m Declare whether or not the advanaced portal features were installed...\e[97m"
if [[ "${DATABASEENGINE}" = "xml" ]] ; then
ADVANCED=FALSE
else
ADVANCED=TRUE
fi
# Get the path to the SQLite database if SQLite is used for the database.
if [[ "${DATABASEENGINE}" = "sqlite" ]] ; then
DATABASEPATH=`grep 'db_host' ${LIGHTTPDDOCUMENTROOT}/classes/settings.class.php | tail -n1 | cut -d\' -f2`
fi
# Assign the MySQL login credentials to variables if a MySQL database is being used.
if [[ "${DATABASEENGINE}" = "mysql" ]] ; then
MYSQLDATABASE=`grep 'db_database' ${LIGHTTPDDOCUMENTROOT}/classes/settings.class.php | tail -n1 | cut -d\' -f2`
MYSQLUSERNAME=`grep 'db_username' ${LIGHTTPDDOCUMENTROOT}/classes/settings.class.php | tail -n1 | cut -d\' -f2`
MYSQLPASSWORD=`grep 'db_password' ${LIGHTTPDDOCUMENTROOT}/classes/settings.class.php | tail -n1 | cut -d\' -f2`
fi
# Check that the backup directory exists.
echo -e "\e[94m Checking that the directory ${BACKUPSDIRECTORY} exists...\e[97m"
if [[ ! -d "${BACKUPSDIRECTORY}" ]] ; then
# Create the backups directory.
echo -e "\e[94m Creating the directory ${BACKUPSDIRECTORY}...\e[97m"
mkdir -vp ${BACKUPSDIRECTORY}
fi
# Check that the temporary directory exists.
echo -e "\e[94m Checking that the directory ${TEMPORARY_DIRECTORY} exists...\e[97m"
if [[ ! -d "${TEMPORARY_DIRECTORY}" ]] ; then
# Create the tmp directory.
echo -e "\e[94m Creating the directory ${TEMPORARY_DIRECTORY}...\e[97m"
mkdir -vp ${TEMPORARY_DIRECTORY}
fi
## BACKUP THE COLLECTD RRD FILES BY EXPORTING THEM TO XML.
# 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"
@ -117,10 +78,10 @@ else
done
fi
## BACKUP PORTAL USING LITE FEATURES AND XML FILES
if [[ "${ADVANCED}" = "FALSE" ]] ; then
# Copy the portal XML data files to the temporary directory.
echo -e "\e[94m Checking that the directory ${TEMPORARY_DIRECTORY}/var/www/html/data/ exists...\e[97m"
if [[ ! -d "${TEMPORARY_DIRECTORY}/var/www/html/data/" ]] ; then
mkdir -vp ${TEMPORARY_DIRECTORY}/var/www/html/data/
@ -129,18 +90,18 @@ if [[ "${ADVANCED}" = "FALSE" ]] ; then
sudo cp -R /var/www/html/data/*.xml ${TEMPORARY_DIRECTORY}/var/www/html/data/
else
## BACKUP PORTAL USING ADVANCED FEATURES AND A SQLITE DATABASE
if [[ "${DATABASEENGINE}" = "sqlite" ]] ; then
# Copy the portal SQLite database file to the temporary directory.
echo -e "\e[94m Backing up the SQLite database file to ${TEMPORARY_DIRECTORY}/var/www/html/data/portal.sqlite...\e[97m"
sudo cp -R ${DATABASEPATH} ${TEMPORARY_DIRECTORY}/var/www/html/data/portal.sqlite
fi
## BACKUP PORTAL USING ADVANCED FEATURES AND A MYSQL DATABASE
if [[ "${DATABASEENGINE}" = "mysql" ]] ; then
# Dump the current MySQL database to a .sql text file.
echo -e "\e[94m Dumping the MySQL database ${MYSQLDATABASE} to the file ${TEMPORARY_DIRECTORY}/${MYSQLDATABASE}.sql...\e[97m"
mysqldump -u${MYSQLUSERNAME} -p${MYSQLPASSWORD} ${MYSQLDATABASE} > ${TEMPORARY_DIRECTORY}/${MYSQLDATABASE}.sql
fi
@ -148,16 +109,14 @@ fi
## COMPRESS AND DATE THE BACKUP ARCHIVE
# Create the backup archive.
echo -e "\e[94m Compressing the backed up files...\e[97m"
echo -e ""
tar -zcvf ${BACKUPSDIRECTORY}/adsb-receiver_data_${BACKUPDATE}.tar.gz ${TEMPORARY_DIRECTORY}
echo -e ""
# Remove the temporary directory.
echo -e "\e[94m Removing the temporary backup directory...\e[97m"
sudo rm -rf ${TEMPORARY_DIRECTORY}
## BACKUP PROCESS COMPLETE
echo -e "\e[32m"

Wyświetl plik

@ -1,58 +1,35 @@
#!/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-2024, 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. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
## DISPLAY COLORS
display_default="\033[0m"
display_heading="\033[1;36m"
display_message="\033[2;36m"
display_project_name="\033[1;31m"
display_title_heading="\033[1;32m"
display_title_message="\033[2;32m"
display_warning_heading="\033[1;33m"
display_warning_message="\033[2;33m"
display_alert_heading="\033[1;31m"
display_alert_message="\033[2;31m"
display_false_inline="\033[2;31m"
display_true_inline="\033[2;32m"
## SOFTWARE VERSIONS
# The ADS-B Receiver Project
PROJECT_VERSION="2.8.0"
# RTL-SDR OGN
RTLSDROGN_VERSION="0.2.5"
# FlightAware
DUMP1090_FA_VERSION="9.0"
DUMP978_FA_VERSION="9.0"
PIAWARE_VERSION="9.0.1"
SKYAWARE978_VERSION="9.0"
dump1090_fa_current_version="9.0"
dump978_fa_current_version="9.0"
piaware_current_version="9.0.1"
# PlaneFinder Client
PLANEFINDER_CLIENT_VERSION_ARMHF="5.0.161"
PLANEFINDER_CLIENT_VERSION_ARM64="5.1.440"
PLANEFINDER_CLIENT_VERSION_AMD64="5.0.162"
PLANEFINDER_CLIENT_VERSION_I386="5.0.161"
pfclient_current_version_armhf="5.0.161"
pfclient_current_version_arm64="5.1.440"
pfclient_current_version_amd64="5.0.162"
pfclient_current_version_i386="5.0.161"
# Flightradar24 Client
FLIGHTRADAR24_CLIENT_VERSION="1.0.18-5"
fr24feed_current_version="1.0.48-0"
# OpenSky Network Client
OPENSKY_NETWORK_CLIENT_VERSION="2.1.7-1"
opensky_feeder_current_version="2.1.7-1"

15
build/.gitignore vendored
Wyświetl plik

@ -1,15 +0,0 @@
# exclude build directories
AboveTustin/
adsbexchange/
acarsdec/
dump1090*
gps/
hab/
mlat-client/
mlat-client*
ogn/
phantomjs*
piaware_builder/
planefinder/
portal/graphs/dump1090.pyc
portal/logging/

Wyświetl plik

@ -1,77 +0,0 @@
#####################################################################################
# ADS-B RECEIVER #
#####################################################################################
# #
# 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 #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# 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. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
import json
import datetime
from oled.device import ssd1306, sh1106
from oled.render import canvas
from PIL import ImageDraw, ImageFont
from time import time, sleep
with open('/run/dump1090-mutability/aircraft.json') as aircraft_json:
aircraft_data = json.load(aircraft_json)
def date_and_time():
now = datetime.datetime.now()
return now.strftime("%m/%d/%Y %I:%M %p")
def aircraft_total():
return len(aircraft_data['aircraft'])
def aircraft_with_positions():
with_positions = 0
for aircraft in aircraft_data['aircraft']:
if 'seen_pos' in aircraft:
with_positions += 1
return with_positions
def stats(oled):
font = ImageFont.load_default()
font2 = ImageFont.truetype('fonts/alert.ttf', 12)
font3 = ImageFont.truetype('fonts/alert.ttf', 36)
with canvas(oled) as draw:
draw.text((0, 0), date_and_time(), font=font2, fill=255)
draw.text((0, 14), "Total / With Positions", font=font2, fill=255)
draw.text((0, 28), str(aircraft_total()) + "/" + str(aircraft_with_positions()), font=font3, fill=255)
def main():
oled = ssd1306(port=1, address=0x3C)
stats(oled)
if __name__ == "__main__":
main()

Plik binarny nie jest wyświetlany.

Wyświetl plik

@ -1,21 +0,0 @@
------------------------------------------------------------------------
The following license covers the files dump1090.db and dump1090.py
which were borrowed from Oliver Jowett's dump1090-tools project.
DUMP1090-TOOLS (https://github.com/mutability/dump1090-tools)
------------------------------------------------------------------------
Copyright (c) 2015, Oliver Jowett <oliver@mutability.co.uk>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

Wyświetl plik

@ -1,3 +1,17 @@
# Copyright (c) 2015, Oliver Jowett <oliver@mutability.co.uk>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
import collectd
import json, math
from contextlib import closing
@ -186,7 +200,7 @@ def read_aircraft(instance_name, host, url):
with closing(urlopen(url + '/data/receiver.json', None, 5.0)) as receiver_file:
receiver = json.load(receiver_file)
if 'lat' not in receiver:
if 'lat' in receiver:
rlat = float(receiver['lat'])
rlon = float(receiver['lon'])
else:
@ -203,8 +217,8 @@ def read_aircraft(instance_name, host, url):
max_range = 0
mlat = 0
for a in aircraft_data['aircraft']:
if a['seen'] < 15: total += 1
if 'seen_pos' in a and a['seen_pos'] < 15:
if a['seen'] < 60: total += 1
if 'seen_pos' in a and a['seen_pos'] < 60:
with_pos += 1
if rlat is not None:
distance = greatcircle(rlat, rlon, a['lat'], a['lon'])

Wyświetl plik

@ -287,7 +287,7 @@ temp_graph_imperial() {
--upper-limit 212 \
--rigid \
--units-exponent 1 \
"DEF:traw=$2/gauge-cpu_temp.rrd:value:MAX" \
"DEF:traw=$2/temperature.rrd:value:MAX" \
"CDEF:tta=traw,1000,/" \
"CDEF:ttb=tta,1.8,*" \
"CDEF:ttc=ttb,32,+" \
@ -310,7 +310,7 @@ temp_graph_metric() {
--upper-limit 100 \
--rigid \
--units-exponent 1 \
"DEF:traw=$2/gauge-cpu_temp.rrd:value:MAX" \
"DEF:traw=$2/temperature.rrd:value:MAX" \
"CDEF:tfin=traw,1000,/" \
"AREA:tfin#ffcc00" \
"COMMENT: \n" \
@ -629,8 +629,8 @@ system_graphs() {
disk_io_octets_graph ${DOCUMENTROOT}/graphs/system-$2-disk_io_octets-$4.png /var/lib/collectd/rrd/$1/disk-mmcblk0 "$3" "$4" "$5"
eth0_graph ${DOCUMENTROOT}/graphs/system-$2-eth0_bandwidth-$4.png /var/lib/collectd/rrd/$1/interface-eth0 "$3" "$4" "$5"
memory_graph ${DOCUMENTROOT}/graphs/system-$2-memory-$4.png /var/lib/collectd/rrd/$1/memory "$3" "$4" "$5"
temp_graph_imperial ${DOCUMENTROOT}/graphs/system-$2-temperature_imperial-$4.png /var/lib/collectd/rrd/$1/table-$2 "$3" "$4" "$5"
temp_graph_metric ${DOCUMENTROOT}/graphs/system-$2-temperature_metric-$4.png /var/lib/collectd/rrd/$1/table-$2 "$3" "$4" "$5"
temp_graph_imperial ${DOCUMENTROOT}/graphs/system-$2-temperature_imperial-$4.png /var/lib/collectd/rrd/$1/thermal-thermal_zone0 "$3" "$4" "$5"
temp_graph_metric ${DOCUMENTROOT}/graphs/system-$2-temperature_metric-$4.png /var/lib/collectd/rrd/$1/thermal-thermal_zone0 "$3" "$4" "$5"
wlan0_graph ${DOCUMENTROOT}/graphs/system-$2-wlan0_bandwidth-$4.png /var/lib/collectd/rrd/$1/interface-wlan0 "$3" "$4" "$5"
}

Wyświetl plik

@ -0,0 +1,32 @@
<?php
// Start session
session_start();
// Load the common PHP classes.
require_once('classes/common.class.php');
require_once('classes/template.class.php');
require_once('classes/acars.class.php');
$common = new common();
$template = new template();
$acars = new acars();
$pageData = array();
// The title of this page.
$pageData['title'] = "ACARS Messages";
// Pagination.
$items_per_page = 15;
$page = (isset($_GET['page']) ? $_GET['page'] : 1);
$message_count = $acars->getAcarsMessageCount();
// Get most recent ACARS messages.
$messages = $acars->getAcarsMessages($items_per_page, ($items_per_page * $page));
$pageData['acarsMessages'] = $messages;
// Calculate the number of pagination links to show.
$pageData['pageLinks'] = ceil($message_count / $items_per_page);
$template->display($pageData);
?>

Wyświetl plik

@ -1,33 +1,4 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2016 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. //
/////////////////////////////////////////////////////////////////////////////////////
session_start();
$passwordIncorrect = FALSE;

Wyświetl plik

@ -1,33 +1,4 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2024 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. //
/////////////////////////////////////////////////////////////////////////////////////
session_start();
// Load the require PHP classes.

Wyświetl plik

@ -1,33 +1,4 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2016 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. //
/////////////////////////////////////////////////////////////////////////////////////
session_start();
// Load the require PHP classes.

Wyświetl plik

@ -1,33 +1,4 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2024 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. //
/////////////////////////////////////////////////////////////////////////////////////
session_start();
// Load the require PHP classes.

Wyświetl plik

@ -1,33 +1,4 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2016 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. //
/////////////////////////////////////////////////////////////////////////////////////
session_start();
// Load the require PHP classes.

Wyświetl plik

@ -1,33 +1,4 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2016 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. //
/////////////////////////////////////////////////////////////////////////////////////
session_start();
// Load the require PHP classes.

Wyświetl plik

@ -1,34 +1,4 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2016 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. //
/////////////////////////////////////////////////////////////////////////////////////
require_once($_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR."classes".DIRECTORY_SEPARATOR."settings.class.php");
require_once($_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR."classes".DIRECTORY_SEPARATOR."common.class.php");

Wyświetl plik

@ -7,9 +7,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/admin/assets/css/bootstrap.min.css">
<link rel="stylesheet" href="/admin/assets/css/bootstrap-theme.min.css">
<?php if (basename($_SERVER['PHP_SELF']) == "index.php") { ?>
<link rel="stylesheet" href="/admin/assets/css/jquery.datetimepicker.css">
<?php } ?>
<link rel="stylesheet" href="/admin/assets/css/admin.css">
<script src="/admin/assets/js/jquery-3.1.1.min.js"></script>
<script src="/admin/assets/js/bootstrap.min.js"></script>

Wyświetl plik

@ -1,33 +1,4 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2016 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. //
/////////////////////////////////////////////////////////////////////////////////////
session_start();
// Load the require PHP classes.
@ -73,7 +44,7 @@
$dbh = NULL;
foreach ($savedFlights as $flight) {
// Remove flight if not in list.
if (!in_array($flight, $notificationArray)) {
if (!in_array($flight, $notificationArray ?? [])) {
$dbh = $common->pdoOpen();
$sql = "DELETE FROM ".$settings::db_prefix."flightNotifications WHERE flight = :flight";
$sth = $dbh->prepare($sql);
@ -106,6 +77,10 @@
if (isset($_POST['enableBlog']) && $_POST['enableBlog'] == "TRUE")
$enableBlog = TRUE;
$enableAcars = FALSE;
if (isset($_POST['enableAcars']) && $_POST['enableAcars'] == "TRUE")
$enableAcars = TRUE;
$enableInfo = FALSE;
if (isset($_POST['enableInfo']) && $_POST['enableInfo'] == "TRUE")
$enableInfo = TRUE;
@ -154,6 +129,10 @@
if (isset($_POST['hideNavbarAndFooter']) && $_POST['hideNavbarAndFooter'] == "TRUE")
$hideNavbarAndFooter = TRUE;
$purgeOlderData = FALSE;
if (isset($_POST['purgeOlderData']) && $_POST['purgeOlderData'] == "TRUE")
$purgeOlderData = TRUE;
// Update settings using those supplied by the form.
$common->updateSetting("siteName", $_POST['siteName']);
$common->updateSetting("template", $_POST['template']);
@ -161,6 +140,7 @@
$common->updateSetting("dateFormat", $_POST['dateFormat']);
$common->updateSetting("enableFlights", $enableFlights);
$common->updateSetting("enableBlog", $enableBlog);
$common->updateSetting("enableAcars", $enableAcars);
$common->updateSetting("enableInfo", $enableInfo);
$common->updateSetting("enableGraphs", $enableGraphs);
$common->updateSetting("enableLinks", $enableLinks);
@ -183,6 +163,9 @@
$common->updateSetting("enableWebNotifications", $enableWebNotifications);
$common->updateSetting("googleMapsApiKey", $_POST['googleMapsApiKey']);
$common->updateSetting("hideNavbarAndFooter", $hideNavbarAndFooter);
$common->updateSetting("purge_older_data", $purgeOlderData);
$common->updateSetting("days_to_save", $_POST['daysToSave']);
$common->updateSetting("acarsserv_database", $_POST['acarsservDatabase']);
// Purge older flight positions.
if (isset($_POST['purgepositions'])) {
@ -223,7 +206,7 @@
}
$enableWebNotifications = $common->getSetting("enableWebNotifications");
// Get general settings from settings.xml.
// Get general settings.
$siteName = $common->getSetting("siteName");
$currentTemplate = $common->getSetting("template");
$defaultPage = $common->getSetting("defaultPage");
@ -231,9 +214,10 @@
$timeZone = $common->getSetting("timeZone");
$googleMapsApiKey = $common->getSetting("googleMapsApiKey");
// Get navigation settings from settings.xml.
// Get navigation settings.
$enableFlights = $common->getSetting("enableFlights");
$enableBlog = $common->getSetting("enableBlog");
$enableAcars = $common->getSetting("enableAcars");
$enableInfo = $common->getSetting("enableInfo");
$enableGraphs = $common->getSetting("enableGraphs");
$enableLinks = $common->getSetting("enableLinks");
@ -242,7 +226,7 @@
$enablePfclient = $common->getSetting("enablePfclient");
$hideNavbarAndFooter = $common->getSetting("hideNavbarAndFooter");
// Get aggregate site settings from settings.xml.
// Get aggregate site settings.
$enableFlightAwareLink = $common->getSetting("enableFlightAwareLink");
$flightAwareLogin = $common->getSetting("flightAwareLogin");
$flightAwareSite = $common->getSetting("flightAwareSite");
@ -252,14 +236,21 @@
$flightRadar24Id = $common->getSetting("flightRadar24Id");
$enableAdsbExchangeLink = $common->getSetting("enableAdsbExchangeLink");
// Get units of measurement setting from settings.xml.
// ACARS settings.
$acarsservDatabase = $common->getSetting("acarsserv_database");
// Get units of measurement settings.
$measurementRange = $common->getSetting("measurementRange");
$measurementTemperature = $common->getSetting("measurementTemperature");
$measurementBandwidth = $common->getSetting("measurementBandwidth");
// Get the network interface from settings.xml.
// Get the network interface settings.
$networkInterface = $common->getSetting("networkInterface");
// Get data purge settings.
$purgeOlderData = $common->getSetting("purge_older_data");
$daysToSave = $common->getSetting("days_to_save");
// Create an array of all directories in the template folder.
$templates = array();
$path = "../templates/";
@ -400,7 +391,7 @@
<div class="panel-heading">Flight Notifications</div>
<div class="panel-body">
<div class="form-group">
<label for="flightNotifications"">Flight names. (coma delimited)</label>
<label for="flightNotifications">Flight names. (coma delimited)</label>
<input type="text" class="form-control" id="flightNotifications" name="flightNotifications" value="<?php echo $flightNotifications; ?>">
</div>
<div class="checkbox">
@ -431,6 +422,11 @@
<input type="checkbox" name="enableBlog" value="TRUE"<?php ($enableBlog == 1? print ' checked' : ''); ?>> Enable blog link.
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="enableAcars" value="TRUE"<?php ($enableAcars == 1? print ' checked' : ''); ?>> Enable ACARS link.
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="enableInfo" value="TRUE"<?php ($enableInfo == 1? print ' checked' : ''); ?>> Enable system information link.
@ -507,6 +503,15 @@
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">ACARS Settings</div>
<div class="panel-body">
<div class="form-group">
<label for="acarsservDatabase">ACARSSERV Database Path</label>
<input type="text" class="form-control" id="acarsservDatabase" name="acarsservDatabase" value="<?php echo $acarsservDatabase; ?>">
</div>
</div>
</div>
</div>
<div role="tabpanel" class="tab-pane fade" id="measurements">
<div class="panel panel-default">
@ -514,13 +519,13 @@
<div class="panel-body">
<div class="btn-group" data-toggle="buttons">
<label class="btn btn-default<?php ($measurementRange == "imperialNautical" ? print ' active' : ''); ?>">
<input type="radio" name="measurementRange" id="imperialNautical" value="imperialNautical" autocomplete="off"<?php ($measurementRange == "imperialNautical" ? print ' checked' : ''); ?>> Imperial (Nautical Miles)
<input type="radio" name="measurementRange" id="imperialNautical" value="imperialNautical"<?php ($measurementRange == "imperialNautical" ? print ' checked' : ''); ?>> Imperial (Nautical Miles)
</label>
<label class="btn btn-default<?php ($measurementRange == "imperialStatute" ? print ' active' : ''); ?>">
<input type="radio" name="measurementRange" id="imperialStatute" value="imperialStatute" autocomplete="off"<?php ($measurementRange == "imperialStatute" ? print ' checked' : ''); ?>> Imperial (Statute Miles)
<input type="radio" name="measurementRange" id="imperialStatute" value="imperialStatute"<?php ($measurementRange == "imperialStatute" ? print ' checked' : ''); ?>> Imperial (Statute Miles)
</label>
<label class="btn btn-default<?php ($measurementRange == "metric" ? print ' active' : ''); ?>">
<input type="radio" name="measurementRange" id="metric" value="metric" autocomplete="off"<?php ($measurementRange == "metric" ? print ' checked' : ''); ?>> Metric
<input type="radio" name="measurementRange" id="metric" value="metric"<?php ($measurementRange == "metric" ? print ' checked' : ''); ?>> Metric
</label>
</div>
</div>
@ -530,10 +535,10 @@
<div class="panel-body">
<div class="btn-group" data-toggle="buttons">
<label class="btn btn-default<?php ($measurementTemperature == "imperial" ? print ' active' : ''); ?>">
<input type="radio" name="measurementTemperature" id="imperial" value="imperial" autocomplete="off"<?php ($measurementTemperature == "imperial" ? print ' checked' : ''); ?>> Imperial
<input type="radio" name="measurementTemperature" id="imperial" value="imperial"<?php ($measurementTemperature == "imperial" ? print ' checked' : ''); ?>> Imperial
</label>
<label class="btn btn-default<?php ($measurementTemperature == "metric" ? print ' active' : ''); ?>">
<input type="radio" name="measurementTemperature" id="metric" value="metric" autocomplete="off"<?php ($measurementTemperature == "metric" ? print ' checked' : ''); ?>> Metric
<input type="radio" name="measurementTemperature" id="metric" value="metric"<?php ($measurementTemperature == "metric" ? print ' checked' : ''); ?>> Metric
</label>
</div>
</div>
@ -543,10 +548,10 @@
<div class="panel-body">
<div class="btn-group" data-toggle="buttons">
<label class="btn btn-default<?php ($measurementBandwidth == "kbps" ? print ' active' : ''); ?>">
<input type="radio" name="measurementBandwidth" id="imperial" value="kbps" autocomplete="off"<?php ($measurementBandwidth == "kbps" ? print ' checked' : ''); ?>> Kbps
<input type="radio" name="measurementBandwidth" id="imperial" value="kbps"<?php ($measurementBandwidth == "kbps" ? print ' checked' : ''); ?>> Kbps
</label>
<label class="btn btn-default<?php ($measurementBandwidth == "mbps" ? print ' active' : ''); ?>">
<input type="radio" name="measurementBandwidth" id="metric" value="mbps" autocomplete="off"<?php ($measurementBandwidth == "mbps" ? print ' checked' : ''); ?>> Mbps
<input type="radio" name="measurementBandwidth" id="metric" value="mbps"<?php ($measurementBandwidth == "mbps" ? print ' checked' : ''); ?>> Mbps
</label>
</div>
</div>
@ -558,10 +563,16 @@
<div class="panel-body">
<div class="btn-group" data-toggle="buttons">
<label class="btn btn-default<?php ($networkInterface == "eth0" ? print ' active' : ''); ?>">
<input type="radio" name="networkInterface" id="imperial" value="eth0" autocomplete="off"<?php ($networkInterface == "eth0" ? print ' checked' : ''); ?>> eth0
<input type="radio" name="networkInterface" id="eth0" value="eth0"<?php ($networkInterface == "eth0" ? print ' checked' : ''); ?>> eth0
</label>
<label class="btn btn-default<?php ($networkInterface == "eno1" ? print ' active' : ''); ?>">
<input type="radio" name="networkInterface" id="eno1" value="eno1"<?php ($networkInterface == "eno1" ? print ' checked' : ''); ?>> eno1
</label>
<label class="btn btn-default<?php ($networkInterface == "wlan0" ? print ' active' : ''); ?>">
<input type="radio" name="networkInterface" id="metric" value="wlan0" autocomplete="off"<?php ($networkInterface == "wlan0" ? print ' checked' : ''); ?>> wlan0
<input type="radio" name="networkInterface" id="wlan0" value="wlan0"<?php ($networkInterface == "wlan0" ? print ' checked' : ''); ?>> wlan0
</label>
<label class="btn btn-default<?php ($networkInterface == "wlo1" ? print ' active' : ''); ?>">
<input type="radio" name="networkInterface" id="wlo1" value="wlo1"<?php ($networkInterface == "wlo1" ? print ' checked' : ''); ?>> wlo1
</label>
</div>
</div>
@ -572,20 +583,15 @@
<div class="panel-heading">Purge Positions</div>
<div class="panel-body">
<p>Current Database Size: <?php echo $common->getDatabaseSize("mb"); ?>MB</p>
<div class="form-group">
<label for="purgepositionspicker">Purge flight positions old than...</label><br />
<input type="text" class="form-control" id="purgepositionspicker" name="purgepositionspicker" autocomplete="off" <?php ($settings::db_driver == "xml" ? print ' disabled' : ''); ?>>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="purgepositions" value="purge"<?php ($settings::db_driver == "xml" ? print ' disabled' : ''); ?>> Check to confirm purge of data.
<input type="checkbox" id="purgeOlderData" name="purgeOlderData" value="TRUE"<?php ($purgeOlderData == 1 ? print ' checked' : ''); ?><?php ($settings::db_driver == "xml" ? print ' disabled' : ''); ?>> Enable daily purges of older flight data.
</label>
</div>
<script type="text/javascript">
jQuery('#purgepositionspicker').datetimepicker({
inline:true
});
</script>
<div class="form-group">
<label for="daystosave"">Keep only data newer than X days.</label>
<input type="text" class="form-control" id="daysToSave" name="daysToSave" value="<?php echo $daysToSave; ?>"<?php ($settings::db_driver == "xml" ? print ' disabled' : ''); ?>>
</div>
</div>
</div>
</div>

Wyświetl plik

@ -1,33 +1,4 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2016 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. //
/////////////////////////////////////////////////////////////////////////////////////
session_start();
// Load the require PHP classes.

Wyświetl plik

@ -1,33 +1,4 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2016 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. //
/////////////////////////////////////////////////////////////////////////////////////
session_start();
// Load the require PHP classes.

Wyświetl plik

@ -1,33 +1,4 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2016 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. //
/////////////////////////////////////////////////////////////////////////////////////
session_start();
// Load the require PHP classes.

Wyświetl plik

@ -1,33 +1,4 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2016 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. //
/////////////////////////////////////////////////////////////////////////////////////
session_start();
// Load the require PHP classes.

Wyświetl plik

@ -1,33 +1,4 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2016 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. //
/////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////
// Default Login Information //
///////////////////////////////

Wyświetl plik

@ -1,33 +1,4 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2016 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. //
/////////////////////////////////////////////////////////////////////////////////////
session_start();
// Load the require PHP classes.

Wyświetl plik

@ -1,33 +1,4 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2016 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. //
/////////////////////////////////////////////////////////////////////////////////////
session_start();
// Load the require PHP classes.

Wyświetl plik

@ -1,33 +1,4 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B FEEDER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2016 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. //
/////////////////////////////////////////////////////////////////////////////////////
$possibleActions = array("byPosition");
if (isset($_GET['type']) && in_array($_GET["type"], $possibleActions)) {

Wyświetl plik

@ -1,33 +1,4 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B FEEDER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2016 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. //
/////////////////////////////////////////////////////////////////////////////////////
$possibleActions = array("flights");
if (isset($_GET['type']) && in_array($_GET["type"], $possibleActions)) {

Wyświetl plik

@ -1,33 +1,4 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B FEEDER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2016 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. //
/////////////////////////////////////////////////////////////////////////////////////
$possibleActions = array("getOsInformation", "getCpuInformation", "getMemoryInformation", "getHddInformation", "getNetworkInformation", "getUptimeInformation");
if (isset($_GET['action']) && in_array($_GET["action"], $possibleActions)) {

Wyświetl plik

@ -1,33 +1,4 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2016 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. //
/////////////////////////////////////////////////////////////////////////////////////
// Start session
session_start();

Wyświetl plik

@ -0,0 +1,40 @@
<?php
class acars {
function getAcarsMessages($limit = 100, $offset = 0) {
require_once($_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR."classes".DIRECTORY_SEPARATOR."common.class.php");
$common = new common();
$dsn = "sqlite:".$common->getSetting('acarsserv_database');
$dbh = new PDO($dsn, null, null, [PDO::SQLITE_ATTR_OPEN_FLAGS => PDO::SQLITE_OPEN_READONLY]);
$sql = "SELECT * FROM Messages JOIN Flights USING(FlightID) JOIN Stations USING(StID) ORDER BY LastTime DESC LIMIT :limit OFFSET :offset";
$sth = $dbh->prepare($sql);
$sth->bindValue(':limit', $limit);
$sth->bindValue(':offset', $offset);
$sth->execute();
$acarsMessages = $sth->fetchAll(PDO::FETCH_ASSOC);
$sth = NULL;
$dbh = NULL;
$dsn = NULL;
return $acarsMessages;
}
function getAcarsMessageCount() {
require_once($_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR."classes".DIRECTORY_SEPARATOR."common.class.php");
$common = new common();
$dsn = "sqlite:".$common->getSetting('acarsserv_database');
$dbh = new PDO($dsn, null, null, [PDO::SQLITE_ATTR_OPEN_FLAGS => PDO::SQLITE_OPEN_READONLY]);
$sql = "SELECT COUNT(*) FROM Messages";
$sth = $dbh->prepare($sql);
$sth->execute();
$number_of_rows = $sth->fetchColumn();
$sth = NULL;
$dbh = NULL;
$dsn = NULL;
return $number_of_rows;
}
}
?>

Wyświetl plik

@ -1,33 +1,4 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2016 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. //
/////////////////////////////////////////////////////////////////////////////////////
class account {
// Authentication

Wyświetl plik

@ -1,33 +1,4 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2016 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. //
/////////////////////////////////////////////////////////////////////////////////////
class blog {
function getAllPosts($orderBy = "desc") {

Wyświetl plik

@ -1,33 +1,4 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2016 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. //
/////////////////////////////////////////////////////////////////////////////////////
class common {
// PDO Database Access
@ -220,11 +191,10 @@
// Return a boolean from a string.
function stringToBoolean($value) {
switch(strtoupper($value)) {
case 'TRUE': return TRUE;
case 'FALSE': return FALSE;
default: return NULL;
if (strtoupper($value) == "TRUE" || $value == "1") {
return TRUE;
}
return FALSE;
}
// Generate a random string of the given length.

Wyświetl plik

@ -1,33 +1,4 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2016 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. //
/////////////////////////////////////////////////////////////////////////////////////
class links {
function getAllLinks() {

Wyświetl plik

@ -1,33 +1,4 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2016 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. //
/////////////////////////////////////////////////////////////////////////////////////
class settings {
// Database Settings

Wyświetl plik

@ -1,33 +1,4 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2019 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. //
/////////////////////////////////////////////////////////////////////////////////////
class template {
// PUT THE TEMPLATE TOGETHER
@ -37,7 +8,7 @@
// Check if the portal is installed or needs upgraded.
$thisVersion = "2.8.0";
$thisVersion = "2.8.8";
if (!file_exists($_SERVER['DOCUMENT_ROOT']."/classes/settings.class.php")) {
header ("Location: /install/install.php");
@ -164,7 +135,8 @@
}
}
$that = $common->extractString($statement[0], " ".$operator." ", "}");
if ($that == "TRUE") {
if ($that == "TRUE" || $that == "FALSE") {
$ifThis = $common->stringToBoolean($ifThis);
$that = $common->stringToBoolean($that);
}
if ($operator == "eq") {

Wyświetl plik

@ -1,33 +1,4 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2016 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. //
/////////////////////////////////////////////////////////////////////////////////////
// Start session
session_start();

Wyświetl plik

@ -1,32 +1,4 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2016 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. //
/////////////////////////////////////////////////////////////////////////////////////
// Start session
session_start();

Wyświetl plik

@ -1,33 +1,4 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2016 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. //
/////////////////////////////////////////////////////////////////////////////////////
// Start session
session_start();
@ -62,7 +33,7 @@
}
$dbh = $common->pdoOpen();
$sql = "SELECT COUNT(*) FROM ".$settings::db_prefix."flights WHERE flight LIKE :like ORDER BY lastSeen DESC, flight";
$sql = "SELECT COUNT(*) FROM ".$settings::db_prefix."flights WHERE flight LIKE :like AND EXISTS (SELECT * FROM ".$settings::db_prefix."positions WHERE ".$settings::db_prefix."positions.flight = ".$settings::db_prefix."flights.id)";
$sth = $dbh->prepare($sql);
$sth->bindValue(':like', "%".$searchString."%", PDO::PARAM_STR);
$sth->execute();
@ -71,7 +42,7 @@
$dbh = NULL;
$dbh = $common->pdoOpen();
$sql = "SELECT * FROM ".$settings::db_prefix."flights WHERE flight LIKE :like ORDER BY lastSeen DESC, flight LIMIT :start, :items";
$sql = "SELECT * FROM ".$settings::db_prefix."flights WHERE flight LIKE :like AND EXISTS (SELECT * FROM ".$settings::db_prefix."positions WHERE ".$settings::db_prefix."positions.flight = ".$settings::db_prefix."flights.id) ORDER BY lastSeen DESC, flight LIMIT :start, :items";
$sth = $dbh->prepare($sql);
$sth->bindValue(':like', "%".$searchString."%", PDO::PARAM_STR);
$sth->bindValue(':start', $start, PDO::PARAM_INT);

Wyświetl plik

@ -1,33 +1,4 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2016 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. //
/////////////////////////////////////////////////////////////////////////////////////
// Start session
session_start();

Wyświetl plik

@ -1,33 +1,4 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2016 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. //
/////////////////////////////////////////////////////////////////////////////////////
// Start session
session_start();

Wyświetl plik

@ -1,35 +1,6 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2019 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. //
/////////////////////////////////////////////////////////////////////////////////////
// The most current stable release.
$thisVersion = "2.8.0";
$thisVersion = "2.8.8";
// 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")) {
@ -233,7 +204,7 @@ EOF;
flight VARCHAR(10) NOT NULL);';
$positionsSql = 'CREATE TABLE '.$dbPrefix.'positions (
id INT(11) AUTO_INCREMENT PRIMARY KEY,
flight BIGINT NOT NULL,
flight BIGINT NULL,
aircraft BIGINT NOT NULL,
time datetime NOT NULL,
message INT NOT NULL,
@ -398,11 +369,11 @@ EOF;
$sth = $dbh->prepare($settingsSql);
$sth->execute();
$sth = NULL;
$sth = $dbh->prepare($aircraftIndexSql);
$sth->execute();
$sth = NULL;
$sth = $dbh->prepare($positionsIndexSql);
$sth->execute();
$sth = NULL;
@ -419,6 +390,7 @@ EOF;
$common->addSetting('defaultPage', 'blog.php');
$common->addSetting('dateFormat', 'F jS, Y g:i A');
$common->addSetting('enableBlog', TRUE);
$common->addSetting('enableAcars', FALSE);
$common->addSetting('enableInfo', TRUE);
$common->addSetting('enableLinks', FALSE);
$common->addSetting('enableGraphs', TRUE);
@ -443,7 +415,11 @@ EOF;
$common->addSetting('enableWebNotifications', FALSE);
$common->addSetting('googleMapsApiKey', '');
$common->addSetting("hideNavbarAndFooter", FALSE);
$common->addSetting("purgeAircraft", FALSE);
$common->addSetting("purge_older_data", FALSE);
$common->addSetting("days_to_save", "30");
$common->addSetting("advancedMapCenterLatitude", "41.3683798");
$common->addSetting("advancedMapCenterLongitude", "-82.1076486");
$common->addSetting('acarsserv_database', "");
if ($_POST['driver'] == "xml")
$common->addSetting('enableFlights', FALSE);

Wyświetl plik

@ -1,33 +1,4 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2016 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.0.1
///////////////////////

Wyświetl plik

@ -1,33 +1,4 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2016 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.0.2
///////////////////////

Wyświetl plik

@ -1,33 +1,4 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2016 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.0.3
///////////////////////

Wyświetl plik

@ -1,33 +1,4 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2016 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.1.0
///////////////////////

Wyświetl plik

@ -1,33 +1,4 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2016 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.2.0
///////////////////////

Wyświetl plik

@ -1,33 +1,4 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2016 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.3.0
///////////////////////

Wyświetl plik

@ -1,33 +1,4 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2016 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.3.0
///////////////////////

Wyświetl plik

@ -1,33 +1,4 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2016 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.5.0
///////////////////////

Wyświetl plik

@ -1,33 +1,4 @@
<?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.6.0
///////////////////////

Wyświetl plik

@ -1,33 +1,4 @@
<?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.6.1
///////////////////////

Wyświetl plik

@ -1,33 +1,4 @@
<?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.6.2
///////////////////////

Wyświetl plik

@ -1,33 +1,4 @@
<?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.6.3
///////////////////////

Wyświetl plik

@ -1,33 +1,4 @@
<?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
///////////////////////
@ -48,7 +19,7 @@
$settings = new settings();
try {
// Add portal navigation and footer autohide option.
// Add map centering longitude and latitude.
$common->addSetting("advancedMapCenterLatitude", "41.3683798");
$common->addSetting("advancedMapCenterLongitude", "-82.1076486");

Wyświetl plik

@ -1,33 +1,4 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2019 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.1
///////////////////////

Wyświetl plik

@ -1,33 +1,4 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2019 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.2
///////////////////////

Wyświetl plik

@ -0,0 +1,39 @@
<?php
///////////////////////
// UPGRADE TO V2.8.0
///////////////////////
// --------------------------------------------------------
// Updates the version setting to 2.8.0.
// --------------------------------------------------------
$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 {
// Update the version and patch settings..
$common->updateSetting("version", "2.8.0");
$common->updateSetting("patch", "");
// The upgrade process completed successfully.
$results['success'] = TRUE;
$results['message'] = "Upgrade to v2.8.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

@ -0,0 +1,39 @@
<?php
///////////////////////
// UPGRADE TO V2.8.1
///////////////////////
// --------------------------------------------------------
// Updates the version setting to 2.8.1.
// --------------------------------------------------------
$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 {
// Update the version and patch settings..
$common->updateSetting("version", "2.8.1");
$common->updateSetting("patch", "");
// The upgrade process completed successfully.
$results['success'] = TRUE;
$results['message'] = "Upgrade to v2.8.1 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

@ -0,0 +1,39 @@
<?php
///////////////////////
// UPGRADE TO V2.8.2
///////////////////////
// --------------------------------------------------------
// Updates the version setting to 2.8.2.
// --------------------------------------------------------
$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 {
// Update the version and patch settings..
$common->updateSetting("version", "2.8.2");
$common->updateSetting("patch", "");
// The upgrade process completed successfully.
$results['success'] = TRUE;
$results['message'] = "Upgrade to v2.8.2 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

@ -0,0 +1,39 @@
<?php
///////////////////////
// UPGRADE TO V2.8.3
///////////////////////
// --------------------------------------------------------
// Updates the version setting to 2.8.3.
// --------------------------------------------------------
$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 {
// Update the version and patch settings.
$common->updateSetting("version", "2.8.3");
$common->updateSetting("patch", "");
// The upgrade process completed successfully.
$results['success'] = TRUE;
$results['message'] = "Upgrade to v2.8.3 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

@ -0,0 +1,54 @@
<?php
///////////////////////
// UPGRADE TO V2.8.4
///////////////////////
// --------------------------------------------------------
// Updates the version setting to 2.8.4.
// --------------------------------------------------------
$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 {
// Update the version and patch settings..
$common->updateSetting("version", "2.8.4");
$common->updateSetting("patch", "");
// Allow NULL flights in the positions table.
$dbh = $common->pdoOpen();
$sql = "ALTER TABLE ".$settings::db_prefix."positions MODIFY flight BIGINT NULL";
$sth = $dbh->prepare($sql);
$sth->execute();
$sth = NULL;
// Rename purgeAircraft to purge_older_data.
$purge_older_data = $common->getSetting('purgeAircraft');
$common->deleteSetting('purgeAircraft');
$common->addSetting("purge_older_data", $purge_older_data);
// Add days to save setting.
$common->addSetting("days_to_save", "30");
// The upgrade process completed successfully.
$results['success'] = TRUE;
$results['message'] = "Upgrade to v2.8.4 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

@ -0,0 +1,39 @@
<?php
///////////////////////
// UPGRADE TO V2.8.5
///////////////////////
// --------------------------------------------------------
// Updates the version setting to 2.8.5.
// --------------------------------------------------------
$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 {
// Update the version and patch settings..
$common->updateSetting("version", "2.8.5");
$common->updateSetting("patch", "");
// The upgrade process completed successfully.
$results['success'] = TRUE;
$results['message'] = "Upgrade to v2.8.5 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

@ -0,0 +1,43 @@
<?php
///////////////////////
// UPGRADE TO V2.8.6
///////////////////////
// --------------------------------------------------------
// Updates the version setting to 2.8.6
// --------------------------------------------------------
$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 enable ACARS setting
$common->addSetting('enableAcars', FALSE);
$common->addSetting('acarsserv_database', "");
// Update the version and patch settings
$common->updateSetting("version", "2.8.6");
$common->updateSetting("patch", "");
// The upgrade process completed successfully
$results['success'] = TRUE;
$results['message'] = "Upgrade to v2.8.6 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

@ -0,0 +1,38 @@
<?php
///////////////////////
// UPGRADE TO V2.8.7
///////////////////////
// --------------------------------------------------------
// Updates the version setting to 2.8.7
// --------------------------------------------------------
$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 {
// Update the version and patch settings
$common->updateSetting("version", "2.8.7");
$common->updateSetting("patch", "");
// The upgrade process completed successfully
$results['success'] = TRUE;
$results['message'] = "Upgrade to v2.8.7 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

@ -0,0 +1,38 @@
<?php
///////////////////////
// UPGRADE TO V2.8.8
///////////////////////
// --------------------------------------------------------
// Updates the version to 2.8.8
// --------------------------------------------------------
$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 {
// Update the version and patch settings
$common->updateSetting("version", "2.8.8");
$common->updateSetting("patch", "");
// The upgrade process completed successfully
$results['success'] = TRUE;
$results['message'] = "Upgrade to v2.8.8 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

@ -1,39 +1,10 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2019 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. //
/////////////////////////////////////////////////////////////////////////////////////
require_once($_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR."classes".DIRECTORY_SEPARATOR."common.class.php");
$common = new common();
// The most current stable release.
$thisVersion = "2.8.0";
$thisVersion = "2.8.8";
// Begin the upgrade process if this release is newer than what is installed.
if ($common->getSetting("version") == $thisVersion) {
@ -178,7 +149,7 @@
}
// UPGRADE TO V2.8.0
if ($common->getSetting("version") == "2.8.0" && $success) {
if ($common->getSetting("version") == "2.7.2" && $success) {
$json = file_get_contents("http://localhost/install/upgrade-v2.8.0.php");
$results = json_decode($json, TRUE);
$success = $results['success'];
@ -186,6 +157,78 @@
$version = "2.8.0";
}
// UPGRADE TO V2.8.1
if ($common->getSetting("version") == "2.8.0" && $success) {
$json = file_get_contents("http://localhost/install/upgrade-v2.8.1.php");
$results = json_decode($json, TRUE);
$success = $results['success'];
$message = $results['message'];
$version = "2.8.1";
}
// UPGRADE TO V2.8.2
if ($common->getSetting("version") == "2.8.1" && $success) {
$json = file_get_contents("http://localhost/install/upgrade-v2.8.2.php");
$results = json_decode($json, TRUE);
$success = $results['success'];
$message = $results['message'];
$version = "2.8.2";
}
// UPGRADE TO V2.8.3
if ($common->getSetting("version") == "2.8.2" && $success) {
$json = file_get_contents("http://localhost/install/upgrade-v2.8.3.php");
$results = json_decode($json, TRUE);
$success = $results['success'];
$message = $results['message'];
$version = "2.8.3";
}
// UPGRADE TO V2.8.4
if ($common->getSetting("version") == "2.8.3" && $success) {
$json = file_get_contents("http://localhost/install/upgrade-v2.8.4.php");
$results = json_decode($json, TRUE);
$success = $results['success'];
$message = $results['message'];
$version = "2.8.4";
}
// UPGRADE TO V2.8.5
if ($common->getSetting("version") == "2.8.4" && $success) {
$json = file_get_contents("http://localhost/install/upgrade-v2.8.5.php");
$results = json_decode($json, TRUE);
$success = $results['success'];
$message = $results['message'];
$version = "2.8.5";
}
// UPGRADE TO V2.8.6
if ($common->getSetting("version") == "2.8.5" && $success) {
$json = file_get_contents("http://localhost/install/upgrade-v2.8.6.php");
$results = json_decode($json, TRUE);
$success = $results['success'];
$message = $results['message'];
$version = "2.8.6";
}
// UPGRADE TO V2.8.7
if ($common->getSetting("version") == "2.8.6" && $success) {
$json = file_get_contents("http://localhost/install/upgrade-v2.8.7.php");
$results = json_decode($json, TRUE);
$success = $results['success'];
$message = $results['message'];
$version = "2.8.7";
}
// UPGRADE TO V2.8.8
if ($common->getSetting("version") == "2.8.7" && $success) {
$json = file_get_contents("http://localhost/install/upgrade-v2.8.8.php");
$results = json_decode($json, TRUE);
$success = $results['success'];
$message = $results['message'];
$version = "2.8.8";
}
require_once($_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR."admin".DIRECTORY_SEPARATOR."includes".DIRECTORY_SEPARATOR."header.inc.php");
// Display the instalation wizard.

Wyświetl plik

@ -1,33 +1,4 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2016 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. //
/////////////////////////////////////////////////////////////////////////////////////
// Start session
session_start();
@ -47,7 +18,7 @@
// Add position data to the $pageData array.
$dbh = $common->pdoOpen();
$sql = "SELECT id FROM ".$settings::db_prefix."flights WHERE flight = :flight";
$sql = "SELECT id, aircraft, flight, firstSeen, lastSeen FROM ".$settings::db_prefix."flights WHERE flight = :flight";
$sth = $dbh->prepare($sql);
$sth->bindParam(':flight', $_GET['flight'], PDO::PARAM_STR, 50);
$sth->execute();
@ -55,6 +26,10 @@
$sth = NULL;
$dbh = NULL;
$flightId = $row['id'];
$aircraftId = $row['aircraft'];
$pageData['flight'] = $row['flight'];
$pageData['flightFirstSeen'] = $row['firstSeen'];
$pageData['flightLastSeen'] = $row['lastSeen'];
$dbh = $common->pdoOpen();
$sql = "SELECT * FROM ".$settings::db_prefix."positions WHERE flight = :flight ORDER BY time";
@ -156,13 +131,36 @@
}
break;
}
}
}
$pageData['flightPaths'] = $selectedFlightPath;
} else {
$pageData['flightPathsAvailable'] = "FALSE";
}
// Page Data
$dbh = $common->pdoOpen();
$sql = "SELECT icao, firstSeen, lastSeen FROM ".$settings::db_prefix."aircraft WHERE id = :id";
$sth = $dbh->prepare($sql);
$sth->bindParam(':id', $aircraftId, PDO::PARAM_STR, 50);
$sth->execute();
$row = $sth->fetch();
$sth = NULL;
$dbh = NULL;
$pageData['icao'] = $row['icao'];
$pageData['aircraftFirstSeen'] = $row['firstSeen'];
$pageData['aircraftLastSeen'] = $row['lastSeen'];
// Planespotter.net image.
$url = 'https://api.planespotters.net/pub/photos/hex/'.$pageData['icao'];
$json = file_get_contents($url);
$planspotterData = json_decode($json);
$pageData['thumbnailSrc'] = $planspotterData->photos[0]->thumbnail->src;
$pageData['thumbnailWidth'] = $planspotterData->photos[0]->thumbnail->size->width;
$pageData['thumbnailHeight'] = $planspotterData->photos[0]->thumbnail->size->height;
$pageData['thumbnailPhotographer'] = $planspotterData->photos[0]->photographer;
$pageData['thumbnailLink'] = $planspotterData->photos[0]->link;
$template->display($pageData);
?>

Some files were not shown because too many files have changed in this diff Show More