Skip to content

Instantly share code, notes, and snippets.

@soundsnw
Last active Aug 16, 2022
Embed
What would you like to do?
SimpleNudge.sh
#!/bin/zsh
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
jamfHelper="/Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper"
description="Your Mac has important operating system updates available."
button1="See Updates"
icon="/Library/Application Support/YourCompany/yourlogo.png"
title="Update Notification"
heading="Please Update macOS"
"$jamfHelper" -windowType utility -description "$description" -title "$title" -heading "$heading" -button1 "$button1" -icon "$icon"
loggedInUser=$( scutil <<< "show State:/Users/ConsoleUser" | awk '/Name :/ && ! /loginwindow/ { print $3 }' )
sudo -u "$loggedInUser" open "x-apple.systempreferences:com.apple.preferences.softwareupdate"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment