Skip to content

Commit

Permalink
Update only if current FTL version is less than latest
Browse files Browse the repository at this point in the history
Note: the previous code was checking for inequality

Signed-off-by: RD WebDesign <[email protected]>
  • Loading branch information
rdwebdesign committed Feb 28, 2023
1 parent 8b6bd5f commit 7054678
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion automated install/basic-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2450,7 +2450,14 @@ FTLcheckUpdate() {
# There was an issue while retrieving the latest version
printf " %b Failed to retrieve latest FTL release metadata" "${CROSS}"
return 3
elif [[ "${FTLversion}" != "${FTLlatesttag}" ]]; then
fi

# Convert version strings into numbers for comparison
local convertedFTLversion=$(echo "$FTLversion" | tr -d '[:alpha:]' | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }';)
local convertedFTLlatesttag=$(echo "$FTLversion" | tr -d '[:alpha:]' | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }';)

if [[ "${convertedFTLversion}" -lt "${convertedFTLlatesttag}" ]]; then
# FTL is out of date
return 0
else
printf " %b Latest FTL Binary already installed (%s). Confirming Checksum...\\n" "${INFO}" "${FTLlatesttag}"
Expand Down

0 comments on commit 7054678

Please sign in to comment.