# Update lcoal branches which are set to track remote.
ACTION=$(git remote update 2>&1)
# Check if local branch is behind remote.
if[["${RECEIVER_AUTOMATED_INSTALL}"="false"]]&&[[`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?"1478
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."1078 3>&1 1>&2 2>&3)
BACKUP_BRANCH_NAME_TITLE="Name Of Backup Branch (REQUIRED)"
done
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..."
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?"1478
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."
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?"1178
case$? in
0)UPDATE_OPERATING_SYSTEM="true";;
1)UPDATE_OPERATING_SYSTEM="false";;
esac
fi
if[["${UPDATE_OPERATING_SYSTEM}"="true"]];then
UpdateOperatingSystem
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
if[[$? -ne 0]];then
echo -e " \e[91m ANY FURTHER SETUP AND/OR INSTALLATION REQUESTS HAVE BEEN TERMINIATED\e[39m"
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"2065