PPD assignment other then gui?

Rex Mueller rmueller at esu3.org
Wed Oct 1 07:35:26 PDT 2008


I built a script that converts my existing HP/UX ques to CUPS.

Is there a way without going into the gui to get the PPD assigned to the que/printer.. By default all my printers filter through RAW filter.

I've build a script to determine PPD name, but I'd like a suggestion on how to assign the PPD.

I want to build 4 ques/printers for each physical device, that is working in the hp2cups.sh script, What I've not figured out is how to assign the PPD file..
I am guessing I will have to pipe information from the chkppdname.sh into an lpadmin command, and then into the hp2cups.sh script.



Any thoughts appreciated..

Rex M - Educational Service Unit 3, Omaha, NE

---------------------------------------------------------------

# more chkppdname.sh
#!/bin/bash
echo "Enter the Brand of Printer"
read brand
echo "Enter the Printer Type (Desk, Laser, etc)"
read ptype
echo "Enter Model Number"
read modelnum
#lpinfo -m |grep $brand |grep $ptype |awk -F':' '{print $2}' |awk -F' ' '{print $1}' |grep $modelnum
export modelppd=`lpinfo -m |grep $brand |grep -v gimp| grep $ptype |awk -F':' '{print $2}' |awk -F' ' '{print $1}' |grep $modelnum |head -1`
echo $modelppd






# cat hp2cups.sh
##############################################
#!/bin/sh
for qname in `cat hp2quenames.txt|awk '{print $1}'`
         do
           export ipaddr=`grep "$qname" hp2quenames.txt|awk '{print $2}'`

outfile=$1
if [ -z "$outfile" ]
then
echo "USAGE: hp2cups <output file>"
exit 1
else
>> $outfile
fi



cat >> $outfile << EOF
<Printer $qname-port>
Info $qname-port
DeviceURI socket://$ipaddr:9100
Location
State Idle
Accepting Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
</Printer>
<Printer $qname-portcomp>
Info $qname-portcomp
DeviceURI socket://$ipaddr:9100
Location
State Idle
Accepting Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
Option cpi 17
Option lpi 8
</Printer>
<Printer $qname-land>
Info $qname-land
DeviceURI socket://$ipaddr:9100
Location
State Idle
Accepting Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
Option landscape True
</Printer>
<Printer $qname-landcomp>
Info $qname-landcomp
DeviceURI socket://$ipaddr:9100
Location
State Idle
Accepting Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
Option landscape True
Option cpi 17
Option lpi 8
</Printer>
EOF
done
#########################################





More information about the cups mailing list