From owner-freebsd-questions Wed Apr 7 16:32:52 1999 Delivered-To: freebsd-questions@freebsd.org Received: from fir.calcasieu.com (fir.calcasieu.com [209.99.46.67]) by hub.freebsd.org (Postfix) with ESMTP id AD1A714CE4 for ; Wed, 7 Apr 1999 16:29:14 -0700 (PDT) (envelope-from sysop@calcasieu.com) Received: from cruft (cruft.austin.calcasieu.com [192.168.170.124]) by fir.calcasieu.com (8.8.8/8.8.8-2.0) with SMTP id SAA11388; Wed, 7 Apr 1999 18:27:13 -0500 (CDT) Message-Id: <3.0.5.32.19990407182715.008abc40@pop.calcasieu.com> X-Sender: sysop@pop.calcasieu.com X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Wed, 07 Apr 1999 18:27:15 -0500 To: "Milliken, Scott" From: Don Read Subject: Re: SMB Printing Cc: In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG back on 04:26 PM 4/7/99 -0400, you said: >Hi, > I'm trying to figure out just how to put an entry in /etc/printcap >so that I can print to a Samba shared printer. I have the input filter set >up and have had the printer working when hooked up locally, but I have a >need to print to some other printers that are attached to NT print queues >and do not have lpd running locally on the NT servers. Adding lpd is not an >option as we have territorial admins here that won't give access to admins >from other groups to do things like that. > It would seem that the logical way to approach this would be to have >the spooler print to a file, then pass that file name on to a script that >could call smbclient to attach to the printer, then execute a "print >filename" command. However, I'm not quite sure how to implement that. If >there is an FAQ that covers this, I'd certainly like to know where. I've >checked the FreeBSD handbook and the www.freebsd.org web pages to no avail. > Here's how I work it with W95 & W4W 3.1 "shared" printers shempdm|Debbie's Dot Matrix:\ :lp=/dev/null:sd=/var/spool/lpd/shemp:\ :if=/usr/share/samba/shemp_dm:lf=/var/log/lpd-errs:sh: and the script shemp_dm ----- #!/bin/sh # # edit this to show where your smbclient is smbcmd="/usr/local/bin/smbclient" server="" username="samba" hostname=`hostname` file="/var/tmp/$$" # # get the box & share name from the name of this script. _ # sname=`basename "$0"` server=`echo "$sname" |cut -d_ -f1` ptr=`echo "$sname" |cut -d_ -f2` cat - > $file printf "\f" >> $file echo print $file | $smbcmd "\\\\$server\\$ptr" -N -P -U $username rm $file ----- Regards, -- Don Read sysop@calcasieu.com EDP Manager dread@texas.net Calcasieu Lumber Co. Austin TX - The problem with people who have no vices is that you can be pretty sure they're going to have some pretty annoying virtues. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message