1 Reply Latest reply on Sep 2, 2015 12:04 PM by Northice

    Custom Script for updating Mac via Software Update then rebooting

    csoto Specialist

      The following Custom Script will update a Mac OS X system using Apple Software Update. It will then reboot the machine IF nobody is logged into the Console.

       

      [MACHINES_MAC]

      REMEXEC0=/usr/sbin/softwareupdate -ia ; if [[ `stat -f '%Su' /dev/console` == \"root\" ]] ; then /sbin/shutdown -r now ; fi

       

      We use a Mac OS X Server in order to provide Apple Software Update Server (SUS) local to our network. This is significantly faster than each system going to Apple's CDN to deliver patches. We define the Apple SUS by using a Mac OS X Profile installed with the LDMS Mac Agent. See How to use the Software Update service in OS X Server to update your Mac clients - Apple Support for information on configuring Macs to use a local SUS.