s4:dsdb: Fix not freed temp memory context
[Samba.git] / packaging / SGI / smbprint
blob07923a42b1e3a07110bb857d181d1b51d8109f0a
1 #!/bin/sh
3 # @(#) smbprint.sysv version 1.0 Ross Wakelin <r.wakelin@march.co.uk>
5 # Version 1.0 13 January 1995
6 # modified from the original smbprint (bsd) script
8 # this script is a System 5 printer interface script. It uses the smbclient
9 # program to print the file to the specified smb-based server and service.
11 # To add this to your lp system, modify the server and service variables
12 # and then execute the following command (as root):
14 # lpadmin -punixprintername -v/dev/null -i/usr/samba/bin/smbprint
16 # where unixprintername is the name that the printer will be known as
17 # on your unix box.
19 # the script smbprint will be copied into your printer administration
20 # directory (/usr/spool/lp) as a new interface (interface/unixprintername)
21 # Then you have to execute the following commands:
23 # enable unixprintername
24 # accept unixprintername
26 # This script will then be called by the lp service to print the files.
27 # This script will have 6 or more parameters passed to it by the lp service.
28 # The first five will contain details of the print job, who queued it etc,
29 # while parameters 6 onwards are a list of files to print. We just
30 # cat these to the samba client.
32 # clear out the unwanted parameters
34 shift;shift;shift;shift;shift
36 # now the argument list is just the files to print
38 # Set these to the server and service you wish to print to
39 # In this example I have a PC called "admin" that has a printer
40 # exported called "hplj2" with no password.
42 server=admin
43 service=hplj2
44 password=""
46 # NOTE: The line `echo translate' provides automatic CR/LF translation
47 # when printing.
49 echo translate
50 echo "print -"
51 cat $*
52 ) | /usr/samba/bin/smbclient "//$server/$service" $password -N > /dev/null
53 exit $?