Avoid interaction into script

Sorry for my english!

I'm using Debian squeeze and for an assignement, i have create 2 virtual pdf cups printers. Both are working very well.
To test the different administion command; i try to disable one of the printer and move his queue file to the second one. I'm able to do it easily.

Now, i wish to write a bash script that wil test the status of the printer. So that,if the printer is disable, it just execute the "move" script.
Is there a way to know the status of a cups printer and use that information in a script?

For example, a command/function that can return "O" is the cups printer is enable and "1" if not.

I also try using "/usr/sbin/lpc" and after it "status PrinterName". How can be my script so that: after execution "/usr/sbin/lpc" it just execute the command "status" with the first paramater "$1".

Thanks for your help,

Dont you have lpadmin lpstat commands for cups installed?

There ara also install.
But a need script that can check the statut and if one of the printer is disabble (for example), an automatic lpmove should be execute.

do a:

lpstat -t

And see if that doesnt give you some ideas

It's OK.

I use lpc statut PrinterName and i finally write a script.
Thanks you