Linux Kiosk Printer Detection & Script modification

I have a situation where I have built a boot-able CD-ROM based on Ubuntu 5.10. The boot-able CD is working great, but I have this one little thing that I think should be possible but just don't know for sure so I thought I would ask you guys.

When booting the CD-ROM, this is what happens:
The CD Boots, Ubuntu does its thing and loads all the gory tech stuff, and it auto logs in as user Ubuntu.
I have modified parts of the Gnome desktop (specifically the sessions StartUp Programs) to run a script called kisok_setup for me when the user loads. I use this kiosk_setup script to build all my generic printers, and to launce the web browser and acrobat reader (this Kiosk is being set up as Print Station for a MFG plant). As I said everything works fine and I have a working model now. When the kiosk_setup is run, it adds:

1 parallel laserjet (hp compatible)
1 USB laserjet (hp & Linux compatible)
3 known network printers (strategically placed in the plant)

right now, I have to make 2 CD's, one where the default printer is parallel the other where the default printer is USB.

So my question is - does anyone know if there is anyway I could check to see if in fact there is a USB or Parallel printer connected to the PC after it boots (during the execution of kiosk_setup) then make that detected printer the default?

For the kiosk_setup script I am using bash, and this is basically all it does for the printers:

# Printers
# Add a parallel laserjet
lpadmin -p ParaLaser -L WebKiosk -E -v parallel:/dev/lp0 -m laserjet.ppd
# Set parallel printer options
lpoptions -p ParaLaser -o media=letter

# Add a usb laserjet (tested with hplj 1012)
lpadmin -p USBLaser -L WebKiosk -E -v usb:/dev/usb/lp0 -m laserjet.ppd
# Set usb printer options
lpoptions -p USBLaser -o media=letter

# Setting the default printer
lpoptions -d ParaLaser

or for the second CD

# Setting the default printer
lpoptions -d USBLaser

Thanks in advance for any suggestions.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I would detect the usb printer, and use it if it is there, but if not default to parallel.  I think the system can detect a usb printer, but i'm not sure about parallel.  

to detect the usb, i'd do something like this...

usb=`lsusb -v | grep USBPRINTERSTRING | wc -l`
if [[$usb = "1"]]
lpoptions -d USBLaser
lpoptions -d ParaLaser

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
NTNBowerAuthor Commented:
I was just working on a script to do that same thing before I left work on Friday! I am plannig to set this up for on a few "known to work" low end printers, so I would think this should work most of the time. So I am guessing there is nothing to check for a parallel?

unfortunately, i do not have access to a parallel printer, so maybe someone else can comment on this...
'lpstat' may give you information on what printers are connected?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.