#!/bin/bash
# Squota - Screwed Quota		Copyright (c) 1996 Gary Barrueto
##############################################################################
# Squota - This scripts kepts track of current users list..
##############################################################################
# Load variables - Read the /var/adm/Squota/quotavars to find out $VARIBLES
##############################################################################

. /var/adm/Squota/quotavars

##############################################################################
# WHAT THIS NEEDS, make the next line so it check users via /etc/passwd
##############################################################################
# get list of personal home dirs
# get rid of "lost+found" dir if it exists
# get rid of quota files... 
##############################################################################

"ls" $WHATDIR | grep -v found | grep -v quota > /var/adm/Squota/quota.users

#######
# USER LIST just got created
# NOW its time to find how much, in Kilobytes, is stored currently in
# the users home.
#######

while test $PULENGTH != $EMPTY
do
  EMPTY=`expr $EMPTY + 1`
  UHOME=`head -$EMPTY $HQ/quota.users | tail -1`

  # Start Logging

  FSUSAGE=`eval du -s ~$UHOME | cut -f1`
  echo $FSUSAGE >> $HQ/$UHOME.$MON
done
