Below is a script that you may find useful in adding HP, Dataproducts, and remote printers. Hopefully my copy and paste worked well here. If you don't have Dataproduct printers or perhaps you have other non-HP printers, you can modify the script. You can also add 600dpi if needed. I keep the script (hpadd) in a directory in the path that is nfs mounted to all my other AIX machines. I can send the script to anyone interested (bfoj2005@yahoo.com).
#!/bin/ksh
# hpadd
# Script to add HP Laserjet, LZR-2080, and Remote Printer Queues
#
hp=""
printerip=""
q300dpi=""
remq=""
remhost=""
export hp printerip q300dpi
posthp()
# Function to add Printer Queues to HP Laserjet Printer
{
print -n "HP Laserjet QueueName on Laserjet printer: "
read hp
print -n "HOSTNAME of the JetDirect Card: "
read printerip
print
# Create Printer Queue
/usr/lib/lpd/pio/etc/piomkjetd mkpq_jetdirect -p 'hplj-4' -D ps -q $hp -h $print
erip -x '9100'
# Change postscript to pass-through and AUTOMATIC detection from no to yes
/usr/lib/lpd/pio/etc/piochpq -q $hp -d 'hp@'${printerip} -d 'p' -a sD='+'
sleep 1
}
post2080()
# Function to add Postscript 300 queue on an LZR-2080 Printer
{
print -n "300dpi PostScript QueueName on LZR-2080 printer: "
read q300dpi
print -n "IP address of MidRange Printer: "
read printerip
print
mkque $def -q $q300dpi
#Changed header = group to header = never so header pages aren't printed -PLR
mkquedev -d vp$q300dpi -q $q300dpi -a "backend = /apps/dpc/bin/$q300dpi" -a "header = never" -a "trailer = never"
mkvirprt -d vp$q300dpi -n vp$q300dpi -q $q300dpi -s ps -t generic
chvirprt -d vp$q300dpi -q $q300dpi -a "_d=p"
chvirprt -d vp$q300dpi -q $q300dpi -a sD='+'
if [ -f /apps/dpc/bin/$q300dpi ]
then
print " $q300dpi already created"
else
print "#!/bin/sh" > /apps/dpc/bin/$q300dpi
print "/usr/lpd/piobe \$* | /apps/dpc/bin/dpprint $printerip job=\$\$ -p
c -text 3102" >> /apps/dpc/bin/$q300dpi
chmod 755 /apps/dpc/bin/$q300dpi
fi
print
print Added Print Queue $q300dpi
sleep 2
}
remoteq()
# Function to add remote printers
{
print -n "NAME of queue to add: "
read remq
print -n "DESTINATION HOST for remote jobs: "
read remhost
mkque -q$remq -a"up = "'TRUE' -a"host = "$remhost -a"s_statfilter = "'/usr/lpd/a
ixshort' -a"l_statfilter = "'/usr/lpd/aixlong' -a"rq = "$remq && mkquedev -q$rem
q -dd$remq -a"backend = "'/usr/lpd/rembak'
print
print Added Print Queue $remq
sleep 2
}
# Menu
PRINT_DONE=""
until [[ -n $PRINT_DONE ]]
do
clear
echo '
Adding Printer Queues
1) Networked HP Laserjet
2) Networked LZR-2080
3) Remote Printer
4) Exit
Please select one of the above (1-4): \c'
read CHOICE
echo
case "$CHOICE"
in
1) posthp;;
2) post2080;;
3) remoteq;;
4) PRINT_DONE="TRUE";;
*) echo "Invalid Choice - Try Again";sleep 2;;
esac
done # menu loop