Printer drivers upload from Windows2000 (samba 2.2.1a)
Pierre Burri
pierre at globeall.de
Tue Oct 9 01:44:01 GMT 2001
I have finally managed to upload drivers (PPD files for CUPS) from my win2k
to my samba server.
The bug was in my script addprinter. I had to add my printer admin group in
/etc/cups/cupsd.conf (SystemGroup xxxx), fetch the PPD file name from the
fourth APW parameter and then reload samba, using sudo for the necessary
privileges. After that it worked fine.
I thought it might help someone else if I gave the listing of my script, just
to give an idea:
#!/bin/sh
# Name: /usr/bin/addprinter
# Authors: Pierre Burri & Michel Bisson
# Date: 7-Oct-2001
# This script adds a CUPS printer (Postscript) from Windows2000 APW
# with Samba Version 2.2.1a. (APW = Add Printer Wizard)
#--------------------------------------------------------------------------
# Parameters given by the APW:
# $1 = printer name
# $2 = share name
# $3 = port name
# $4 = driver name
# $5 = location
# $6 = windows 9x driver location
#--------------------------------------------------------------------------
smb_pr_dir="/home/samba/printers"
addpr_log="$smb_pr_dir/addprinter.log"
print_port="parallel:/dev/lp0"
#
echo "----------------------" >> $addpr_log
echo "date : `date`" >> $addpr_log
echo "all parameters : 1=<$1> 2=<$2> 3=<$3> 4=<$4> 5=<$5> 6=<$6>" \
>> $addpr_log
# extract the PPD file name
driver=$(grep -lr "$4" $smb_pr_dir/W32X86 |head -1)
echo "driver name : <$driver>" >> $addpr_log
# add the printer to cups
/usr/sbin/lpadmin -p $2 -P $driver -L "$5" -v $print_port -E \
>> $addpr_log 2>>1&
# reload samba (with the SuSE Linux script)
sudo /etc/init.d/smb reload
sleep 3
Of course, this script doesn't work for all situations!
happy Samba, Pierre
--
Feel free to visit my Site! http://www.GlobeAll.de
Pierre Burri
Tel. +49 30 757 02 517
Fax: +49 30 757 02 518
More information about the samba-ntdom
mailing list