Ein smbclient -L Host liefert bei mir u.a.:
Sharename Type Comment
--------- ---- -------
CS520 Printer
So nun habe ich in eine smbprint Konfigurationsdatei in der das steht:
#!/bin/sh -x
# This script is an input filter for printcap printing on a unix machine.
# It uses the smbclient program to print the file to the specified
# smb-based server and service.
# For example you could have a printcap entry like this
#
# smb:lp=/dev/null:sd=/usr/spool/smb:sh:if=/usr/local/samba/smbprint
#
# which would create a unix printer called "smb" that will print via
# this script. You will need to create the spool directory /usr/spool/smb
# with appropriate permissions and ownerships for your system.
# Set these to the server and service you wish to print to
# In this example I have a WfWg PC called "lapland" that has a printer
# exported called "printer" with no password.
#
# Script further altered by hamiltom(at)ecnz.co.nz (Michael Hamilton)
# so that the server, service, and password can be read from
# a /usr/var/spool/lpd/PRINTNAME/.config file.
#
# In order for this to work the /etc/printcap entry must include an
# accounting file (af=...):
#
# cdcolour:\
# :cm=CD IBM Colorjet on 6th:\
# :sd=/var/spool/lpd/cdcolour:\
# :af=/var/spool/lpd/cdcolour/acct:\
# :if=/usr/local/etc/smbprint:\
# :mx=0:\
# :lp=/dev/null:
#
# The /usr/var/spool/lpd/PRINTNAME/.config file should contain:
# server=PC_SERVER
# service=PR_SHARENAME
# password="password"
#
# E.g.
# server=PAULS_PC
# service=CJET_371
# password=""
#
# Debugging log file, change to /dev/null if you like.
#
logfile=/tmp/smb-print.log
# logfile=/dev/null
#
# The last parameter to the filter is the accounting file name.
#
spool_dir=/var/spool/lpd/lp
config_file=$spool_dir/.config
# Should read the following variables set in the config file:
# server
# service
# password
# user
eval `cat $config_file`
#
# Some debugging help, change the >> to > if you want to same space.
#
echo "server $server, service $service" >> $logfile
(
# NOTE You may wish to add the line `echo translate' if you want
# automatic CR/LF translation when printing.
echo translate
echo "print -"
cat
) | /usr/local/bin/smbclient
"\\\\$server\\$service" $password -U $user -N -P >> $logfile
In der /var/spool/lpd/lp/.config steht:
server=Ente
service=CS520
password=""
user=Standard
In /etc/printcap steht:
lp:\
:cm=CS520
:lp=/dev/lp1:\
:sd=/var/spool/lpd/lp:\
:af/var/spool/lpd/lp/acct:\
:mx#0:\
:if=/usr/bin/smbprint:
So die Dateien sollten zum Betrieb reichen, wenn ich aber mal das smbprint
Script starte kommt folgende Meldung:
+ \\Ente\CS520 -U -N -P
\\Ente\CS520: not found
Wieso findet der CS520 nicht? Laut smbclient -L Ente (siehe oben) existiert
diese Freigabe.
MfG
Torsten Krah
To Unsubscribe: send mail to majordomo(at)de.FreeBSD.org
with "unsubscribe de-bsd-questions" in the body of the message
Received on Sat 09 Nov 2002 - 00:34:16 CET