[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [monitoring-like] would like to be warned when I have mail (fetchmai

From: Slink3r
Subject: Re: [monitoring-like] would like to be warned when I have mail (fetchmail -c)
Date: Tue, 27 Sep 2005 21:26:21 -0400

Okay, I have the same sort of problem, unfortunately I'm extremely incompetent :(

I'm trying to get screen to simply ding me whenever "devil" from irc channel #void speaks

I figured I could use something like tail -n 5 /$HOME/.BitchX/logs/#void.log |grep devil
and just execute that every 3 seconds or something, then if it returns something other than
null, it could beep me.

Is there a simple way to do this?

On 9/27/05, Gerhard Siegesmund <address@hidden> wrote:

I did something similar, but asking an imap-Server for the number of
mails with fetchmail -c. Problem was: The query took several seconds to
succeed, in which time my screen freezed as the hardstatusline was
waiting for the info.

I read the manpage and found "backtick 1 0 0 script" which is supposed
to start the script and just wait for new messages to stdout to output
them on the hardstatusline. Works great! Except for one thing: The
script doesn't get killed, if the screen is ended. This means I have to
stop the mailcheck-scripts which are created from screen by hand.

Is there anything I can do to automatically stop the started scripts if
the parent-screen is terminated?

> This seems to be a good opportunity to make use of the hardstatus
> and backticks. I agree a script is the right idea; here's how I'd do
> it.
>     $ cat ~/bin/screen-checkmail
>     #!/bin/sh
>     [parse fetchmail output reasonably]
>     $ cat ~/.screenrc
>     ...
>     backtick 1 60 1 /$HOME/bin/screen-checkmail
>     ...
>     hardstatus alwayslastline ...%1`...
> Adding a conditional wrapper around your mail checker (eg %?...%?)
> will ensure that you only see your mail alert when your checkmail
> script produces output.

  --== Jerri ==--
Homepage:   ICQ: 54160208
Public PGP Key:

Version: GnuPG v1.4.2 (GNU/Linux)


screen-users mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]