Great Circle Associates Majordomo-Workers
(October 1997)
 

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

Subject: Patch to allow no-command subscribing & unsubscribing
From: David Gibbs <david @ midrange . com>
Date: Tue, 07 Oct 1997 18:47:27 -0500
To: Majordomo Users Mailing List <majordomo-users @ greatcircle . com>, majordomo-workers @ greatcircle . com

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



Follow-Ups:
Indexed By Date Previous: mj_shell manual page
From: Jason L Tibbitts III <tibbs@hpc.uh.edu>
Next: (Fwd) approve script
From: relph@mando.engr.sgi.com (John Relph)
Indexed By Thread Previous: mj_shell manual page
From: Jason L Tibbitts III <tibbs@hpc.uh.edu>
Next: Re: Patch to allow no-command zubscribing & unzubscribing
From: Jason L Tibbitts III <tibbs@hpc.uh.edu>

Google
 
Search Internet Search www.greatcircle.com