1 --- samba-pre2.0.7/packaging/RedHat/smbprint.foo Mon Nov 16 13:44:11 1998
2 +++ samba-pre2.0.7/packaging/RedHat/smbprint Tue Feb 1 23:04:21 2000
6 # This script is an input filter for printcap printing on a unix machine. It
7 # uses the smbclient program to print the file to the specified smb-based
11 # Script further altered by hamiltom@ecnz.co.nz (Michael Hamilton)
12 # so that the server, service, and password can be read from
13 -# a /var/spool/lpd/PRINTNAME/.config file.
14 +# a /usr/var/spool/lpd/PRINTNAME/.config file.
16 # In order for this to work the /etc/printcap entry must include an
17 # accounting file (af=...):
21 # The /usr/var/spool/lpd/PRINTNAME/.config file should contain:
23 -# service=PR_SHARENAME
31 +# Please, do not modify the order in the file.
33 +# share=\\server\deskjet
38 -# Debugging log file, change to /dev/null if you like.
40 -# logfile=/tmp/smb-print.log
45 # The last parameter to the filter is the accounting file name.
46 # Extract the directory name from the file name.
47 # Concat this with /.config to get the config file.
49 -eval acct_file=\${$#}
51 spool_dir=`dirname $acct_file`
52 config_file=$spool_dir/.config
54 # Should read the following variables set in the config file:
62 eval `cat $config_file`
65 -# Some debugging help, change the >> to > if you want to same space.
67 -echo "server $server, service $service" >> $logfile
68 +share=`echo $share | sed "s/[\]/\//g"`
71 -# NOTE You may wish to add the line `echo translate' if you want automatic
72 -# CR/LF translation when printing.
76 -) | /usr/bin/smbclient "\\\\$server\\$service" $password -U $server -N -P >> $logfile
77 +if [ "$user" != "" ]; then
83 +if [ "$workgroup" != "" ]; then
89 +if [ "$translate" = "yes" ]; then
90 + command="translate ; print -"
94 +#echo $share $password $translate $x_command > /tmp/smbprint.log
96 +cat | /usr/bin/smbclient "$share" "$password" -E ${hostip:+-I} \
97 + $hostip -N -P $usercmd "$user" $workgroupcmd "$workgroup" \
98 + -c "$command" 2>/dev/null