So I've been noticing an odd thing in the last couple months. When we push software updates either via casper or through command line, it doesn't always work the first time. Looking the logs it shows it's downloading the components, but doesn't always install them. This seems consistent on most machines. Usually takes about 2-3 times running it for the updates the updates for it to download and install the updates. Was just wondering if this is something only occuring on our network.
I did write a script to resolve the issue...but still very odd.
#!/bin/bash
####################################################################################################
#
# DESCRIPTION
# Keep running software update until no more updates are available
#
# AUTHOR
# Roie Gat
####################################################################################################
echo "Testing for software Updates"
##Checks to see if there are any updates avilable. If there are less then five worlds returned then there is
##and update avialble
if [ `softwareupdate -l | wc -l` -le 5 ]
then
##No updates found
echo "No Updates"
else
##There are updates available
echo "Updates Available"
while [ `softwareupdate -l | wc -l` -gt 4 ]
#While there are updates available....keep running softwareupdate
do
echo "Running SoftwareUpdate"
sudo softwareupdate -ia
done
fi
exit 0