Skip to content

Instantly share code, notes, and snippets.

@matthewbodaly
Created August 16, 2016 05:35
Show Gist options
  • Save matthewbodaly/40a5b2b23f2fa81c36fca6c3f1d7645c to your computer and use it in GitHub Desktop.
Save matthewbodaly/40a5b2b23f2fa81c36fca6c3f1d7645c to your computer and use it in GitHub Desktop.
Ea for figuring out if a restart is needed
#!/bin/bash
# I could probably do it this way with a little time
# https://jamfnation.jamfsoftware.com/discussion.html?id=19323
installAtLogoutItems=$(defaults read /Library/Updates/index.plist InstallAtLogout)
printf '<result>'
if [ ${#installAtLogoutItems} -le 3 ]; then
printf 'No updates pending'
else
printf "%s" "${installAtLogoutItems:1:${#installAtLogoutItems}--2}"
fi
printf '</result>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment