blob: 73e258873d042397b6ea1e031a62c8e87b61cb20 (
plain)
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
|
#!/bin/sh
#
# Mine list sizes from MailMan web interfaces
#
# * Must set environment variable FETCHMAIL_LIST_PASS to list admin password
project="fetchmail"
admin="http://lists.berlios.de/mailman/admin"
adminpw=$FETCHMAIL_LIST_PASS
list="$1"
if [ ! "$list" ]; then
echo "Usage: $0 list" 1>&2
exit 1
fi
case "$list" in
$project-*)
# already gave us the full name, e.g. fetchmail-announce
;;
*)
# only gave us the last part of the name, e.g. announce
list="$project-$list"
;;
esac
hexpw=`echo "$adminpw" | od -t x1 -w64 | sed -e 's/^[0-9]*//' -e '/^ *$/d' -e 's/ /%/g'`
umask 077
tmp="/tmp/$project-$list.listsize.$$"
# First get the login cookie...
curl -s -D "$tmp" "$admin/${list}?adminpw=$hexpw" >/dev/null
# Second gets the actual stat
curl -s -b "$tmp" "$admin/${list}/members" \
| sed -n '/.*>(\([0-9][0-9]*\) members total.*/s//\1/p'
rm -f "$tmp"
# end
|