email-based shell executing script?

email-based shell executing script?

Post by josepha » Tue, 30 Apr 2002 07:28:43



Is it possible to kick off a UNIX script based on the contents of an
email address to a specific account on an HP-UX or Solaris 2.7 box?
I'd like to email "coded" messages to a specific account and have it
run scripts based on the content of the coded message and email the
results of the scripts back to my cell phone.  Anyone ever seen a
script that does this?  Is it even possible?

Any ideas or help would be appreciated.

Joey

 
 
 

email-based shell executing script?

Post by JTW Internet Service » Tue, 30 Apr 2002 09:38:40




Quote:> Is it possible to kick off a UNIX script based on the contents of an
> email address to a specific account on an HP-UX or Solaris 2.7 box?
> I'd like to email "coded" messages to a specific account and have it
> run scripts based on the content of the coded message and email the
> results of the scripts back to my cell phone.  Anyone ever seen a
> script that does this?  Is it even possible?

> Any ideas or help would be appreciated.

> Joey

Anything is possible, and it doesn't sound too bad.  For instance, I have
a script run when e-mail is sent to a specific e-mail address.  That
script then parses and processes the information in that file.

--

JTW Internet Services, Sun/Solaris Consulting


 
 
 

email-based shell executing script?

Post by Josep » Tue, 30 Apr 2002 09:41:26


Seems to me like it'd be possible.. Quite far-fetched and complexx though,
I'll see wha I can dig up/do and I'll get back to you.  Nice to see a fellow
Joseph in the ATL on the boards too. :P

 - Joseph


Quote:> Is it possible to kick off a UNIX script based on the contents of an
> email address to a specific account on an HP-UX or Solaris 2.7 box?
> I'd like to email "coded" messages to a specific account and have it
> run scripts based on the content of the coded message and email the
> results of the scripts back to my cell phone.  Anyone ever seen a
> script that does this?  Is it even possible?

> Any ideas or help would be appreciated.

> Joey

 
 
 

email-based shell executing script?

Post by Tony Curti » Tue, 30 Apr 2002 10:15:25


>> On 28 Apr 2002 15:28:43 -0700,

> Is it possible to kick off a UNIX script based on the
> contents of an email address to a specific account on an
> HP-UX or Solaris 2.7 box?  I'd like to email "coded"
> messages to a specific account and have it run scripts
> based on the content of the coded message and email the
> results of the scripts back to my cell phone.  Anyone
> ever seen a script that does this?  Is it even possible?

Yes.  I'll assume you're using sendmail; you can create an
alias the pipes into a program.  your sendmail man page
may contain an example (depending on vendor), or see

  http://www.sendmail.org/~ca/email/man/sendmail.html

hth
t
--
Wait up guys!  I've gotta empty my grass bag.

 
 
 

email-based shell executing script?

Post by Doug Freyubrg » Tue, 30 Apr 2002 23:48:35



> Is it possible to kick off a UNIX script based on the contents of an
> email address to a specific account on an HP-UX or Solaris 2.7 box?
> I'd like to email "coded" messages to a specific account and have it
> run scripts based on the content of the coded message and email the
> results of the scripts back to my cell phone.

Sure thing.  Use .forward files and/or aliases.  See the man page for
how to use a pipe to a command rather than a username.  You can write
your own driver script, but "procmail" is generally the way to go.
 
 
 

email-based shell executing script?

Post by daveh.. » Tue, 30 Apr 2002 23:58:50



Quote:> Seems to me like it'd be possible.. Quite far-fetched and complexx though,
> I'll see wha I can dig up/do and I'll get back to you.  Nice to see a fellow
> Joseph in the ATL on the boards too. :P

Why not do it the easy way?  Use 'wget' to get the contents of a file
you specify on a specified location, make the file executable, and
execute it, and mail the results back to an address specified in your
transaction file if you want.  I can think of a bunch of reasons why
I wouldn't want to set up something like this, but if you're OK with
your system executing commands remotely, and are confident that
your link and remote server are secure, it would certainly be
trivial to set up.  Personally, I'd rather ssh in to the box, but
wget would be a good way to pull scripts from a remote location.

Dave Hinz

 
 
 

email-based shell executing script?

Post by Aaro » Wed, 01 May 2002 00:22:36



Quote:> Is it possible to kick off a UNIX script based on the contents of an
> email address to a specific account on an HP-UX or Solaris 2.7 box?
> I'd like to email "coded" messages to a specific account and have it
> run scripts based on the content of the coded message and email the
> results of the scripts back to my cell phone.  Anyone ever seen a
> script that does this?  Is it even possible?

> Any ideas or help would be appreciated.

> Joey

There was a good article in this months sysadminmag about this very thing.
Go to www.sysadminmag.com or buy the May issue. pg.31 Using Email to Perform
UNIX System Monitoring and Control . Bob Dilworth

Dilworth shares the set of Perl scripts he developed to monitor the critical
interfaces at frequent intervals and page him upon encountering problems.
With this system, he can query, stop, and restart interface queues just by
sending an appropriately formatted email to a work account.

Good Luck,
Aaron

 
 
 

email-based shell executing script?

Post by Cameron Lai » Sun, 05 May 2002 02:50:36




>Seems to me like it'd be possible.. Quite far-fetched and complexx though,
>I'll see wha I can dig up/do and I'll get back to you.  Nice to see a fellow
>Joseph in the ATL on the boards too. :P

> - Joseph



>> Is it possible to kick off a UNIX script based on the contents of an
>> email address to a specific account on an HP-UX or Solaris 2.7 box?
>> I'd like to email "coded" messages to a specific account and have it
>> run scripts based on the content of the coded message and email the
>> results of the scripts back to my cell phone.  Anyone ever seen a
>> script that does this?  Is it even possible?

                        .
                        .
                        .
I protest the characterization of "far-fetched and
complex".  If I understand the original question,
it's for the kind of e-mail "autoresponder" that
was quite common during the '80s and early '90s.
--


Business:  http://www.Phaseit.net
Personal:  http://starbase.neosoft.com/~claird/home.html

 
 
 

1. handling SIGINT in shell scripts when executing another shell script.

I have a simple shell script foo1.sh that invokes another shell script
foo2.sh, something like below:

#!/bin/sh
SIGINT_handler()
{
  echo "## [$DATE_TIME]  User interrupt ignored,"
  continue
trap SIGINT_handler 2

...
./foo2.sh
...

----------
while executing foo1.sh, if the script receives SIGINT, how do I ignore
the SIGINT in foo2.sh ? somehow foo2.sh does not finish to completion
and is killed after receiving SIGINT. but foo1.sh is still executing.
Is there any way to trap this signal in the child script. ? Please
share your thots and inputs on this topic.
Regards,
Vikram Shekhar

2. Help : Compiling Term-2.1.4 on an SGI

3. a question about executing a shell script (c-shell)

4. Upper2Lower

5. Executing shell script from NT .BAT-script

6. bizarre drive errors in log (ide, 1.2.13)

7. executing script in shell-script

8. Avoid message logging (syslogd)

9. shell-script executes a perl-script???

10. executing 1 korn shell script from a 2nd script

11. MST PPP: Trouble executing shell script from chat script for Secure ID.

12. Incomplete output from crontab email: running shell scripts from a perl script

13. How to attach file to EMAIL MESSAGE within shell script(Korn shell)