mirror of
https://github.com/samba-team/samba.git
synced 2025-02-02 09:47:23 +03:00
Try to make smbprint a better behaved citizen.
Removed a -x on the first line that causes lots of output to the console and added a command line parameter handling flag for the tranlate case. The problem is that smbprint is being overwritten/replaced when you upgrade a RedHat rpm. If you had modified smbprint to include translation, you loose it, and you have to go and repatch etc. Now, we have a -t flag on smbprint, so we should have fewer problems in this regard. Untested as yet, but soon will be ...
This commit is contained in:
parent
b0af7cfd9d
commit
4e2f5c625e
@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh -x
|
#!/bin/sh
|
||||||
|
|
||||||
# This script is an input filter for printcap printing on a unix machine. It
|
# 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
|
# uses the smbclient program to print the file to the specified smb-based
|
||||||
@ -20,6 +20,11 @@
|
|||||||
# so that the server, service, and password can be read from
|
# so that the server, service, and password can be read from
|
||||||
# a /usr/var/spool/lpd/PRINTNAME/.config file.
|
# a /usr/var/spool/lpd/PRINTNAME/.config file.
|
||||||
#
|
#
|
||||||
|
# Script further modified by Richard Sharpe to fix some things.
|
||||||
|
# Get rid of the -x on the first line, and add parameters
|
||||||
|
#
|
||||||
|
# -t now causes translate to be used when sending files
|
||||||
|
#
|
||||||
# In order for this to work the /etc/printcap entry must include an
|
# In order for this to work the /etc/printcap entry must include an
|
||||||
# accounting file (af=...):
|
# accounting file (af=...):
|
||||||
#
|
#
|
||||||
@ -53,6 +58,7 @@ logfile=/tmp/smb-print.log
|
|||||||
# Extract the directory name from the file name.
|
# Extract the directory name from the file name.
|
||||||
# Concat this with /.config to get the config file.
|
# Concat this with /.config to get the config file.
|
||||||
#
|
#
|
||||||
|
TRANS=0
|
||||||
eval acct_file=\${$#}
|
eval acct_file=\${$#}
|
||||||
spool_dir=`dirname $acct_file`
|
spool_dir=`dirname $acct_file`
|
||||||
config_file=$spool_dir/.config
|
config_file=$spool_dir/.config
|
||||||
@ -63,6 +69,16 @@ config_file=$spool_dir/.config
|
|||||||
# password
|
# password
|
||||||
eval `cat $config_file`
|
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.
|
# Some debugging help, change the >> to > if you want to same space.
|
||||||
#
|
#
|
||||||
@ -71,7 +87,9 @@ echo "server $server, service $service" >> $logfile
|
|||||||
(
|
(
|
||||||
# NOTE You may wish to add the line `echo translate' if you want automatic
|
# NOTE You may wish to add the line `echo translate' if you want automatic
|
||||||
# CR/LF translation when printing.
|
# CR/LF translation when printing.
|
||||||
# echo translate
|
if [ $TRANS ]; then
|
||||||
|
echo translate
|
||||||
|
fi
|
||||||
echo "print -"
|
echo "print -"
|
||||||
cat
|
cat
|
||||||
) | /usr/local/samba/bin/smbclient "\\\\$server\\$service" $password -U $server -N -P >> $logfile
|
) | /usr/local/samba/bin/smbclient "\\\\$server\\$service" $password -U $server -N -P >> $logfile
|
||||||
|
Loading…
x
Reference in New Issue
Block a user