[987] | 1 | #!/bin/sh |
---|
| 2 | # |
---|
[993] | 3 | # PyKota |
---|
[987] | 4 | # |
---|
[993] | 5 | # PyKota : Print Quotas for CUPS and LPRng |
---|
| 6 | # |
---|
[2028] | 7 | # (c) 2003, 2004, 2005 Jerome Alet <alet@librelogiciel.com> |
---|
[993] | 8 | # This program is free software; you can redistribute it and/or modify |
---|
| 9 | # it under the terms of the GNU General Public License as published by |
---|
| 10 | # the Free Software Foundation; either version 2 of the License, or |
---|
| 11 | # (at your option) any later version. |
---|
| 12 | # |
---|
| 13 | # This program is distributed in the hope that it will be useful, |
---|
| 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 16 | # GNU General Public License for more details. |
---|
| 17 | # |
---|
| 18 | # You should have received a copy of the GNU General Public License |
---|
| 19 | # along with this program; if not, write to the Free Software |
---|
| 20 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. |
---|
| 21 | # |
---|
| 22 | # $Id$ |
---|
| 23 | # |
---|
| 24 | # |
---|
| 25 | # |
---|
| 26 | # This script was freely adapted and modified from the printquota project |
---|
| 27 | # http://printquota.sourceforge.net for inclusion into PyKota. |
---|
| 28 | # |
---|
[987] | 29 | # printquota (c) 2002-2003 Ahmet Ozturk & Cagatay Koksoy |
---|
| 30 | # printquota is distributed under the GNU General Public License |
---|
| 31 | # |
---|
[993] | 32 | # Usage : pagecount.sh <file.ps |
---|
[987] | 33 | # |
---|
| 34 | ( |
---|
[993] | 35 | (sed -n -e '/%!PS-Adobe-/,/\%\%EOF/p' | grep -E -v "/Duplex|PageSize") |
---|
[987] | 36 | echo currentdevice /PageCount gsgetdeviceprop == flush |
---|
| 37 | ) | gs -q -sDEVICE=bit -sOutputFile=/dev/null -r5 - | tail -1 |
---|