#! /bin/sh
#
# plot a set of data
# usage:  grapit info_file
if [ $# != 4 ]
	then
		echo usage:  grapit homebase info_file protocol org
		exit 1
fi
#
H=$1
INFO=$2
PROT=$3
ORG=$4

# fill out the protocol
if [ $PROT = "br" ]
	then
		PROTOCOL="Bridge"
fi
if [ $PROT = "ip" ]
	then
		PROTOCOL="TCP\/IP"
fi
if [ $PROT = "at" ]
	then
		PROTOCOL="AppleTalk II"
fi
if [ $PROT = "ipx" ]
	then
		PROTOCOL="IPX"
fi
if [ $PROT = "dn" ]
	then
		PROTOCOL="DECnet Phase IV"
fi
# get the vendor info
VEND=`grep VENDOR $INFO | awk ' { print $2 } '`
PROD=`grep ID $INFO | awk ' { print $2 } '`

# fix up the grap script
cat $H/plotit.gbase | sed "s/VEND/$VEND/
s/PROD/$PROD/
s/PROTO/$PROTOCOL/
s/ORG/$ORG/
s/PROT/$PROT/" >> plotit.grap

exit
# make the data files
ana $DIR $PROT-s.res $PROT-b.res

# make the graph
grap plotit.grap | pic | titroff -Tpsc | ditps - > $PROT.ps
