<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.0.9">
</HEAD>
<BODY>
I wrote a script this morning to keep the students in my classes from playing games/chess/web browsing during my classes (I don't want to uninstall games, and that doesn't stop the browsing).  Basically, the script is an infinite loop (always wanted to have a "while (true)" loop) that reads 2 variables from a file that you specify on the command line (ctrl-c stops it).  It just loops and does a ps list for each user and picks the pids of the programs you don't want them to run, and kills them... here's the contents from my 1st period file I use:<BR>
<BR>
#1st_period.reap<BR>
#1st Period - no mozilla, no chess, no Maelstrom<BR>
REAP_USERS="cfraser afuller mandrews rladd cpawley"<BR>
<BR>
REAP_PROGS="mozilla-bin gnuchess Maelstrom"<BR>
<BR>
<BR>
So I run ./class_reaper.sh 1st_period.reap<BR>
<BR>
<BR>
You have to run it as root at the moment...  DO NOT RUN THIS USING SUDO!!!!!!!!!!!<BR>
As you can imagine, a malicious user who has access to run it could terminate any users programs, as well as gdm, root, etc!!!!  If someone wants to make it SUDO safe (ie: protect root, etc... or users under a UID # range), and not kill users within specific groups (ie: Faculty).... you are quite welcome to.<BR>
<BR>
I've thought about making it interactive... ie: as students finish an assignment, I can release them while not having to terminate the script and reload the new text file.<BR>
<BR>
<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<TABLE>
<TR>
<TD>
<IMG SRC="http://www.hhprep.org/images/4decade-sig.jpg" ALIGN="bottom" BORDER="0">
</TD>
<TD>
Henry Burroughs <BR>
Technology Director<BR>
Hilton Head Preparatory School<BR>
www.hhprep.org<BR>
hburroughs@hhprep.org
</TD>
</TR>
</TABLE>

</TD>
</TR>
</TABLE>

</BODY>
</HTML>