/usr/lib/news/bin/tally.unwanted is in inn 1:1.7.2q-45build2.
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 | #!/bin/sh
## $Revision: 1.8 $
## Tally/update the unwanted newsgroup log
## Read an innd log on stdin, scan it for articles that were unwanted
## because they newsgroups were not in our active file. Update unwanted.log
## to have the new count of unwanted groups, and how often they were used.
## =()<. @<_PATH_SHELLVARS>@>()=
. /usr/lib/news/innshellvars
PROGNAME=unwanted
LOCK=${LOCKS}/LOCK.${PROGNAME}
LOG=${MOST_LOGS}/unwanted.log
UNWANTED_NEW=${LOG}.new
UNWANTED_OLD=${LOG}.old
## Lock.
shlock -f ${LOCK} -p $$ || {
echo "$0: cannot lock $LOCK" 1>&2
exit 2
}
## Prepare the files.
if [ ! -f ${LOG} ]; then
touch ${LOG}
chmod 0660 ${LOG}
fi
rm -f ${UNWANTED_NEW} ${UNWANTED_OLD}
ln ${LOG} ${UNWANTED_OLD}
touch ${UNWANTED_NEW}
chmod 0660 ${UNWANTED_NEW}
## Grab the data.
${AWK} '$4 == "-" && $7 == "437" && $8 == "Unwanted" && $9 == "newsgroup" \
{ print }' \
| ${SED} 's/.* \([a-z]*\) "\(.*\)".*/\1 \2/' \
| sort \
| uniq -c \
| cat - ${LOG} \
| ${AWK} 'BEGIN {
unwanted[0]=0;
}
{
unwanted[$2 " " $3] += $1;
}
END {
for (group in unwanted) {
if (group != 0) {
print unwanted[group], group;
}
}
}' \
| sort -n -r >${UNWANTED_NEW}
mv -f ${UNWANTED_NEW} ${LOG}
## All done.
rm -f ${LOCK}
exit 0
|