#!/bin/sh
#------------------------------------------------------------------------------
#  Copyright (c) 1992 Regents of the University of Michigan.
#  All rights reserved.
# 
#  Redistribution and use in source and binary forms are permitted
#  provided that this notice is preserved and that due credit is given
#  to the University of Michigan at Ann Arbor. The name of the University
#  may not be used to endorse or promote products derived from this
#  software without specific prior written permission. This software
#  is provided ``as is'' without express or implied warranty.
#
#	UpdateLinkFile - Update the nsfnett3.LINKS file with detailed
#			link information.
#------------------------------------------------------------------------------
PATH=/bin:/etc:/usr/bin:/usr/local/bin:.:$HOME/src/rovers/bin:$HOME/bin:
PINGKYDIR=/rtdata/rover/logs/InetRover
STATUSFILE=$PINGKYDIR/nsfnett3.STATUS
COMMUNITY=lookatit

export PINGKYDIR

for node in `cat $STATUSFILE | grep UP | grep NSS | grep nss | grep NODE | awk '{ print $5}'`
do
	list=`echo $list -h $node`
done
updatelinkfile -c lookatit -r 15 -t 10 $list -n nsfnett3

#	Set up Link Width file and print a report
#cat $PINGKYDIR/nsfnett3.LINKS | printlink
cat $PINGKYDIR/nsfnett3.LINKS | awk '{ if ( $1==18) print $3" "$8" 0"; if ($1==22) print $3" "$8" 3"}' >$PINGKYDIR/Nsfnett3.LinkSpeed.LW
