Advertisement
Guest User

Check for updates

a guest
Oct 21st, 2022
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. #!/bin/zsh
  2. thisbuild=$(sw_vers -buildVersion) if [[ $thisbuild[0,2] -lt 20 ]]; then
  3. nohup osascript -e "display dialog \"Your macOS version is no longer supported.\" with title \"IT Department\" buttons {\"OK\"}" >/dev/null 2>&1 & disown; exit
  4. fi
  5. updates=$(softwareupdate -l 2>&1)
  6. if echo $updates | grep -q "No new"; then echo "- OS is Current."; exit
  7. elif echo $updates | grep -q "the following new"; then
  8. echo "- OS is *NOT* Current."
  9. nohup osascript -e "display dialog \"Apple reports updates to your OS or Apple-bundled
  10. apps are available.\" with title \"IT Department\" buttons {\"OK\"}" >/dev/null 2>&1 & disown; exit else
  11. echo "- Error during check."; exit fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement