#!/bin/sh
#delete all files for users that haven't logged on for 
#the specified number of days.

if (! -d "userdata") then
        echo "Can't find userdata directory. Are you in the right place?"
        exit
endif

#Protect the Wizards and SU accounts from deletion
echo Protecting accounts for Wizards, SUs, and any other special users...
protect_wiz

#Change 'cat' to 'sh' in the following line to delete the old account files
echo Deleting old user accounts...
find userdata -type f -mtime +$1 -print | awk -f $0.awk | cat
