| 1 |
#!@SHELL@ |
| 2 |
# Patrick Powell Sun Sep 3 11:23:22 PDT 1995 |
| 3 |
# LPRng |
| 4 |
#= File: = |
| 5 |
#= accounting.sh = |
| 6 |
#= = |
| 7 |
#= Synopsis: = |
| 8 |
#This program is called at the completion of printing a job by the OF |
| 9 |
#filter. The accounting file will hold information about the |
| 10 |
#completion of a job. The accounting file will have the following |
| 11 |
#format: |
| 12 |
# |
| 13 |
#start -qpid -kcontrolfile -nlogin -hhost -Pprinter \ |
| 14 |
# -ppagecounter -Fformt -Ttime |
| 15 |
#end -bpages -qpid -kcontrolfile -nlogin -hhost -Pprinter \ |
| 16 |
# -ppagecounter -Ffmt -Ttime |
| 17 |
# |
| 18 |
#The accounting program will be called with the following parameters |
| 19 |
# |
| 20 |
#program -bpages -qpid -kcontrolfile \ |
| 21 |
# -nlogin -hhost -Pprinter -ppagecounter -Fformt '-Ttime' accoutingfile |
| 22 |
|
| 23 |
PATH=/bin:/usr/bin:/usr/local/bin |
| 24 |
export PATH |
| 25 |
|
| 26 |
pages= |
| 27 |
pid= |
| 28 |
controlfile= |
| 29 |
login= |
| 30 |
host= |
| 31 |
printer= |
| 32 |
pagecounter= |
| 33 |
format= |
| 34 |
elapsed= |
| 35 |
time= |
| 36 |
accountingfile= |
| 37 |
|
| 38 |
echo $0 $* 1>&2 |
| 39 |
|
| 40 |
while [ $# != 0 ]; |
| 41 |
do case "$1" in |
| 42 |
-b* ) pages=`echo "$1" | sed s/..//` ;; |
| 43 |
-q* ) pid=`echo "$1" | sed s/..//` ;; |
| 44 |
-k* ) controlfile=`echo "$1" | sed s/..//` ;; |
| 45 |
-n* ) login=`echo "$1" | sed s/..//` ;; |
| 46 |
-h* ) host=`echo "$1" | sed s/..//` ;; |
| 47 |
-P* ) printer=`echo "$1" | sed s/..//` ;; |
| 48 |
-p* ) pagecounter=`echo "$1" | sed s/..//` ;; |
| 49 |
-F* ) format=`echo "$1" | sed s/..//` ;; |
| 50 |
-Z* ) zoption=`echo "$1" | sed s/..//'`;; |
| 51 |
-T* ) time=`echo "$1" | sed 's/..//'` ;; |
| 52 |
-* ) ;; |
| 53 |
* ) accountingfile=$1;; |
| 54 |
esac; |
| 55 |
shift; |
| 56 |
done |
| 57 |
echo Dummy Accounting Script pagecount=\'$pages\' pagecounter=\'$pagecounter\' 1>&2 |