On Tue, 14 Oct 2008, Trent W. Buck wrote:

"Sven Hazejager"
<[EMAIL PROTECTED]> writes:

I'm using screen to keep some applications open over a remote SSH
connection that sometimes is killed. What I would like to do, is to
somehow find out whether I am logged in (attached) or disconnected
from the screen session.

Reason is that I want procmail to send incoming mail to my BlackBerry
if I'm disconnected, but NOT do that when I'm SSH-ing into my Pine
session.

I don't know how to achieve that, but perhaps there's a different approach to the problem -- such as always forwarding all mail to an IMAP server that you can access from both the blackberry and from pine.

The screen-socket has execute permissions when attached, and none when detached, like this:

attached:

ls -l /tmp/uscreens/S-peder/4598.irc
prwx------ 1 peder peder 0 Oct 14 00:00 /tmp/uscreens/S-peder/4598.irc

detached:
ls -l /tmp/uscreens/S-peder/4598.irc
prw------- 1 peder peder 0 Oct 14 07:06 /tmp/uscreens/S-peder/4598.irc

Guess you can test for that i procmail by something like:

:0c
*? perl -e 'exit ! grep { (stat $_)[2] & 0100 } </tmp/uscreens/S-peder/*>'
[EMAIL PROTECTED]

--
  Peder Stray


_______________________________________________
screen-users mailing list
screen-users@gnu.org
http://lists.gnu.org/mailman/listinfo/screen-users

Reply via email to