Merge pull request #2659 from pi-hole/tweak/warn_if_FTL_not_on_master

Warn user during update if FTL is on a custom branch
This commit is contained in:
DL6ER 2019-03-03 09:34:11 +01:00 committed by GitHub
commit 0a53e966ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -146,6 +146,20 @@ main() {
FTL_update=false FTL_update=false
fi fi
# Determine FTL branch
local ftlBranch
if [[ -f "/etc/pihole/ftlbranch" ]]; then
ftlBranch=$(</etc/pihole/ftlbranch)
else
ftlBranch="master"
fi
if [[ ! "${ftlBranch}" == "master" && ! "${ftlBranch}" == "development" ]]; then
# Notify user that they are on a custom branch which might mean they they are lost
# behind if a branch was merged to development and got abandoned
printf " %b %bWarning:%b You are using FTL from a custom branch (%s) and might be missing future releases.\\n" "${INFO}" "${COL_LIGHT_RED}" "${COL_NC}" "${ftlBranch}"
fi
if [[ "${core_update}" == false && "${web_update}" == false && "${FTL_update}" == false ]]; then if [[ "${core_update}" == false && "${web_update}" == false && "${FTL_update}" == false ]]; then
echo "" echo ""
echo -e " ${TICK} Everything is up to date!" echo -e " ${TICK} Everything is up to date!"