
# UNISRC_ID: @(#)loguptime.sh	27.1	85/03/10  
# Script to record uptime if it exceeds the old record.


	PATH=/bin:/usr/bin:/usr/contrib/bin


# Check arguments:

	if [ $# != 1 ]
	then
		echo "usage: $0 logfile" >&2
		exit 1
	fi


# Log uptime if required:

	newsec=`uptime -s`		# current number of seconds.
	oldsec=`line <"$1"`		# previous number of seconds.

	if [ ${newsec:-0} -gt ${oldsec:-0} ]
	then
		echo "$newsec\nnow:\t`date`\n`uptime`" >"$1"
		revision >>"$1"
	fi
