#!/bin/bash
# Author: Ryan Lewis
# Date: Mon Feb 27, 2006
# cosiguest-purge: When executed, checks if cosiguest is logged in and
# purges their home directory if not.
LOGON="cosigues"
NUMLOGONS=`w | grep $LOGON | wc -l`
RM=`which rm`
if [ $NUMLOGONS -eq 0 ]; then
echo "Purge of $LOGON initialized."
cd /home/cosiguest
$RM -rf *
echo "Purge of $LOGON complete."
else
echo "$LOGON is logged in, nothing to be done."
fi