diff --git a/Apple Software Update - Pending Updates b/Apple Software Update - Pending Updates new file mode 100644 index 0000000..f8d8ab4 --- /dev/null +++ b/Apple Software Update - Pending Updates @@ -0,0 +1,13 @@ +#!/bin/sh + +# Get macOS version info +osVersionFirst=$(sw_vers -productVersion | awk -F. '{print $1}') +osVersionSecond=$(sw_vers -productVersion | awk -F. '{print $2}') + +if [[ $osVersionFirst -ge 10 ]] && [[ $osVersionSecond -ge 13 ]]; then + SUPending=`softwareupdate --list --no-scan | grep -i ")," | cut -f1 -d","` + echo "$(printf '%s\n' "$SUPending")" +else + # Return EA Result, 10.12.6 or below + echo "`echo Unsupported macOS - Requires 10.13 or above`" +fi