On Monday 21 June 2004 4:07 pm, Amitay Isaacs wrote:
How about .bash_logout if the root's login shell is bash?
Amitay.
On Mon, 2004-06-21 at 11:36, vaibhav samant wrote:
I need to run a script everytime there is a SSH logout of user root.<= BR> Any ideas....???
Since .bash_logout is executed for every logout session (provided, the shell is bash), you could check if its an ssh session by something like this in .bash_logout
[ "$SSH_TTY" != "" ] && { `w | mail -s "Logout from ssh session" your_email_id_here` }
This mails with output of w whenever a logout from ssh session occurs.
Jemshad O K