Fixes to SQLite installation and logging.

pull/362/head
Joe Prochazka 2017-10-20 10:45:48 -04:00
rodzic e8a0148a19
commit 5e0e6e0c15
3 zmienionych plików z 46 dodań i 20 usunięć

Wyświetl plik

@ -407,13 +407,3 @@ fi
# 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
echo -e ""
echo -e "\e[93m ------------------------------------------------------------------------------"
echo -e "\e[92m Graphing setup is complete.\e[39m"
echo -e ""
if [[ "${RECEIVER_AUTOMATED_INSTALL}" = "false" ]] ; then
read -p "Press enter to continue..." CONTINUE
fi
exit 0

Wyświetl plik

@ -277,7 +277,7 @@ if [[ "${ADVANCED}" = "true" ]] ; then
;;
"SQLite")
CheckPackage sqlite3
CheckPackage php${DISTRO_PHP_VERSION}-sqlite
CheckPackage php${DISTRO_PHP_VERSION}-sqlite3
;;
esac
else
@ -493,12 +493,21 @@ fi
## SETUP COMMON PORTAL FEATURES
# Export variables needed by logging.sh.
if [[ "${DATABASEENGINE}" = "MySQL" ]] || [[ "${DATABASEENGINE}" = "SQLite" ]] ; then
if [ "${DATABASEENGINE}" = "MySQL" ]; then
export ADSB_DATABASEENGINE=${DATABASEENGINE}
export ADSB_DATABASEHOSTNAME=${DATABASEHOSTNAME}
export ADSB_DATABASEUSER=${DATABASEUSER}
export ADSB_DATABASEPASSWORD1=${DATABASEPASSWORD1}
export ADSB_DATABASENAME=${DATABASENAME}
elif [ "${DATABASEENGINE}" = "SQLite" ]; then
if [ -z "${DATABASENAME}" ] ; then
DATABASENAME="${LIGHTTPD_DOCUMENT_ROOT}/data/portal.sqlite"
fi
export ADSB_DATABASEENGINE=${DATABASEENGINE}
export ADSB_DATABASEHOSTNAME=""
export ADSB_DATABASEUSER=""
export ADSB_DATABASEPASSWORD1=""
export ADSB_DATABASENAME=${DATABASENAME}
else
export ADSB_DATABASEENGINE="xml"
export ADSB_DATABASEHOSTNAME=""
@ -519,12 +528,7 @@ fi
## SETUP ADVANCED PORTAL FEATURES
if [[ "${ADVANCED}" = "true" ]] ; then
# If SQLite is being used and the path is not already set to the variable $DATABASENAME set it to the default path.
if [[ "${DATABASEENGINE}" = "SQLite" ]] && [[ -z "${DATABASENAME}" ]] ; then
DATABASENAME="${LIGHTTPD_DOCUMENT_ROOT}/data/portal.sqlite"
fi
if [ "${ADVANCED}" = "true" ] ; then
chmod +x ${RECEIVER_BASH_DIRECTORY}/portal/logging.sh
${RECEIVER_BASH_DIRECTORY}/portal/logging.sh
if [[ $? -ne 0 ]] ; then

Wyświetl plik

@ -39,6 +39,40 @@ PORTAL_BUILD_DIRECTORY="${RECEIVER_BUILD_DIRECTORY}/portal"
PORTAL_PYTHON_DIRECTORY="${PORTAL_BUILD_DIRECTORY}/python"
PYTHONPATH=`which python`
## ENABLE THE USE OF /ETC/RC.LOCAL IF THE FILE DOES NOT EXIST
if [ ! -f /etc/rc.local ]; then
echo ""
echo -e "\e[95m Enabling the use of the /etc/rc.local file...\e[97m"
echo ""
# In Debian Stretch /etc/rc.local has been removed.
# However at this time we can bring this file back into play.
# As to if in future releases this will work remains to be seen...
echo -e "\e[94m Creating the file /etc/rc.local...\e[97m"
sudo tee /etc/rc.local > /dev/null <<EOF
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
exit 0
EOF
echo -e "\e[94m Making /etc/rc.local executable...\e[97m"
sudo chmod +x /etc/rc.local
echo -e "\e[94m Enabling the use of /etc/rc.local...\e[97m"
sudo systemctl start rc-local
fi
## SETUP FLIGHT LOGGING
echo -e ""
@ -113,5 +147,3 @@ nohup ${PORTAL_PYTHON_DIRECTORY}/flights-maint.sh > /dev/null 2>&1 &
# Start maintenance.
echo -e "\e[94m Executing the maintenance maintenance script...\e[97m"
nohup ${PORTAL_PYTHON_DIRECTORY}/maintenance-maint.sh > /dev/null 2>&1 &
exit 0