Great Circle Associates Majordomo-Users
(November 1997)
 

Indexed By Date: [Previous] [Next] Indexed By Thread: [Previous] [Next]

Subject: Global unsub?
From: bill @ ecology . bio . dfo . ca (Bill Silvert)
Date: Thu, 30 Oct 1997 10:26:04 -0400 (AST)
To: Majordomo-Users @ GreatCircle . COM (Majordomo Users)

Forwarded message:
>From: Thomas Gramstad <thomasg@ifi.uio.no>
>Subject: Global unsub?
>
>I know that a zubscriber can unzub themself from all the lists at a
>site with the unzubscribe * command.  But can I unzub a given
>zubscriber from all lists with one command?

I don't think that MD supports this, but I use the following shell
script and it is very handy. Note that for each list it actually finds
the password. You must of course run this from an account that has read
access on the password files.

Bill

#!/bin/sh
# Unsubscribe the arguments from all lists
PROG=`basename $0`
DIR=/.../majordomo/Lists
EXCLUDE=test
PROCESS="Mail lists"
ACTION=unsubscribe
OPTIONS=
if [ $OPTIONS ]
then
	USAGE="Usage: $PROG [-$OPTIONS] name [...]"
else
	USAGE="Usage: $PROG name [...]"
fi
while getopts h$OPTIONS x
do
	case $x in
	h|\?)	echo "$USAGE"
		echo "unsubscribe all arguments from all lists"
		echo "\t$PROG -D\tDebug"
		exit 1 ;;
	*)	echo "$USAGE" ; exit 1 ;;
	esac
done
shift `expr $OPTIND - 1`

case $# in
0)	echo "Nothing done"
	echo "$USAGE"
	exit 1 ;;
*)
	cd $DIR
	FILES=`\ls | grep -v '\.' | grep -v $EXCLUDE`
	(
	for i
	do
		for L in `grep -i -l $i $FILES`
		do
			PASSWORD=`cat $L.passwd`
			echo "approve $PASSWORD $ACTION $L $i"
		done
	done
	echo end
	) | $PROCESS
	;;
esac
exit 0


-- 
Bill Silvert, Habitat Ecology Section, Bedford Institute of Oceanography,
P. O. Box 1006, Dartmouth, Nova Scotia, CANADA B2Y 4A2, Tel. (902)426-1577


Indexed By Date Previous: Admin request of type /\bsubscribe\b/i at line 1
From: "David Webster, MHP" <dwebster@webster-maximum.com>
Next: [no subject]
From: trace_radler@graphatl.com (Trace Radler)
Indexed By Thread Previous: Re: Admin request of type /\bsubscribe\b/i at line 1
From: Jason L Tibbitts III <tibbs@hpc.uh.edu>
Next: [no subject]
From: trace_radler@graphatl.com (Trace Radler)

Google
 
Search Internet Search www.greatcircle.com