Autologout of unused terminals

Amos Shapir amos at taux02.UUCP
Wed Nov 30 22:43:25 AEST 1988


In article <9012 at smoke.BRL.MIL> gwyn at brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>) writes:
>There are many ways to deal with careless terminal users other than
>automatic idle-terminal killer software.

Here's one: the following command file, for BSD systems, uses the output
of 'w' to mail notes to idle users. The only bug is that such users are
usually not there to read their mail...

#!/bin/sh
w -hs | \
sed -n 's/^\(.........\)\(..\)\(.[0-9]\).*/(echo You have a login session on tty\2\
echo which has been inactive for more than \3 days now. \
echo You can use ps -ut\2  to find out what processes run there and kill them.) \\\
|Mail -s "Idle login session" \1/p' |sh


-- 
	Amos Shapir				amos at nsc.com
National Semiconductor (Israel) P.O.B. 3007, Herzlia 46104, Israel
Tel. +972 52 522261  TWX: 33691, fax: +972-52-558322
34 48 E / 32 10 N			(My other cpu is a NS32532)



More information about the Comp.unix.wizards mailing list