Skip to content

Instantly share code, notes, and snippets.

@mpanighetti
mpanighetti / Get macOS Name and Version.sh
Created February 6, 2019 03:06
macOS Bash script. Returns the full name and version of macOS. Should work on any build that calls the operating system "macOS" (rather than "OS X" or "Mac OS X").
#!/bin/bash
echo "macOS $(cat /System/Library/CoreServices/Setup\ Assistant.app/Contents/Resources/en.lproj/OSXSoftwareLicense.rtf | awk -F 'macOS ' '/SOFTWARE LICENSE AGREEMENT FOR/ {print $NF}')"
echo "Version $(sw_vers -productVersion) ($(sw_vers -buildVersion))"
exit 0
@mpanighetti
mpanighetti / Controller Model.sh
Last active December 8, 2021 15:28
Controller Model - Jamf Pro extension attribute. Returns the model name of the built-in controller (e.g. Apple T2 Security Chip), or null if the Mac doesn't have a controller.
#!/bin/bash
echo "<result>$(/usr/sbin/system_profiler SPiBridgeDataType | /usr/bin/awk -F": " '/Model Name/ {print $NF}')</result>"
exit 0