#!/bin/sh

BINPATH="/usr/local/mailman/bin"
TEMPATH="/var/tmp"
LISTE="aiuto esperti varie"
DUMP="list_members"
SYNC="sync_members"


for lista in $LISTE ; do
	$BINPATH/$DUMP -o $TEMPATH/lista-$lista $lista
done

cat $TEMPATH/lista-* > $TEMPATH/annunci.tmp
sort $TEMPATH/annunci.tmp | uniq > $TEMPATH/annunci

(
echo "To: Mailman Admin <mailman@gufi.org>"
echo "From: Cris <cris@gufi.org>"
echo "Subject: sync lista annunci"
echo ""
$BINPATH/$SYNC -w=no -a=no -f $TEMPATH/annunci annunci
echo ""
) | 2>&1 /usr/sbin/sendmail -fcris -oi gufi@gufi.org

