Skip to main content
Question

Casper Custom Imaging - Scripting Option - Parameter 1


Forum|alt.badge.img+2
  • New Contributor
  • 1 reply

Greetings,

I’m looking to simplify the imaging process even more for the techs in the field and need some help. After doing a great deal of reading/research on scripting I was able to create a script the will add a print by command line.

#!/bin/sh

read prtname

printername="$prtname"

/usr/sbin/lpadmin -p $printername -E -v lpd://$printername.xxx.xxxx.xx/E450 -P /Library/Printers/PPDs/Contents/Resources/Lexmark E450dn.gz -D $printername

What I’m hoping is that someone can explained how I can have my tech launch Casper Imaging -> Select Custom Install -> Scripts -> choose the “add printer” script and on the Script Option Parameter 1 , I would like to have the Tech enter in the printer’s host name in Parameter 1.

Our supported OSX version

10.5, 10.6 and 10.7

LJ

3 replies

Forum|alt.badge.img+24
  • Valued Contributor
  • 1892 replies
  • October 9, 2012

Parameter 1 when using Imaging, Remote or Policies is actually $4. ($1, $2 and $3 are reserved by Casper).

In following your script, why are you setting printername to prtname? It seems redundant.

Instead, kill the read prtname line. Set the next line to be printername=$4. You want it to be this:

#!/bin/sh

printername=$4

/usr/sbin/lpadmin -p $printername -E -v lpd://$printername.xxx.xxxx.xx/E450 -P /Library/Printers/PPDs/Contents/Resources/Lexmark E450dn.gz -D $printername

Then, in Casper Admin, in your script's Options tab, give a name to "Parameter 4." Something like "Printer Name." That way it'll be labeled properly in Casper Remote, Imaging and Policies.


Forum|alt.badge.img+2
  • Author
  • New Contributor
  • 1 reply
  • October 9, 2012

jarednichols -

Thank You very much.... that did it and it also open up many other possibilities.


Forum|alt.badge.img+16
  • Legendary Contributor
  • 7880 replies
  • October 9, 2012

Yeah, script parameters you can pass from Casper Suite can make your scripts even more useful and versatile. Glad you're discovering good use for them.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings