How to send unix commands via Casper

Not applicable

Hello all..

We've been using Casper here for a few months now, and it's been working
great. For the most part we have been using packages for any configuration
and install procedures so have not needed to use scripts much other than to
trigger a package install or create user accounts.

My question is, how do you use Casper to send unix commands?

Example, I would like to change the proxy settings on all my Macs and I do
not want to copy out a plist.

With ARD I can just send out this command:

networksetup -setwebproxy "Built-in Ethernet" proxy.company.com 80

How would I accomplish this same thing in Casper??

Any help is much appreciated!

-- Jason Weber
Technology Support Cluster Specialist
Independent School District 196

11 REPLIES 11

ernstcs
Contributor III

Hi Jason,

Open up a Casper to a Remote window Check all the machines you want to send the command to Go the advanced tab Enter your command into the Run Command field (check to run as root if necessary) * Click GO

Or you could set it up as a policy to run at next startup or whenever. The top option assumes every machine you want to target will be on and accessible when you hit go.

Craig Ernst
Systems Management & Configuration
----------------------------------
University of Wisconsin-Eau Claire
Learning & Technology Services
105 Garfield Ave
Eau Claire, WI 54701
Phone: (715) 836-3639
Fax: (715) 836-6001
----------------------------------
ernstcs at uwec.edu

tlarkin
Honored Contributor

use that command, create a script, toss it on casper admin, sync it to your JSS, then create a policy that runs that script, voila you are done!

Easy cheesy

I have like, 20 different configuration scripts running as simple policies for things just like that, proxies, preferences, removing unwanted or old software, changing passwords, etc.

Thomas Larkin
TIS Department
KCKPS USD500
tlarki at kckps.org
cell: 913-449-7589
office: 913-627-0351

ernstcs
Contributor III

Why make it a script? That's an extra step. Just add that command to the advanced tab of the policy.

Craig

tlarkin
Honored Contributor

Call me a beard stroking old school Unix guy, but I like having scripts that I can use to run many configurations at once, instead of manually pipping in codes into the JSS. Also, I can run several test runs on scripts on a machine locally before I toss it up on the JSS.

Just my method is all. To each their own.

Thomas Larkin
TIS Department
KCKPS USD500
tlarki at kckps.org
cell: 913-449-7589
office: 913-627-0351

ernstcs
Contributor III

Anything beyond a simple one-liner command I can see that. I still use scripts as well. Beard stroking old school Unix guy, nice. I have a beard...

Craig

On 5/14/08 3:54 PM, "Thomas Larkin" <tlarki at kckps.org> wrote:

Call me a beard stroking old school Unix guy, but I like having scripts that I can use to run many configurations at once, instead of manually pipping in codes into the JSS. Also, I can run several test runs on scripts on a machine locally before I toss it up on the JSS.

Just my method is all. To each their own.

Thomas Larkin
TIS Department
KCKPS USD500
tlarki at kckps.org
cell: 913-449-7589
office: 913-627-0351

milesleacy
Valued Contributor

....and if you make it a script, you can add it to configurations or execute
it on demand via Casper remote.

-- Miles Leacy
Senior Macintosh Technician
Polo Ralph Lauren
212-318-7603
miles.leacy at poloralphlauren.com

ernstcs
Contributor III

...and to summarize...making the command into a script in the JSS makes it easily reusable in multiple facets of machine management.

Not applicable

I agree, We push all Printers through scripts that way Quark plays nice, we
also update virus defs with scripts. Bill set up many scripts here and they
are invaluable, sure many of the tasks could be handled through Casper, but
the speed, reliability, flexibility and just plain nerd factor is just
great.

milesleacy
Valued Contributor

Do you find that pushing printers via scripts is superior in some ways to
pushing printers using the built-in printer tool in Casper?

Not applicable

Yes Quark does not like cups/gimp drivers and therefore caused issues with
us. Using lpadmin commands like this
lpadmin -p "tmb_prt44" -L "Richo 9100" -D "tmb_prt44" -E -v
socket://tmbprt44.stp.mrll.com -P
"/Library/Printers/PPDs/Contents/Resources/en.lproj/RICOH Aficio SP 9100DN"
-o Finisher=FinVICTORIA

Worked much better with fewer printing issues down the road. You can
retrieve the options of a specific PPD by using the lpoptions command. The
options are PPD specific consequently you cant use the same command with
different PPDs and get the results you desire. This is especially true
when using printers from different vendors. HP is probably the most
consistent as they do driver dev in house.

tlarkin
Honored Contributor

We don't have anything fancy, but typically what I do is set up one
system working with the network printer, then just use ARD admin to copy
the /etc/cups/ppd to all the clients on a subnet and it copies all the
print drivers and settings to each machine.

We use very simple IP printing though, with no print queue or servers
involved and typically only lab computers print to a printer.

Thomas Larkin
TIS Department
KCKPS USD500
tlarki at kckps.org
cell: 913-449-7589
office: 913-627-0351