From 49b630f8ea30b7a5066f87b16b42cffec00a7bef Mon Sep 17 00:00:00 2001 From: Rob Funk Date: Fri, 18 Jun 2004 06:55:28 +0000 Subject: Start converting release scripts over to new environment svn path=/trunk/; revision=3894 --- listsize | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) (limited to 'listsize') diff --git a/listsize b/listsize index e677fd7a..73e25887 100755 --- a/listsize +++ b/listsize @@ -1,15 +1,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 -admin="http://lists.ccil.org/mailman/admin" list="$1" -tmp="/usr/tmp/listsize.$$" +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/fetchmail-${list}?adminpw=mypaswrd >/dev/null +curl -s -D "$tmp" "$admin/${list}?adminpw=$hexpw" >/dev/null # Second gets the actual stat -curl -s -b $tmp $admin/fetchmail-${list}/members \ - | sed -n '/.*>\([0-9][0-9]*\) members total.*/s//\1/p' +curl -s -b "$tmp" "$admin/${list}/members" \ + | sed -n '/.*>(\([0-9][0-9]*\) members total.*/s//\1/p' +rm -f "$tmp" # end -- cgit v1.2.3