Mac OS X: 实用脚本程序(bash scripts)系列-11

从ARD发送这个命令,可以让目标Mac运行苹果内置更新

#!/bin/sh

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

你可能感兴趣的:(Mac OS X)