fix: handle multi-digit Amazon Linux 2023 minor versions (#1455)

## Summary
- Fix version detection for Amazon Linux 2023.10+ (e.g.,
`2023.10.20260105`)
- Previous logic only checked single char, failing for double-digit
minor versions

Fixes #1454
This commit is contained in:
Stanislas
2026-01-13 22:06:36 +01:00
committed by GitHub
parent 9c966d4d04
commit 42f3051489

View File

@@ -1682,7 +1682,7 @@ function checkOS() {
log_fatal "Your version is not supported."
fi
if [[ $ID == "amzn" ]]; then
if [[ "$(echo "$PRETTY_NAME" | cut -c 1-18)" == "Amazon Linux 2023." ]] && [[ "$(echo "$PRETTY_NAME" | cut -c 19)" -ge 6 ]]; then
if [[ "$PRETTY_NAME" =~ ^Amazon\ Linux\ 2023\.([0-9]+) ]] && [[ "${BASH_REMATCH[1]}" -ge 6 ]]; then
OS="amzn2023"
else
log_info "The script only supports Amazon Linux 2023.6+"