chiark / gitweb /
Make noack honoured for approvals too
[modbot-mtm.git] / stump / bin / report.sh
1 #!/bin/bash
2 # posts a nice report
3 #
4 # $Id: report.sh,v 1.2 2007/05/03 23:47:49 rram Exp $
5 # Modified to work with GPG
6
7 set -e
8 set -o pipefail
9
10 TODAY="`date`"
11 DATE6="`date +%y%m%d`"
12
13 LOGFILE="$HOME/Mail/from"
14 LOGFILE_ARCHIVED="$MNG_ROOT/archive/old/from.$DATE6"
15
16 Report() {
17   echo Subject: $NEWSGROUP report for $TODAY
18   echo Newsgroups: $NEWSGROUP
19   echo To: $SUBMIT
20   echo From: $ADMIN
21   echo Reply-To: $ADMIN
22   echo Organization: CrYpToRoBoMoDeRaToR CaBaL
23   echo ""
24
25 (
26   echo Subject: $NEWSGROUP report for $TODAY
27   echo Newsgroups: $NEWSGROUP
28   echo Date: $TODAY
29   echo ""
30
31 cat << _EOB_
32 This is an automated report about activity of our newsgroup
33 $NEWSGROUP. It covers period between the 
34 previous report and the current one, ending 
35 on $TODAY.
36
37 Note that we do not report the number of articles cancelled
38 after they got approved, because the cancellations are done
39 manually. Typically messages get cancelled by requests of
40 posters themselves.
41
42 Lastly, the statistics below are skewed towards higher numbers because
43 there are always some test messages from moderators themselves who
44 approve and reject them to make sure that our robomoderator functions
45 properly.
46
47 _EOB_
48
49   stump-report.pl $LOGFILE
50 ) | stump-pgp --clearsign --textmode --armor --batch --user $PMUSER_APPROVAL --passphrase "$PMPASSWORD" 2>/dev/null
51 }
52
53 Report | sendmail -t
54
55 mv $LOGFILE $LOGFILE_ARCHIVED
56 gzip -9 $LOGFILE_ARCHIVED &