]> andersk Git - moira.git/blobdiff - gen/letter.sh
1 real bug fix in arg passing, lots of DEBUGing messaages added
[moira.git] / gen / letter.sh
index e6e5e690d8c4d8f6bd03b8b8741f92272c89e480..f56f1239dee105277485c64d7874449f0338f4f9 100644 (file)
@@ -8,9 +8,10 @@
 # today's is appended to yesterday's and we continue working with that.
 
 PATH=/bin:/bin/athena:/usr/ucb:/usr/bin/athena:/usr/athena; export PATH
-printer=nil
+printer=linus
 newfile=/tmp/letter.out
 savefile=/u1/letter.save
+holdfile=/u1/letter.hold
 
 # These are not normally local, so may need to point somewhere else
 lpquota=lpquota
@@ -23,13 +24,20 @@ if [ "`echo $last | $colrm 1 4 | $colrm 7`" = \
        mv $newfile $savefile
 else
        if [ -s $savefile ]; then
+               if [ ! -f $holdfile ]; then
+                       (echo "Reg_extra letters failed to print yesterday"; \
+                       ls -l $savefile; \
+                       echo $last) | /bin/mail dbadmin thorne
+               fi
                cat $newfile >> $savefile
-               echo "Reg_extra letter printing error" | /bin/mail dbadmin
        else
                mv $newfile $savefile
        fi
 fi
+rm -f $holdfile
 
-$lpr -P$printer -h $savefile
+if [ "`$lpr -P$printer -h $savefile`"x = "Printer queue is disabled."x ]; then
+       touch $holdfile
+fi
 
 exit 0
This page took 0.033601 seconds and 4 git commands to generate.