: Hi all... We have a small office setup here and our printer is hooked
: up to a system running Win95. The server is running Samba for file
: sharing... I don't know if that matters though. I would like to print
: from my Linux system (not the same system as the server) to the Windows
: printer. Is this possible? Can anyone point me to where to look for
: information on doing this?
I have, in a setup of my own, HP-laserjet connected into an NT-box. I
think you can use it as a guideline for yours.
My NT is machine called 'NSRLSLC6' in our LAN. I have that printer shared
there as 'HP_4M+'. In my Linux box I have printcap entry for it like this:
HP:\
:lp=/dev/null:\
:sd=/usr/spool/HP_4M+:\
:sh:\
:mx#0:\
:ff:\
:if=/usr/local/sbin/smbprint:
-----------------------------------------------
My /usr/local/sbin/smbprint is like this:
#!/bin/sh -x
logfile=/tmp/smb-print.log
eval acct_file=\$$#
spool_dir=`dirname $acct_file`
config_file=$spool_dir/.config
# Should read the following variables set in the config file:
# server
# service
# password
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/bin/smbclient "\\\\$server\\$service" $password -U $server -N -P
Quote:>> $logfile
--------------------------------------------
And finally my /var/spool/HP_4M+/.config is:
server=NSRLSLC6
service=HP_4M+
password=""
--------------------------------------------
That's it!
In Linux, when I'm printing, I just command 'lpr -PHP <filename>'.
Smbprint file was derived from sample file accompanied with samba
-package. Works like charm if only NT is up and running!
--
Kalevi J Hautaniemi, Marjatankatu 12, 33730 Tampere, FINLAND.
**** http://oh3tr.ele.tut.fi/~oh3fg/ **** On air: OH3FG, KO4BC ****
tel:+358-3-364-7446 fax:+358-3-364-2476 mobile:+358-50-590-2243