diff --git a/CHANGELOG.md b/CHANGELOG.md index c6e4158..304be58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,11 +4,18 @@ The following is a history of the changes made to this project. ## v2.5.0 +* Twitter and email flight notifications ready for testing. *(lite)* +* Added script to automate the portal backup process. +* Added ability to specify the latitude and longitude of the receiver for dump978. +* Administrators can now specify custom links to be displayed within the portal. +* The loading speed for the flights page has been dramatically reduced. *(advanced)* * When upgrading dump1090 the user is once again asked for the LAT and LON settings. * Portal related python scripts are now localed in the folder named python. * A Google Maps API key can now be specified for use with portal maps. * Portal upgrade scripts have been split into multiple files. * The path to the SQLite database is no longer hard coded in the portal PHP files. +* Pagination links now show first and last page links properly. +* When no patch is applied N\A is given for the patch version on the system page. ## v2.4.0 *(September 27th, 2016)* diff --git a/bash/decoders/dump1090-fa.sh b/bash/decoders/dump1090-fa.sh index 28dd323..63daef1 100755 --- a/bash/decoders/dump1090-fa.sh +++ b/bash/decoders/dump1090-fa.sh @@ -145,6 +145,20 @@ fi ## DUMP1090-FA POST INSTALLATION CONFIGURATION +# Ask for a Bing Maps API key. +BINGMAPSKEY=$(whiptail --backtitle "$ADSB_PROJECTTITLE" --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 `GetConfig "BingMapsAPIKey" "/usr/share/dump1090-mutability/html/config.js"` 3>&1 1>&2 2>&3) +if [[ ! -z $BINGMAPSKEY ]]; then + echo -e "\e[94m Setting the Bing Maps API Key to $BINGMAPSKEY...\e[97m" + ChangeConfig "BingMapsAPIKey" "$BINGMAPSKEY" "/usr/share/dump1090-fa/html/config.js" +fi + +# Ask for a Mapzen API key. +MAPZENKEY=$(whiptail --backtitle "$ADSB_PROJECTTITLE" --title "Mapzen API Key" --nocancel --inputbox "\nProvide a Mapzen API key here to enable the Mapzen vector tile layer within the dump1090-mutability map. You can obtain a free key at https://mapzen.com/developers/\n\nProviding a Mapzen API key is not required to continue." 13 78 `GetConfig "MapzenAPIKey" "/usr/share/dump1090-mutability/html/config.js"` 3>&1 1>&2 2>&3) +if [[ ! -z $MAPZENKEY ]]; then + echo -e "\e[94m Setting the Mapzen API Key to $MAPZENKEY...\e[97m" + ChangeConfig "MapzenAPIKey" "$MAPZENKEY" "/usr/share/dump1090-fa/html/config.js" +fi + # Download Heywhatsthat.com maximum range rings. if [ ! -f /usr/share/dump1090-fa/html/upintheair.json ] && (whiptail --backtitle "$ADSB_PROJECTTITLE" --title "Heywhaststhat.com Maimum 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 panarama centered on the location of your receiver. Once your panarama has been generated a link to the panarama will be displayed in the up 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 heywatsthat.com maximum range rings to your map?" 16 78); then HEYWHATSTHATID_TITLE="Heywhatsthat.com Panarama ID" diff --git a/bash/decoders/dump1090-mutability.sh b/bash/decoders/dump1090-mutability.sh index a39c9f5..942c1c2 100755 --- a/bash/decoders/dump1090-mutability.sh +++ b/bash/decoders/dump1090-mutability.sh @@ -151,18 +151,38 @@ echo "" whiptail --backtitle "$ADSB_PROJECTTITLE" --title "Receiver Latitude and Longitude" --msgbox "Your receivers latitude and longitude are required for certain features to function properly. You will now be asked to supply the latitude and longitude for your receiver. If you do not have this information you get it by using the web based \"Geocode by Address\" utility hosted on another of my websites.\n\n https://www.swiftbyte.com/toolbox/geocode" 13 78 RECEIVERLATITUDE_TITLE="Receiver Latitude" while [[ -z $RECEIVERLATITUDE ]]; do - RECEIVERLATITUDE=$(whiptail --backtitle "$ADSB_PROJECTTITLE" --title "$RECEIVERLATITUDE_TITLE" --nocancel --inputbox "\nEnter your receiver's latitude.\n(Example: XX.XXXXXXX)" 9 78 `GetConfig "LAT" "/etc/default/dump1090-mutability"` 3>&1 1>&2 2>&3) + RECEIVERLATITUDE=`GetConfig "LAT" "/etc/default/dump1090-mutability"` + RECEIVERLATITUDE=$(whiptail --backtitle "$ADSB_PROJECTTITLE" --title "$RECEIVERLATITUDE_TITLE" --nocancel --inputbox "\nEnter your receiver's latitude.\n(Example: XX.XXXXXXX)" 9 78 " $RECEIVERLATITUDE" 3>&1 1>&2 2>&3) RECEIVERLATITUDE_TITLE="Receiver Latitude (REQUIRED)" done RECEIVERLONGITUDE_TITLE="Receiver Longitude" while [[ -z $RECEIVERLONGITUDE ]]; do - RECEIVERLONGITUDE=$(whiptail --backtitle "$ADSB_PROJECTTITLE" --title "$RECEIVERLONGITUDE_TITLE" --nocancel --inputbox "\nEnter your receeiver's longitude.\n(Example: XX.XXXXXXX)" 9 78 `GetConfig "LON" "/etc/default/dump1090-mutability"` 3>&1 1>&2 2>&3) + RECEIVERLONGITUDE=`GetConfig "LON" "/etc/default/dump1090-mutability"` + RECEIVERLONGITUDE=$(whiptail --backtitle "$ADSB_PROJECTTITLE" --title "$RECEIVERLONGITUDE_TITLE" --nocancel --inputbox "\nEnter your receeiver's longitude.\n(Example: XX.XXXXXXX)" 9 78 " $RECEIVERLONGITUDE" 3>&1 1>&2 2>&3) RECEIVERLONGITUDE_TITLE="Receiver Longitude (REQUIRED)" done + echo -e "\e[94m Setting the receiver's latitude to $RECEIVERLATITUDE...\e[97m" -ChangeConfig "LAT" $RECEIVERLATITUDE "/etc/default/dump1090-mutability" + +ChangeConfig "LAT" "$(sed -e 's/[[:space:]]*$//' <<<${RECEIVERLATITUDE})" "/etc/default/dump1090-mutability" echo -e "\e[94m Setting the receiver's longitude to $RECEIVERLONGITUDE...\e[97m" -ChangeConfig "LON" $RECEIVERLONGITUDE "/etc/default/dump1090-mutability" +ChangeConfig "LON" "$(sed -e 's/[[:space:]]*$//' <<<${RECEIVERLONGITUDE})" "/etc/default/dump1090-mutability" + +# Ask for a Bing Maps API key. +BINGMAPSKEY=$(whiptail --backtitle "$ADSB_PROJECTTITLE" --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 `GetConfig "BingMapsAPIKey" "/usr/share/dump1090-mutability/html/config.js"` 3>&1 1>&2 2>&3) +if [[ ! -z $BINGMAPSKEY ]]; then + echo -e "\e[94m Setting the Bing Maps API Key to $BINGMAPSKEY...\e[97m" + ChangeConfig "BingMapsAPIKey" "$BINGMAPSKEY" "/usr/share/dump1090-mutability/html/config.js" +fi + +# Ask for a Mapzen API key. +MAPZENKEY=$(whiptail --backtitle "$ADSB_PROJECTTITLE" --title "Mapzen API Key" --nocancel --inputbox "\nProvide a Mapzen API key here to enable the Mapzen vector tile layer within the dump1090-mutability map. You can obtain a free key at https://mapzen.com/developers/\n\nProviding a Mapzen API key is not required to continue." 13 78 `GetConfig "MapzenAPIKey" "/usr/share/dump1090-mutability/html/config.js"` 3>&1 1>&2 2>&3) +if [[ ! -z $MAPZENKEY ]]; then + echo -e "\e[94m Setting the Mapzen API Key to $MAPZENKEY...\e[97m" + ChangeConfig "MapzenAPIKey" "$MAPZENKEY" "/usr/share/dump1090-mutability/html/config.js" +fi + +exit 0 # Ask if dump1090-mutability should bind on all IP addresses. if (whiptail --backtitle "$ADSB_PROJECTTITLE" --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 diff --git a/bash/decoders/dump978.sh b/bash/decoders/dump978.sh index f4d73c2..a4038c7 100755 --- a/bash/decoders/dump978.sh +++ b/bash/decoders/dump978.sh @@ -173,6 +173,12 @@ if [ $(dpkg-query -W -f='${STATUS}' dump1090-mutability 2>/dev/null | grep -c "o echo "" sudo /etc/init.d/dump1090-mutability restart echo "" + + # Get the latitude and longitude set in the dump1090-mutability configuration file to be used later. + echo -e "\e[94m Retrieving the receiver's latitude from /etc/default/dump1090-mutability...\e[97m" + RECEIVERLATITUDE=`GetConfig "LAT" "/etc/default/dump1090-mutability"` + echo -e "\e[94m Retrieving the receiver's longitude from /etc/default/dump1090-mutability...\e[97m" + RECIEVERLONGITUDE=`GetConfig "LON" "/etc/default/dump1090-mutability"` fi # If a device has not yet been assigned to dump978 assign the first available. @@ -181,10 +187,29 @@ if [ -z $DUMP978DEVICE ]; then DUMP978DEVICE="0" fi -# Create the dump978 JSON directory in Lighttpd's document root. +# Declare the LIGHTTPDDOCUMENTROOTDIRECTORY variable. echo -e "\e[94m Getting the path to Lighttpd's document root...\e[97m" LIGHTTPDDOCUMENTROOTSETTING=`/usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf -p | grep server.document-root` LIGHTTPDDOCUMENTROOTDIRECTORY=`sed 's/.*"\(.*\)"[^"]*$/\1/' <<< $LIGHTTPDDOCUMENTROOTSETTING` + +# Set the receivers latitude and longitude. +if [ -z $RECEIVERLATITUDE ] && [ -z $RECEIVERLONGITUDE ]; then + # If dump1090-mutability is not installed ask for the latitude and longitude of this receiver. + RECEIVERLATITUDE=$(whiptail --backtitle "$ADSB_PROJECTTITLE" --title "Receiver Latitude (OPTIONAL)" --nocancel --inputbox "\nEnter your receiver's latitude.\n(Example: XX.XXXXXXX)\n\nLeave blank and select to skip." 12 78 3>&1 1>&2 2>&3) + RECEIVERLONGITUDE_TITLE="Receiver Longitude" + while [[ -z $RECEIVERLONGITUDE ]]; do + RECEIVERLONGITUDE=$(whiptail --backtitle "$ADSB_PROJECTTITLE" --title "$RECEIVERLONGITUDE_TITLE" --nocancel --inputbox "\nEnter your receeiver's longitude.\n(Example: XX.XXXXXXX)" 9 78 3>&1 1>&2 2>&3) + RECEIVERLONGITUDE_TITLE="Receiver Longitude (REQUIRED)" + done +fi +if [ ! -z $RECEIVERLATITUDE ] && [ ! -z $RECEIVERLONGITUDE ]; then + echo -e "\e[94m Setting the receiver's latitude to $RECEIVERLATITUDE...\e[97m" + ChangeConfig "SiteLat" "$RECEIVERLATITUDE" "$LIGHTTPDDOCUMENTROOTDIRECTORY/dump978/config.js" + echo -e "\e[94m Setting the receiver's longitude to $RECEIVERLONGITUDE...\e[97m" + ChangeConfig "SiteLon" "$RECEIVERLONGITUDE" "$LIGHTTPDDOCUMENTROOTDIRECTORY/dump978/config.js" +fi + +# Create the dump978 JSON directory in Lighttpd's document root. echo -e "\e[94m Creating the dump978 JSON data directory within Lighttpd's document root...\e[97m" sudo mkdir -p $LIGHTTPDDOCUMENTROOTDIRECTORY/dump978/data echo -e "\e[94m Setting permissions for the dump978 JSON data directory within Lighttpd's document root...\e[97m" diff --git a/bash/feeders/adsbexchange.sh b/bash/feeders/adsbexchange.sh index 85907a3..55e0ca2 100755 --- a/bash/feeders/adsbexchange.sh +++ b/bash/feeders/adsbexchange.sh @@ -163,7 +163,11 @@ echo -e "\e[95m Creating maintenance for both the mlat-client and netcat feeds. echo "" # Ask the user for the user name for this receiver. -RECEIVERNAME=$(whiptail --backtitle "$ADSB_PROJECTTITLE" --backtitle "$BACKTITLETEXT" --title "Receiver Name" --nocancel --inputbox "\nPlease enter a name for this receiver. (NOT REQUIRED)\n\nIf you have more than one receiver, this name should be unique.\nExample: \"username-01\", \"username-02\", etc." 12 78 3>&1 1>&2 2>&3) +RECEIVERNAME_TITLE="Receiver Name" +while [[ -z $RECEIVERNAME ]]; do + RECEIVERNAME=$(whiptail --backtitle "$ADSB_PROJECTTITLE" --backtitle "$BACKTITLETEXT" --title "$RECEIVERNAME_TITLE" --nocancel --inputbox "\nPlease enter a name for this receiver.\n\nIf you have more than one receiver, this name should be unique.\nExample: \"username-01\", \"username-02\", etc." 12 78 3>&1 1>&2 2>&3) + RECEIVERNAME_TITLE="Receiver Name (REQUIRED)" +done # Get the altitude of the receiver from the Google Maps API using the latitude and longitude assigned dump1090-mutability. RECEIVERLATITUDE=`GetConfig "LAT" "/etc/default/dump1090-mutability"` diff --git a/bash/feeders/piaware.sh b/bash/feeders/piaware.sh index 7274dd4..af273cd 100755 --- a/bash/feeders/piaware.sh +++ b/bash/feeders/piaware.sh @@ -103,7 +103,6 @@ else echo -e "\e[94m Cloning the piaware_builder git repository locally...\e[97m" echo "" git clone https://github.com/flightaware/piaware_builder.git - echo "" fi ## BUILD AND INSTALL THE PIAWARE PACKAGE diff --git a/bash/functions.sh b/bash/functions.sh index 745b3a5..bfb206e 100755 --- a/bash/functions.sh +++ b/bash/functions.sh @@ -94,8 +94,7 @@ function ChangeConfig { 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". - sudo sed -n '/^$1=\(.*\)$/s//\1/p' $2 - echo `sed -n "/^$1=\"\(.*\)\"$/s//\1/p" $2` + echo `sed -n "/^$1 *= *\"\(.*\)\"$/s//\1/p" $2` } function CommentConfig { diff --git a/bash/portal/logging.sh b/bash/portal/logging.sh index 4399875..b5d54fc 100755 --- a/bash/portal/logging.sh +++ b/bash/portal/logging.sh @@ -72,7 +72,7 @@ echo -e "\e[94m Making the maintenance maintenance script executable...\e[97m" chmod +x $PORTALPYTHONDIRECTORY/maintenance-maint.sh #Remove old flights-maint.sh start up line from /etc/rc.local. -sed -i '/build\/portal\/logging\/flights-maint.sh/d' /etc/rc.local +sudo sed -i '/build\/portal\/logging\/flights-maint.sh/d' /etc/rc.local # Add flight logging maintenance script to rc.local. if ! grep -Fxq "$PORTALPYTHONDIRECTORY/flights-maint.sh &" /etc/rc.local; then @@ -82,7 +82,7 @@ if ! grep -Fxq "$PORTALPYTHONDIRECTORY/flights-maint.sh &" /etc/rc.local; then fi # Remove old maintenance-maint.sh start up line from /etc/rc.local. -sed -i '/build\/portal\/logging\/maintenance-maint.sh/d' /etc/rc.local +sudo sed -i '/build\/portal\/logging\/maintenance-maint.sh/d' /etc/rc.local # Add maintenance maintenance script to rc.local. if ! grep -Fxq "$PORTALPYTHONDIRECTORY/maintenance-maint.sh &" /etc/rc.local; then diff --git a/bash/tools/portal_backup.sh b/bash/tools/portal_backup.sh new file mode 100644 index 0000000..a89a930 --- /dev/null +++ b/bash/tools/portal_backup.sh @@ -0,0 +1,166 @@ +#!/bin/bash + +##################################################################################### +# 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-feeder # +# # +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # +# # +# 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. # +# # +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # + +## VARIABLES + +BACKUPDATE=$(date +"%Y-%m-%d-%H%M%S") +PROJECTROOTDIRECTORY="$PWD" +BACKUPSDIRECTORY="$PROJECTROOTDIRECTORY/backups" +TEMPORARYDIRECTORY="$PROJECTROOTDIRECTORY/backup_$BACKUPDATE" +RAWDOCUMENTROOT=`/usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf -p | grep server.document-root` +LIGHTTPDDOCUMENTROOT=`sed 's/.*"\(.*\)"[^"]*$/\1/' <<< $RAWDOCUMENTROOT` + +## BEGIN THE BACKUP PROCESS + +clear +echo -e "\n\e[91m ADSB Reciever Project Maintenance" +echo "" +echo -e "\e[92m Backing up portal data..." +echo -e "\e[93m----------------------------------------------------------------------------------------------------\e[97m" + +echo "" +echo -e "\e[95m Backing up current portal data...\e[97m" +echo "" + +## 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" + +# 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" +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 -p $BACKUPSDIRECTORY +fi + +# Check that the temporary directory exists. +echo -e "\e[94m Checking that the directory $TEMPORARYDIRECTORY exists...\e[97m" +if [ ! -d "$TEMPORARYDIRECTORY" ]; then + # Create the tmp directory. + echo -e "\e[94m Creating the directory $TEMPORARYDIRECTORY...\e[97m" + mkdir -p $TEMPORARYDIRECTORY +fi + +## BACKUP THE FILES COMMON TO ALL PORTAL INSTALLATION SCENARIOS + +# Copy the collectd round robin database files to the temporary directory. +echo -e "\e[94m Checking that the directory $TEMPORARYDIRECTORY/var/lib/collectd/rrd/ exists...\e[97m" +if [ ! -d "$TEMPORARYDIRECTORY/var/lib/collectd/rrd/" ]; then + mkdir -p $TEMPORARYDIRECTORY/var/lib/collectd/rrd/ +fi +echo -e "\e[94m Backing up the directory /var/lib/collectd/rrd/...\e[97m" +sudo cp -R /var/lib/collectd/rrd/ $TEMPORARYDIRECTORY/var/lib/collectd/rrd/ + +## 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 $TEMPORARYDIRECTORY/var/www/html/data/ exists...\e[97m" + if [ ! -d "$TEMPORARYDIRECTORY/var/www/html/data/" ]; then + mkdir -p $TEMPORARYDIRECTORY/var/www/html/data/ + fi + echo -e "\e[94m Backing up all XML data files to $TEMPORARYDIRECTORY/var/www/html/data/...\e[97m" + sudo cp -R /var/www/html/data/*.xml $TEMPORARYDIRECTORY/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 $TEMPORARYDIRECTORY/var/www/html/data/portal.sqlite...\e[97m" + sudo cp -R $DATABASEPATH $TEMPORARYDIRECTORY/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 $TEMPORARYDIRECTORY/$MYSQLDATABASE.sql...\e[97m" + mysqldump -u$MYSQLUSERNAME -p$MYSQLPASSWORD $MYSQLDATABASE > $TEMPORARYDIRECTORY/$MYSQLDATABASE.sql + fi +fi + +## COMPRESS AND DATE THE BACKUP ARCHIVE + +# Create the backup archive. +echo -e "\e[94m Compressing the backed up files...\e[97m" +echo "" +tar -zcvf $BACKUPSDIRECTORY/adsb-receiver_data_$BACKUPDATE.tar.gz $TEMPORARYDIRECTORY +echo "" + +# Remove the temporary directory. +echo -e "\e[94m Removing the temporary backup directory...\e[97m" +sudo rm -rf $TEMPORARYDIRECTORY + +## BACKUP PROCESS COMPLETE + +echo -e "\e[32m" +echo -e " BACKUP PROCESS COMPLETE\e[93m" +echo "" +echo -e " An archive containing the data just backed up can be found at:" +echo -e " $TEMPORARYDIRECTORY/adsb-receiver_data_$BACKUPDATE.tar.gz\e[97m" +echo "" + +echo -e "\e[93m----------------------------------------------------------------------------------------------------" +echo -e "\e[92m Finished backing up portal data.\e[39m" +echo "" +read -p "Press enter to exit..." CONTINUE + +exit 0 diff --git a/build/portal/html/admin/includes/header.inc.php b/build/portal/html/admin/includes/header.inc.php index 8b03457..c2c0f1c 100644 --- a/build/portal/html/admin/includes/header.inc.php +++ b/build/portal/html/admin/includes/header.inc.php @@ -37,11 +37,12 @@ diff --git a/build/portal/html/admin/index.php b/build/portal/html/admin/index.php index d00761f..ae3110f 100644 --- a/build/portal/html/admin/index.php +++ b/build/portal/html/admin/index.php @@ -93,7 +93,7 @@ $sql = "INSERT INTO ".$settings::db_prefix."notifications (flight, lastMessageCount) VALUES (:flight, :lastMessageCount)"; $sth = $dbh->prepare($sql); $sth->bindParam(':flight', $flight, PDO::PARAM_STR, 10); - $sth->bindParam(':lastMessageCount', 0, PDO::PARAM_INT); + $sth->bindParam(':lastMessageCount', $a = 0, PDO::PARAM_INT); $sth->execute(); $sth = NULL; $dbh = NULL; @@ -239,6 +239,7 @@ $enableWebNotifications = $common->getSetting("enableWebNotifications"); $enableEmailNotifications = $common->getSetting("enableEmailNotifications"); $enableTwitterNotifications = $common->getSetting("enableTwitterNotifications"); + $emailNotificationAddresses = $common->getSetting("emailNotificationAddresses"); $twitterUserName = $common->getSetting("twitterUserName"); $twitterConsumerKey = $common->getSetting("twitterConsumerKey"); $twitterConsumerSecret = $common->getSetting("twitterConsumerSecret "); @@ -358,21 +359,14 @@
- -
- -
-
- -
-
- -
-
- -
- + +
+ + +
+
Time Format
+
- - + +
+ +
+
+ +
+
+ +
+
+ +
+ +
+ +
+
+ +
+
+ +
+
+ +
+ + +

Select one of the formats above or create your own. PHP date function documentation.

@@ -415,8 +436,8 @@
- - + +