diff --git a/bash/portal/install.sh b/bash/portal/install.sh index 856a725..f8431fd 100755 --- a/bash/portal/install.sh +++ b/bash/portal/install.sh @@ -104,9 +104,6 @@ else # Ask which type of database to use. DATABASEENGINE=$(whiptail --title "Choose Database Type" --nocancel --menu "\nChoose which type of database to use." 11 80 2 "MySQL" "" "SQLite" "" 3>&1 1>&2 2>&3) - # Export this variable. - export ADSB_DATABASEENGINE=$DATABASEENGINE - if [ $DATABASEENGINE = "MySQL" ]; then # Ask if the database server will be installed locally. whiptail --title "MySQL Database Location" --yesno "Will the database be hosted locally on this device?" 7 80 @@ -457,6 +454,14 @@ fi ## SETUP FLIGHT LOGGING USING THE SCRIPT LOGGING.SH if [ $ADVANCED = TRUE ]; then + + # Export variables needed by logging.sh. + export ADSB_DATABASEENGINE=$DATABASEENGINE + export ADSB_DATABASEHOST=$DATABASEHOST + export ADSB_DATABASEUSER=$DATABASEUSER + export ADSB_DATABASEPASSWORD1=$DATABASEPASSWORD1 + export ADSB_DATABASENAME=$DATABASENAME + chmod +x $BASHDIRECTORY/portal/logging.sh $BASHDIRECTORY/portal/logging.sh if [ $? -ne 0 ]; then diff --git a/bash/portal/logging.sh b/bash/portal/logging.sh index 3f78475..b74749e 100755 --- a/bash/portal/logging.sh +++ b/bash/portal/logging.sh @@ -41,8 +41,17 @@ PORTALBUILDDIRECTORY="$BUILDDIRECTORY/portal" RAWDOCUMENTROOT=`/usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf -p | grep server.document-root` LIGHTTPDDOCUMENTROOT=`sed 's/.*"\(.*\)"[^"]*$/\1/' <<< $RAWDOCUMENTROOT` -# This will not work for first time installs... DATABASEENGINE=$ADSB_DATABASEENGINE +DATABASEHOST=$ADSB_DATABASEHOST +DATABASEUSER=$ADSB_DATABASEUSER +DATABASEPASSWORD1=$ADSB_DATABASEPASSWORD1 +DATABASENAME=$ADSB_DATABASENAME + +unset ADSB_DATABASEENGINE +unset ADSB_DATABASEHOST +unset ADSB_DATABASEUSER +unset ADSB_DATABASEPASSWORD1 +unset ADSB_DATABASENAME PYTHONPATH=`which python`