]> andersk Git - moira.git/blame - gen/letter.sh
include in ../lib; punt dependancies
[moira.git] / gen / letter.sh
CommitLineData
78c00fd3 1#!/bin/sh
2# $Header$
3# This script prints the letters confirming registration for the extra
4# kerberos principal.
5
6# The algorithm consists of first checking to see that the previous
7# day's job printed. If so, the cached copy is deleted. Otherwise,
8# today's is appended to yesterday's and we continue working with that.
9
10PATH=/bin:/bin/athena:/usr/ucb:/usr/bin/athena:/usr/athena; export PATH
dd03c300 11printer=linus
78c00fd3 12newfile=/tmp/letter.out
13savefile=/u1/letter.save
14
15# These are not normally local, so may need to point somewhere else
16lpquota=lpquota
17lpr=lpr
18colrm=colrm
19
20last=`$lpquota -l | tail -2`
21if [ "`echo $last | $colrm 1 4 | $colrm 7`" = \
22 "`ls -l $savefile | $colrm 1 32 | $colrm 7`" ]; then
23 mv $newfile $savefile
24else
0102b2e6 25 if [ -s $savefile ]; then
26 cat $newfile >> $savefile
27 echo "Reg_extra letter printing error" | /bin/mail dbadmin
28 else
29 mv $newfile $savefile
30 fi
78c00fd3 31fi
32
33$lpr -P$printer -h $savefile
34
35exit 0
This page took 0.056981 seconds and 5 git commands to generate.