/usr/lib/news/bin/tally.control is in inn2 2.6.1-4build1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | #! /bin/sh
. /usr/lib/news/innshellvars
## $Id: tally.control.in 7658 2007-08-26 08:20:53Z iulius $
##
## Tally and update the newgroup/rmgroup control logs.
##
## Merge in a log that contains newgroup/rmgroup control messages so that
## the "control.log" file is updated to contain the new counts of how
## often each group has been newgroup'd or rmgroup'd. This is run by
## scanlogs, which prepares this from the control-message handlers if
## control.ctl specifies logging.
CONTROL=${MOST_LOGS}/control.log
CONTROL_NEW=${CONTROL}.new
CONTROL_OLD=${CONTROL}.old
PROGNAME=`basename $0`
LOCK=${LOCKS}/LOCK.${PROGNAME}
## Lock.
trap 'rm -f ${LOCK} ; exit 1' 1 2 3 15
shlock -f ${LOCK} -p $$ || {
echo "$0: cannot lock ${LOCK}" 1>&2
exit 1
}
## Prepare the files.
if [ ! -f ${CONTROL} ]; then
touch ${CONTROL}
chmod 0660 ${CONTROL}
fi
rm -f ${CONTROL_NEW} ${CONTROL_OLD}
ln ${CONTROL} ${CONTROL_OLD}
touch ${CONTROL_NEW}
chmod 0660 ${CONTROL_NEW}
## Grab the data.
${SED} -n -e 's/[ ][ ]*/ /g' -e 's/^ \(Control:.*\)$/1 \1/p' \
| cat - ${CONTROL} \
| ${SED} -e 's/ /#/g' -e 's/\([0-9][0-9]*\)#\(.*\)/\1 \2/' \
| ${AWK} 'BEGIN {
ctl[0]=0;
}
{
ctl[$2] += $1;
}
END {
for (line in ctl) {
if (line != 0) {
print ctl[line], line;
}
}
}' \
| tr '#' ' ' \
| sort -n -r >${CONTROL_NEW}
mv -f ${CONTROL_NEW} ${CONTROL}
## All done.
rm -f ${LOCK}
exit 0
|