#!/usr/bin/perl -w # # logout.pl - Version 0.2.1 # # Author : Ingo Strauch (strauch@mail.desy.de) # # Created : 29.12.1999 # Last update: 28.03.2000 # Download : http://www-users.rwth-aachen.de/Ingo.Strauch/logout.pl # # With this program you can automatically kill a list of applications (and # at the same time execute other 'cleanup' commands). # Use it e.g. before you completely log out to ensure none of the programs # which are known to hang up quite often (fvwm goodstuff or netscape) will # eat up resources while you're away. # With this configuration you kill every running 'netscape' and 'root.exe' # and also remove the netscape lock file (quite useful, especially after # quitting the X-Window system without exiting those applications...). @prozesse = `ps x`; @boese = grep ( $_ =~ /(netscape|root.exe)/o, @prozesse); #@boese = grep ( $_ =~ /top/o, @prozesse); foreach $prozess (@boese) { ($PID, $TTY, $STAT, $TIME, $COMMAND) = split ( / +/ , $prozess, 5); kill 9, $PID; if ($COMMAND =~ /netscape/) { unlink '/home/myself/.netscape/lock'; } print "\n-----> Killed: $PID\t$TTY\t$STAT\t$TIME\t$COMMAND"; }