Cover V02, I06
Article
Listing 1
Sidebar 1
Sidebar 2
Table 1
Table 2
Table 3

nov93.tar


Listing 1: killidle

:
#       killidle
#
#       Kill any user login idle for too long

IDLEOUT=${1:-20}

if [ $IDLEOUT -lt 1 ]
then
IDLEOUT=20
fi

who -u |
awk ' {
name = $1;
terminal = $2;
idle = $6;
pid = $7;

if (idle != ".") {
split(idle, idletime, ":");
if (idletime[2] >= IDLEOUT) {
print "Timeout Warning:", \
name, "on", terminal, \
"idle for", idle, \
"minutes (killed pid:", pid ")"
system("kill -9 " pid);
}
}
}' IDLEOUT=$IDLEOUT