Scripts and Software Updates

Not applicable

We are having issues deploying scripts. One is the ability to target specific updates when we have people requesting a specific update ahead of our software update schedule.

It is fine and dandy that Casper has the ability to do all updates but is there a working way to have Casper do specific software updates such as iTunesX-9.2.1
In scripts we can use softwareupdate –install iTunesX-9.2.1

But when we try to have Casper deploy these scripts they are not functioning correctly.

tell application "Terminal" try set appfilename to "iTunesX-9.2.1" do shell script "sudo /usr/sbin/softwareupdate -i " & appfilename user name "anadminaccount" password "adminpassword" with administrator privileges end try
end tell

The other type of script we are having issues with is using Casper for startup scripts that load network drive mappings.

mount volume "smb://abc.xyz.net/share1" mount volume "smb://abc.xyz.net/share2" mount volume "smb://abc.xyz.net/share3"

I am assuming that anything ran from Casper will be using the Casper service account so it wont map the actual user when they login. What are other alternatives other then copying this script locally as a daemon?

Thanks,

Grant Lutz
System Engineer

4 REPLIES 4

tlarkin
Honored Contributor

Eh, this sounds like a pain because you'd have to maintain it, but you
could script it like this

#!/bin/bash

# create array of software updates

SWUpdates=" Update1.pkg Update2.pkg Update3.pkg Update4.pkg "

# now install updates

for file in $SWUpdates ; do

/usr/sbin/softwareupdate -i $SWUpdates

done

exit 0

There is also a list command, so you could grab certain updates you
always wanted to to keep up to date, but you'd have to keep track of
dependencies. More and more it seems that QT, Safari, and iTunes are
all tied together which means you gotta update them all together. You
could have a command to grep/awk/sed out keywords like iTunes, safari,
QuickTime, and then have it run those.

Though I think your best bet will be building a SUS

RobertHammen
Valued Contributor II

I would probably not be trying to use AppleScript to run a Terminal command, I'd just use a shell script.
On Jul 23, 2010, at 12:38 PM, Grant Lutz (CW) wrote:

Could either declare a variable and use it directly in the softwareupdate -i command, or just use the package name (determined from softwareupdate -l).

If you do it that way you don't have to enter the username and password, it'll run as whatever management account Casper is using.

If you're not sure about shell scripting, download the Resource Kit and get started/play with some scripts. You can run them locally on a test/demo machine, something you can blow up and reimaged, if you're not sure. Then, when you're reasonably confident that it works, suggest copying it into Casper Admin and then testing your deployment policy on one or more machines. Once you're confident that your policy is working fine and obtaining the right results, then you can expand it for wider deployment...

--Robert

RobertHammen
Valued Contributor II

Are you editing your script in TextEdit? Looks like your script is actually an RTF file. Format menu->Make Plain Text->File menu->Save As... and name it something like "runiTunes9.2.1update.sh"
On Jul 23, 2010, at 1:32 PM, Grant Lutz (CW) wrote:

In Terminal on a test machine:

chmod +x runiTunes9.2.1update.sh (specifying the path to the file if necessary)
./runiTunes9.2.1update.sh (runs it manually on your test machine, you'll need to enter an administrative username/password for it to complete)

tlarkin
Honored Contributor

Yup that is because the script is saved in rich text format, it needs to be plain old unicode text