Linux 14.988 Themen, 106.435 Beiträge

smbprint: Nutzung eines Windows-Druckers

samson / 1 Antworten / Flachansicht Nickles

Hallo,

Ich möchte einen Drucker an einem Windoewsrechner ansprechen.

dazu habe ich laut Anleitung ...samba-doc/htmldocs/using_samba/ch07_02.html
1) eine printcap

# /etc/printcap was generated by HAND
#
lp:\
:sd=/var/spool/lpd/lp:\ # spool directory
:mx#0:\ # maximum file size (none)
:sh:\ # surpress burst header (no)
:if=/usr/share/doc/samba-doc/examples/examples/printing/smbprint: # text filter

2) eine .config

less /var/spool/lpd/lp/.config

server=Katrin
service=HPLJ4
password=""

3) eine smbprint

less /usr/share/doc/samba-doc/examples/examples/printing/smbprint
#!/bin/sh

#
# a /usr/var/spool/lpd/PRINTNAME/.config file.
#


logfile=/tmp/smb-print.log
# logfile=/dev/null


#
# The last parameter to the filter is the accounting file name.
# Extract the directory name from the file name.
# Concat this with /.config to get the config file.
#


logfile=/tmp/smb-print.log
# logfile=/dev/null


#
# The last parameter to the filter is the accounting file name.
# Extract the directory name from the file name.
# Concat this with /.config to get the config file.
#

TRANS=0
eval acct_file=\${$#}
# spool_dir=`dirname $acct_file`
spool_dir=/var/spool/lpd/lp
config_file=$spool_dir/.config

# Should read the following variables set in the config file:
# server
# service
# password
eval `cat $config_file`

while getopts t c; do
case $c in
t)
TRANS=1
;;

'?') # Bad parameters, ignore it ...
;;
esac
done
#
# 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.
if [ $TRANS -eq 1 ]; then
echo translate
fi
echo "print -"
cat
) | /usr/bin/smbclient "\\\\$server\\$service" $password -U $server -N -P >> $logfile

erstellt.

Der Versuch zu Drucken
> lp RELNOTES
request id is ernst@aal+593
>

Was tun ?

bei Antwort benachrichtigen