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