#!/depot/gnu/arch/bin/bash
#
#  Lossage.sh (SOLARIS VERSION)
#  Generate graph representing packet loss versus time for a specified site.
#
#  DWF  6/6/95
#  11/14/95  Added another space in header to correct alignment problem.
#  1998-01-28  Converted from Linux to Solaris.
#
#  Usage:  ./lossage.sh sitename
#
echo "                            Dead                                    Alive"
echo "Time                          |   1   2   3   4   5   6   7   8   9   |"
while /bin/true; do
  LOSSAGE=`/usr/sbin/ping -I 1 $1 56 40 | fgrep "packet loss" | cut -d , -f 2 \
    | cut -d ' ' -f 2`
  echo -n `date` '  '
  while [ ${LOSSAGE} -gt 0 ]; do
    echo -n "#"
    LOSSAGE=$[LOSSAGE-1]
  done
  echo ''
  sleep 300
done

