From a39eb845ec3a285da0662bb4f79bc7a6d84db61d Mon Sep 17 00:00:00 2001 From: Romeo-Golf Date: Tue, 20 Dec 2016 13:40:57 +0000 Subject: [PATCH] Small tidy of bash/init.sh --- bash/init.sh | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/bash/init.sh b/bash/init.sh index 3622b69..60cd410 100755 --- a/bash/init.sh +++ b/bash/init.sh @@ -34,23 +34,25 @@ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # -## VARIABLES +### VARIABLES PROJECTBRANCH="master" PROJECTROOTDIRECTORY="$PWD" BASHDIRECTORY="$PROJECTROOTDIRECTORY/bash" BUILDDIRECTORY="$PROJECTROOTDIRECTORY/build" -## INCLUDE EXTERNAL SCRIPTS +### INCLUDE EXTERNAL SCRIPTS source $BASHDIRECTORY/functions.sh -## MORE VARIABLES +### MORE VARIABLES -export ADSB_PROJECTTITLE="The ADS-B Receiver Project Installer" +export PROJECT_TITLE="The ADS-B Receiver Project Installer" +export PROJECT_WEBSITE="https://www.adsbreceiver.net" +export ADSB_PROJECTTITLE="$PROJECT_TITLE" TERMINATEDMESSAGE=" \e[91m ANY FURTHER SETUP AND/OR INSTALLATION REQUESTS HAVE BEEN TERMINIATED\e[39m" -## CHECK IF THIS IS THE FIRST RUN USING THE IMAGE RELEASE +### CHECK IF THIS IS THE FIRST RUN USING THE IMAGE RELEASE if [ -f $PROJECTROOTDIRECTORY/image ]; then # Enable extra confirmation dialogs.. @@ -67,7 +69,7 @@ if [ -f $PROJECTROOTDIRECTORY/image ]; then exit 0 fi -## FUNCTIONS +### FUNCTIONS # UPDATE REPOSITORY PACKAGE LISTS function AptUpdate() { @@ -106,7 +108,7 @@ function CheckPrerequisites() { } function UpdateRepository() { -## UPDATE THIS REPOSITORY +### UPDATE THIS REPOSITORY clear echo -e "\n\e[91m $ADSB_PROJECTTITLE" echo "" @@ -151,30 +153,33 @@ AptUpdate CheckPrerequisites UpdateRepository -## DISPLAY WELCOME SCREEN +### DISPLAY WELCOME SCREEN -## ASK IF OPERATING SYSTEM SHOULD BE UPDATED +### ASK IF OPERATING SYSTEM SHOULD BE UPDATED if (whiptail --backtitle "$ADSB_PROJECTTITLE" --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 UpdateOperatingSystem fi -## EXECUTE BASH/MAIN.SH +### EXECUTE BASH/MAIN.SH chmod +x $BASHDIRECTORY/main.sh $BASHDIRECTORY/main.sh +# Catch unclean exist from main.sh if [ $? -ne 0 ]; then echo -e $TERMINATEDMESSAGE echo "" exit 1 fi -## INSTALLATION COMPLETE +### INSTALLATION COMPLETE # Display the installation complete message box. whiptail --backtitle "$ADSB_PROJECTTITLE" --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\nhttps://github.com/jprochazka/adsb-receiver" 20 65 # Unset any exported variables. +unset PROJECT_TITLE +unset PROJECT_WEBSITE unset ADSB_PROJECTTITLE # Remove the FEEDERCHOICES file created by whiptail.