From 8115fdbb5720794db4d8b2f268a435664209487b Mon Sep 17 00:00:00 2001 From: blakeusblade <38586836+blakeusblade@users.noreply.github.com> Date: Fri, 9 Aug 2019 21:03:37 +1000 Subject: [PATCH] Create Apple Software Update - Pending Updates --- Apple Software Update - Pending Updates | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Apple Software Update - Pending Updates 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