#
#	$Header: graphdaily,v 4.300 91/06/09 01:00:05 root Rel41 $
#	Copyright 1990, Performance Systems International Inc.
#	Copyright 1989, NYSERNet, Inc.
#	Copyright 1990, Sony Corp.
#	All Rights Reserved.
#

#	This script is gifcs with a lobotomy.

set	VARS=( {In,Out}Octets {In,Out}UcastPkts)

source ../../config/report-env
if (-e $ROOT/config/daily-env) then
  source $ROOT/config/daily-env
else
  echo "$0 : daily-env missing. Can't continue. Exit."
  exit(1)
endif

set	DAILYBIN=$BIN
set	BIN=$ROOT/plot/bin
set	SEDAWK=$BIN/sedawk
set	PLOTDIR=$DATA/plot
set	prgm=$0

if ($#argv  < 1) then
  echo "Usage: $prgm:t <mmddyy>"
  exit 
else
  set	ext=$argv[1]
endif

set	date=(`$DAILYBIN/prsdate $ext`)
cd	$DATA/$ext
mkdir	$PLOTDIR/$ext

foreach file (*-*)
  awk -f	$SEDAWK/plot.1.awk $file >! /tmp/$file

  foreach v ($VARS)
    set label="$file $v on $date"
    ##debug ##echo "$label"
    (grep $v /tmp/$file | sed "s/$v	//" | awk -f $SEDAWK/plot.2.awk; echo $v) | \
	awk -f $SEDAWK/yscale.awk	| \
	graph -b -g 1 -x 0 104 4 -l "$label $v" >! $PLOTDIR/$ext/$file.$v
  end
  /bin/rm /tmp/$file
end
