update: abort if FTL branch does not exist

Currently, if the FTL update check returns 404, hence the FTL branch does not seem to exist, an error message is printed, but the update continues, only the FTL update is skipped.

This can lead to setups with v5 FTL and v6 core/web, failing at config migration, where FTL is invoked with a v6-only command.

With this change, the update aborts immediately if the FTL branch is invalid, like it does in case of other FTL update check errors (other HTTP error codes than 404 or other curl errors). Hence it continues only if FTL is up-to-date already, or a new version from the given branch has been found.

Signed-off-by: MichaIng <micha@dietpi.com>
This commit is contained in:
MichaIng 2025-07-10 21:34:35 +02:00
parent 5b5e02d492
commit 6db6c68a4e
No known key found for this signature in database
GPG Key ID: CE6E5D0C45CE1624

View File

@ -164,6 +164,7 @@ main() {
;; ;;
2) 2)
echo -e " ${INFO} FTL:\\t\\t${COL_RED}Branch is not available.${COL_NC}\\n\\t\\t\\tUse ${COL_GREEN}pihole checkout ftl [branchname]${COL_NC} to switch to a valid branch." echo -e " ${INFO} FTL:\\t\\t${COL_RED}Branch is not available.${COL_NC}\\n\\t\\t\\tUse ${COL_GREEN}pihole checkout ftl [branchname]${COL_NC} to switch to a valid branch."
exit 1
;; ;;
3) 3)
echo -e " ${INFO} FTL:\\t\\t${COL_RED}Something has gone wrong, cannot reach download server${COL_NC}" echo -e " ${INFO} FTL:\\t\\t${COL_RED}Something has gone wrong, cannot reach download server${COL_NC}"