[prev in list] [next in list] [prev in thread] [next in thread]
List: procmail
Subject: FW: UPDATED: passing variables to a perl script
From: Joel Dudley <Joel.Dudley () DevelopOnline ! com>
Date: 2000-11-27 16:52:48
[Download RAW message or body]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Ooops!! I sent out the wrong procmailrc in my previous post. Below
is the correct one. The last part has changed to reflect a call to
the perl script.
Ok,
Here is the perl script and procmailrc file I am using to pass
variables to. I am not really a perl programmer so I may have made a
fundamental mistake in my perl script.
begin .procmailrc
SHELL=/bin/sh
:0fbw
| sed 's/usazdolmon0//'
:0 B:
* ()\/ usaz[^ ]+
{ SERVER=$MATCH }
:0
* ^From:.*\/[^ ].*
{ FROM=$MATCH }
:0
| /home/netsaint/perlscript "$SERVER" "$FROM"
end .procmailrc
begin perl script
#!/usr/bin/perl -w
%techs = qw(
3232006599@pagenetmessage.net BlakeBarnette
3232013648@pagenetmessage.net JasonAmbrose
3232013566@pagenetmessage.net JoelDudley
3232003415@pagenetmessage.net HunterBennett
3232013866@pagenetmessage.net ShaneReutzel
3232013565@pagenetmessage.net TonyHamrick
);
$TIME = time;
$TECH = $techs{$FROM};
open(COMMAND,">/usr/local/netsaint/var/rw/netsaint.cmd") || die
"Can't create file";
print COMMAND "[$TIME]
ADD_HOST_COMMENT;$SERVER;0;$TECH;ACKNOWLEDGEMENT: $TECH has
acknowledged this problem";
close(COMMAND);
open(COMMAND,">>/usr/local/netsaint/var/rw/netsaint.cmd") || die
"Can't create file";
print COMMAND "[$TIME] ACKNOWLEDGE_HOST_PROBLEM;$SERVER;$TECH has
acknowledged this problem";
close(COMMAND);
end perl script
thanks for looking at my script!!
Joel Dudley
Unix System Administrator
DevelopOnline.com
- ----------------------------------------
"For the scientist who has lived by his faith in the power of reason,
the story ends like a bad dream. He has scaled the mountains of
ignorance; he is about to conquer the highest peak; as he pulls
himself over the final rock, he is greeted by a band of theologians
who have been sitting there for centuries."
- - Dr. Robert Jastrow, Founder Goddart Space Flight Institute
*** END PGP VERIFIED MESSAGE ***
-----BEGIN PGP SIGNATURE-----
Version: PGP 6.5.3
iQA/AwUBOiKCRL4SdmErPHWZEQIN0QCgskuiOivg6uJtBKrly3g5Zpu2XZQAoOyw
mVYje4t4CGIKibckP2IDt4+J
=o5an
-----END PGP SIGNATURE-----
_______________________________________________
procmail mailing list
procmail@lists.RWTH-Aachen.DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic