1834140 Members
2841 Online
110064 Solutions
New Discussion

Auto re-enable printer

 
SOLVED
Go to solution
Ed Hon
Regular Advisor

Auto re-enable printer

On HP-UX 11, I have users who occasionally accidentally send a huge output job to an HP LaserJet printer, attached to the network with an HP JetDirect EX Plus print server. If no operator is around, the user will cut off the printer to stop the output, and later they turn it back on. The print job is gone, but the printer is no longer enabled on HP-UX and requires a command to re-enable the printer. Is there a way that printers can auto re-enable themselves without using a cron job do it? TIA.
3 REPLIES 3
federico_3
Honored Contributor
Solution

Re: Auto re-enable printer

You can use a simple script that runs in background like this:

***************************************
#! /bin/ksh

xx=0
while [ $xx -eq 0 ]
do
lpstat -p| grep disabled| awk '{fnd = 0} /^[A-Za-z] {fnd = 1
var = $0
print $0
next}
{ if (fnd != 1 )
{print var ""$0}
}'| awk '{print $2}'| xargs enable

sleep 600

done
******************************************

This script will run in background and check every 600 seconds the disabled printers enabling them


Regards,

Federico


Lasse Knudsen
Esteemed Contributor

Re: Auto re-enable printer

You could just remove the 'disable' command from your printer interface script and maybe replace it with some other command that could do some things for you. /etc/lp/interface/
In a world without fences - who needs Gates ?
Rainer_1
Honored Contributor

Re: Auto re-enable printer

if you have configured your printer as a remote printer (not with jetadmin) you could go to /var/spool/lp/interface
and edit the printer interface script (same name as the printer queue) and comment the disable command at the near end of the script

#disable -r"$reason" $printer