Revision 1706, 1.2 kB
(checked in by jalet, 20 years ago)
|
Small addition to catch SIGTERM. Doesn't currently help, though, so needs
more work.
|
-
Property svn:eol-style set to
native
-
Property svn:executable set to
*
-
Property svn:keywords set to
Author Date Id Revision
|
Rev | Line | |
---|
[1095] | 1 | #! /bin/sh |
---|
| 2 | # |
---|
| 3 | # PyKota - Print Quotas for CUPS and LPRng |
---|
| 4 | # |
---|
[1257] | 5 | # (c) 2003-2004 Jerome Alet <alet@librelogiciel.com> |
---|
[1095] | 6 | # You're welcome to redistribute this software under the |
---|
| 7 | # terms of the GNU General Public Licence version 2.0 |
---|
| 8 | # or, at your option, any higher version. |
---|
| 9 | # |
---|
| 10 | # You can read the complete GNU GPL in the file COPYING |
---|
| 11 | # which should come along with this software, or visit |
---|
| 12 | # the Free Software Foundation's WEB site http://www.fsf.org |
---|
| 13 | # |
---|
| 14 | # $Id$ |
---|
| 15 | # |
---|
[1398] | 16 | # Fix by Matt Hyclak & Jerome Alet |
---|
| 17 | |
---|
[1706] | 18 | trap "KILLED=1" TERM |
---|
| 19 | |
---|
[1398] | 20 | # If ending phase, after the job has been fully transmitted to the printer |
---|
| 21 | # we have to wait for the printer being in printing mode before checking |
---|
| 22 | # if it is idle, otherwise we could have problems with slow printers. |
---|
[1527] | 23 | PATH=$PATH:/bin:/usr/bin:/usr/local/bin:/opt/bin |
---|
[1528] | 24 | if [ x$PYKOTAACTION != "xDENY" ] && [ x$PYKOTAPHASE = "xAFTER" ] ; then |
---|
[1398] | 25 | until snmpget -v1 -c public -Ov $1 HOST-RESOURCES-MIB::hrPrinterStatus.1 | grep -i printing >/dev/null; do |
---|
[1706] | 26 | if [ "$KILLED" = 1 ]; then |
---|
| 27 | break ; |
---|
| 28 | fi |
---|
| 29 | sleep 1 ; |
---|
[1398] | 30 | done |
---|
| 31 | fi |
---|
| 32 | |
---|
| 33 | # In any case, wait until the printer is idle again. |
---|
[1656] | 34 | until snmpget -v1 -c public -Ov $1 HOST-RESOURCES-MIB::hrPrinterStatus.1 | grep -i idle >/dev/null ; do |
---|
[1706] | 35 | if [ "$KILLED" = 1 ]; then |
---|
| 36 | break ; |
---|
| 37 | fi |
---|
[1398] | 38 | sleep 1 ; |
---|
[1095] | 39 | done |
---|