[prev in list] [next in list] [prev in thread] [next in thread]
List: majordomo-workers
Subject: Patch to allow no-command subscribing & unsubscribing
From: David Gibbs <david () midrange ! com>
Date: 1997-10-07 23:47:27
[Download RAW message or body]
Folks:
Some time ago I posted a message asking for a way to create a no-command
subscribe & unsubscribe alias. This would allow folks to simply send a
message to an alias and be subscribed or unsubscribed without having to put
any commands in their messages.
Since there didn't appear to be a technique to do that, I decided to take
on MAJORDOMO myself :)
The following patch implements a new command line arg "-x" that allows you
to specify "subscribe" or "unsubscribe" on a majordomo alias.
You would use an alias similar to that of the -request, but add "-x
subscribe" or "-x unsubscribe" to the end (or beginning).
Here's a sample of my alias...
midrange-l-sub: "|/usr/local/majordomo-1.94/wrapper majordomo -l midrange-l
-x subscribe"
WARNING WARNING WARNING!!!
This patch was done primarily by trial-and-error... so I offer no
guarantees that it will actually work in your situation. PERL is *NOT* a
language that is easy to pick up... especially by a AS/400 programmer who's
used to working in RPG.
If you do use it, and it works, let me know. In addition, if you can come
up with a better way to do it, or a more solid way... let me know that too.
david
38a39,42
> } elsif ($ARGV[0] eq "-x") {
> $command = $ARGV[1];
> shift(@ARGV);
> shift(@ARGV);
164a169,180
> $commandsdone = 0;
>
> if($command eq "subscribe") {
> &do_subscribe();
> $count++;
> $commandsdone = 1;
> } elsif ($command eq "unsubscribe") {
> &do_unsubscribe();
> $count++;
> $commandsdone = 1;
> }
>
166a183,185
> if($commandsdone eq 1) {
> last;
> }
--
| Internet: david@midrange.com
| WWW: http://www.mcs.net/~gibbs
|
| ... A man can move mountains, a world can be turned,
| and the greatest of distances easily spanned,
| When the strength that's invested in making a fist
| is transformed into shaking a hand.
|
| - DMRoth
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic