0: #!/usr/bin/perl -w
1: # Perform some action on your exit from the last tty you are logged on.
2: # I use it to close fetchmail from .bash_logout (I start it from
3: # .bash_profile)
4: # Sorry for any mistakes - it's my first post...
5:
6: open(MY_IN, 'users|') or die "No possibility to read from the stream.\n";
7: $line = <MY_IN>;
8: close MY_IN;
9: chomp $line;
10: @sus = split / /, $line;
11: foreach (@sus) {
12: if ($_ eq "pfm") { $num++; }
13: }
14: if ($num eq 1) {
15: exec "fetchmail --quit";
16: } In reply to action to perform on logout by pfm
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |