How to add hpnpl printer from the command lines

NOTE: This is an unsupported procedure!!! Please advice the customer about this.
Use this procedure when all other options have failed to try to add a Jet Direct Printer through hppi.

$ mkdir /etc/lp/interface/model.orig  (if you don't have it) 
$ chown lp:bin /etc/lp/interface/model.orig
$ chmod 755 /etc/lp/interface/model.orig

Then go ahead and setup your printer with 'lpadmin' after you shutdown the scheduler (noone can print on this system while the scheduler is shut down, so you might want to wait until your users are ready for it) :
$ /usr/sbin/lpshut 
$ /usr/sbin/lpadmin -p <printer_name> -v/dev/null -m <interface_script>
The interface script must be located in /var/spool/lp/model for lpadmin to be able to find it, so just copy any JetAdmin scripts you would like to use to that directory before you call lpadmin.
Now make sure all interface scripts for JetAdmin are in the correct place :
$ cd /var/spool/lp/interface
$ mv <printer_name> model.orig/<printer_name>
$ cp /opt/hpnpl/sh/hpnp.model <printer_name>
$ chown lp:lp <printer_name> model.orig/<printer_name>
$ chmod 755 <printer_name> model.orig/<printer_name>
Now enable the printer and restart the scheduler:
$ accept <printer_name>
$ enable <printer_name>
$ /usr/sbin/lpsched
You can test your configuration by printing via lp :
$ lp -d <printer_name> <file_name_to_print>
To test if the connection to the printer works without going through the spooler use this command :
$ /opt/hpnpl/bin/hpnpf -x <printer_name_or_ip> -l <log_file_name> <file_name_to_print>
SHARE

sangeethakumar

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment