#!/bin/sh
#
# Script used to read from stdin , if INTERVAL expires print out a date line.
#
# Used in conjunction with tracepipe so buffered data will not stay buffered too long.
# Printing out the date line, which is unique information, will force any buffered data
# in tracepipe to get traced
#
# Change log:
#
# 10/10/2007 Jim Kunz  initial release
#
# SECS is how many seconds to wait for data before timing out and printing out a date line
SECS=180
INTERVAL=$SECS
while [ "$INTERVAL" -eq "$SECS" ]
do
	answer="timed_out"
	read -t $INTERVAL answer

	if [ "$answer" == "timed_out" ]
	then
		echo "TIMEDREAD: `date`"
	else
		echo "$answer"
	fi
done

exit 0	
