Skip to content

Update EA-Nudge-Logs.sh#8

Open
wantedwriter wants to merge 1 commit intodan-snelson:mainfrom
wantedwriter:patch-1
Open

Update EA-Nudge-Logs.sh#8
wantedwriter wants to merge 1 commit intodan-snelson:mainfrom
wantedwriter:patch-1

Conversation

@wantedwriter
Copy link

Added 14* for Sonoma

Added 14* for Sonoma
Copy link

@AirBookMac AirBookMac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can add 15* for sequoia

@kevinVodi
Copy link

kevinVodi commented Jan 29, 2026

Latest code confirmed working:

#!/bin/sh
##########################################################
# A script to determine the client-side output of Nudge. #
##########################################################

osProductVersion=$( /usr/bin/sw_vers -productVersion )

case "${osProductVersion}" in

	10*	)
			echo "<result>N/A; macOS ${osProductVersion}</result>"
			;;

	11* | 12* | 13* | 14* | 15* | 26* )
			loggedInUser=$( /bin/echo "show State:/Users/ConsoleUser" | /usr/sbin/scutil | /usr/bin/awk '/Name :/ { print $3 }' )
			requiredOS=$( /usr/bin/defaults read /Users/"${loggedInUser}"/Library/Preferences/com.github.macadmins.Nudge.plist requiredMinimumOSVersion )
			logEntries=$( /usr/bin/grep com.github.macadmins.Nudge /var/log/Nudge.log | /usr/bin/tail -5 | /usr/bin/awk '{ split($2, split_time, "."); $2 = split_time[1]; print }' | /usr/bin/cut -d ' ' -f -2,6- )
			echo "<result>Required OS: ${requiredOS}
${logEntries}</result>"
			;;
esac

exit 0

Copy link

@kevinVodi kevinVodi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to be updated for 15 and 26

#!/bin/sh
##########################################################
# A script to determine the client-side output of Nudge. #
##########################################################

osProductVersion=$( /usr/bin/sw_vers -productVersion )

case "${osProductVersion}" in

	10*	)
			echo "<result>N/A; macOS ${osProductVersion}</result>"
			;;

	11* | 12* | 13* | 14* | 15* | 26* )
			loggedInUser=$( /bin/echo "show State:/Users/ConsoleUser" | /usr/sbin/scutil | /usr/bin/awk '/Name :/ { print $3 }' )
			requiredOS=$( /usr/bin/defaults read /Users/"${loggedInUser}"/Library/Preferences/com.github.macadmins.Nudge.plist requiredMinimumOSVersion )
			logEntries=$( /usr/bin/grep com.github.macadmins.Nudge /var/log/Nudge.log | /usr/bin/tail -5 | /usr/bin/awk '{ split($2, split_time, "."); $2 = split_time[1]; print }' | /usr/bin/cut -d ' ' -f -2,6- )
			echo "<result>Required OS: ${requiredOS}
${logEntries}</result>"
			;;
esac

exit 0

dan-snelson added a commit that referenced this pull request Feb 3, 2026
Signed-off-by: Dan K. Snelson <24623109+dan-snelson@users.noreply.github.com>
@dan-snelson
Copy link
Owner

Thanks, @kevinVodi; updated in the development branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Comments