[571] | 1 | # $Id$ |
---|
| 2 | # |
---|
[576] | 3 | # Tea4CUPS : Tee for CUPS |
---|
[571] | 4 | # |
---|
| 5 | # This program is free software; you can redistribute it and/or modify |
---|
| 6 | # it under the terms of the GNU General Public License as published by |
---|
| 7 | # the Free Software Foundation; either version 2 of the License, or |
---|
| 8 | # (at your option) any later version. |
---|
| 9 | # |
---|
| 10 | # This program is distributed in the hope that it will be useful, |
---|
| 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 13 | # GNU General Public License for more details. |
---|
| 14 | # |
---|
| 15 | # You should have received a copy of the GNU General Public License |
---|
| 16 | # along with this program; if not, write to the Free Software |
---|
| 17 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. |
---|
| 18 | # |
---|
| 19 | # |
---|
[577] | 20 | |
---|
| 21 | # First we set all top-level directives in the [global] section |
---|
[571] | 22 | [global] |
---|
[577] | 23 | |
---|
| 24 | # Should we log debugging information to CUPS' error_log file ? |
---|
| 25 | # defaults to No if unset. |
---|
[571] | 26 | debug : yes |
---|
[577] | 27 | |
---|
[580] | 28 | # In which directory will we create our files ? It must already exist ! |
---|
[577] | 29 | # This directive MUST be present since there's no sane default value. |
---|
[580] | 30 | # Can be set either in the [global] section or any print queue section. |
---|
| 31 | # The value defined in a print queue section takes precedence over the |
---|
| 32 | # value defined in the [global] section. |
---|
[577] | 33 | directory : /var/spool/cups/ |
---|
| 34 | |
---|
| 35 | # Should Tea4CUPS keep the files it creates once all tees have ended ? |
---|
[580] | 36 | # Defaults to No if unset, meaning that files are automatically deleted |
---|
| 37 | # once all tees have ended. |
---|
| 38 | # Can be set either in the [global] section or any print queue section. |
---|
| 39 | # The value defined in a print queue section takes precedence over the |
---|
| 40 | # value defined in the [global] section. |
---|
[577] | 41 | # BEWARE : this may use huge amounts of disk space ! |
---|
[580] | 42 | # keepfiles : yes |
---|
[577] | 43 | |
---|
[580] | 44 | # Should we serialize the launch of all tees : launch one tee after |
---|
| 45 | # the other to save some system resources. |
---|
| 46 | # Defaults to No if unset, meaning that all tees are launched in |
---|
| 47 | # parallel. |
---|
| 48 | # Can be set either in the [global] section or any print queue section. |
---|
| 49 | # The value defined in a print queue section takes precedence over the |
---|
| 50 | # value defined in the [global] section. |
---|
| 51 | # serialize : yes |
---|
| 52 | |
---|
[577] | 53 | # When executing the contents of a tee directive, tea4cups makes |
---|
| 54 | # the following environment variables available to your own commands : |
---|
| 55 | # |
---|
[580] | 56 | # TEAPRINTERNAME : The print queue name. |
---|
| 57 | # TEADIRECTORY : Tea4CUPS output directory. |
---|
| 58 | # TEADATAFILE : Full name of Tea4CUPS work file (in $TEADIRECTORY). |
---|
| 59 | # TEAJOBSIZE : Job's size in bytes. |
---|
| 60 | # TEAMD5SUM : MD5 sum of the job's datas. |
---|
| 61 | # TEACLIENTHOST : Client's hostname or IP address. |
---|
| 62 | # TEAJOBID : Job's Id. |
---|
| 63 | # TEAUSERNAME : Name of the user who launched the print job. |
---|
| 64 | # TEATITLE : Job's title. |
---|
| 65 | # TEACOPIES : Number of copies requested. |
---|
| 66 | # TEAOPTIONS : Options of the print job. |
---|
| 67 | # TEAINPUTFILE : Print job's data file or empty when job read from stdin. |
---|
[577] | 68 | # |
---|
| 69 | # Your own commands will mostly be interested in TEADATAFILE which is |
---|
| 70 | # the name of the file from which your commands may extract the final |
---|
| 71 | # job's datas. |
---|
| 72 | |
---|
| 73 | # Now defines some default tees which will always be launched |
---|
[578] | 74 | # The tee names are completely free BUT THEY MUST BEGIN WITH 'tee_' |
---|
| 75 | # |
---|
[580] | 76 | # These are just some stupid examples. |
---|
| 77 | #tee_0 : cat $TEADATAFILE >/tmp/$TEAJOBID.prn |
---|
| 78 | #tee_pdf : cat $TEADATAFILE | su -c "lp -dPDFGen" $TEAUSERNAME |
---|
[571] | 79 | |
---|
| 80 | # Sample section for print queue HP2100 |
---|
| 81 | # Uncomment and adapt to your needs. |
---|
| 82 | # |
---|
[580] | 83 | #[HP2100] |
---|
[571] | 84 | # |
---|
[580] | 85 | # By using a same tee name as in the [global] section, the new |
---|
| 86 | # value takes precedence |
---|
| 87 | #tee_0 : cat $TEADATAFILE >~$TEAUSERNAME/savejobs/$TEAJOBID.prn |
---|
| 88 | # An empty value deletes a value defined in the [global] section |
---|
| 89 | # so this particular tee doesn't get executed. |
---|
| 90 | #tee_pdf : |
---|
| 91 | # A reflector which produces 4 copies each time : |
---|
| 92 | #tee_4copies : lp -dotherprinter -n4 $CUPSDATAFILE |
---|
[581] | 93 | # A simple accounting mechanism |
---|
| 94 | #tee_accounting : echo $TEAPRINTERNAME $TEAJOBID $TEAUSERNAME `pkpgcounter $TEADATAFILE` >/var/log/printaccounting.log |
---|