Mac – System Updates via ARD

A script to run system updates via ARD … I like this particular script because it can be run on multiple machines at the same time without killing the network. It also does not run if the machine is in use and it forces a reboot. This script was shamelessly copied from:
http://macadmincorner.com/send-softwareupdate-command-through-ard/

#!/bin/sh

# Random number of seconds to wait
# The more machines you use this with, the higher the number should be
sleep `expr $RANDOM % 120`

if who | grep console; then
echo Machine is in use
exit 1
fi

COMMAND_LINE_INSTALL=1 softwareupdate -i -a
shutdown -r now
exit 0

This entry was posted in Labs and tagged , . Bookmark the permalink.

Comments are closed.