setup-your-mac / Setup-Your-Mac

Setup Your Mac aims to simplify initial device configuration by leveraging swiftDialog and Jamf Pro Policy Custom Events to allow end-users to self-complete Mac setup post-enrollment.
https://snelson.us/sym
MIT License
249 stars 56 forks source link

Report on RSR version if applicable #50

Closed drtaru closed 1 year ago

drtaru commented 1 year ago

After using Erase All Content And Settings on a Mac that has had a RSR installed the RSR persists. This change will report the subversion (a) (b) etc. in the script logs as well as anywhere else osVersion is called in the main script.

Can be held for 1.10.1 as LineNumbers have been shifted. I primarily wrote this to report RSR value in the Webhook results.

dan-snelson commented 1 year ago

Thanks, @drtaru!

rougegoat commented 1 year ago

Do we know if the -productVersionExtra flag will return anything on a machine that had an RSR on an older version of macOS? For example, a machine running 13.3.1 (a) upgraded to 13.4.

if it doesn't, you could probably use osVersion="$( sw_vers -productVersion )$( sw_vers -productVersionExtra )" initially to avoid the extra If then line.

drtaru commented 1 year ago

The issue is there needs to be an if [[ "${osMajorVersion}" -ge 13 ]] because if you run sw_vers -productVersionExtra on a system Pre-Ventura you get an error as the variable, so might as well test for the extra as well and ignore it if it doesn't exist.

image