v2.5.6 = Bug fix when testing OS versions

This commit is contained in:
Zack T
2024-06-10 15:14:44 -07:00
parent 2077a1e970
commit 9c7571f3b5

View File

@@ -4,7 +4,7 @@
####################################################################################################
# Script Name: Get-LatestOSSupported.sh
# By: Zack Thompson / Created: 9/26/2017
# Version: 2.5.5 / Updated: 10/3/2023 / By: ZT
# Version: 2.5.6 / Updated: 6/10/2024 / By: ZT
#
# Description: A Jamf Pro Extension Attribute to check the latest compatible version of macOS.
#
@@ -475,13 +475,11 @@ case "${model_result}" in
;;
esac
if [[ "${version_string}" =~ ^10[.].+ ]]; then
test_running_unsupported="${current_os_major}.${current_os_minor}"
else
test_running_unsupported="${current_os_major}"
fi
if [[ $( /usr/bin/bc <<< "${test_running_unsupported} > ${version_string}" ) -eq 1 ]]; then
if [[
( "${version_string}" =~ ^10[.].+ && \
"${current_os_minor}" -gt $( echo "${version_string}" | /usr/bin/awk -F '.' '{print $2}' ) ) \
|| "${current_os_major}" -gt $( echo "${version_string}" | /usr/bin/awk -F '.' '{print $1}' )
]]; then
# Check to see if device is running an OS version newer than what it supports.
# If so, no reason to check further specifications.
report_result="${model_result} (Model doesn't support current OS version)"