#!/bin/sh
# Get cluster information from Hesiod and save it.
# This is normally exected by /etc/rc and each time a workstation is
# activated.
#
#	$Source: /paris/source/4.3/bin.athena/getcluster/RCS/save_cluster_info.sh,v $
#	$Author: treese $
#	$Header: save_cluster_info.sh,v 1.4 87/08/22 17:42:07 treese Exp $
#
# Errors from getcluster guarantee that stdout will be size 0,
# therefore a size # 0 is a sufficient test.
# Use old data from last session if getcluster fails.

HOSTNAME=`/bin/hostname`
VERSION=`/bin/awk '{vers = $5} END {print vers}' /etc/version.mit`

if [ ${VERSION}x = Updatex ]; then
	echo "This system is in the middle of an update."
	exit 1
fi

/bin/athena/getcluster -b $HOSTNAME $VERSION > /tmp/clusterinfo.bsh
/bin/athena/getcluster $HOSTNAME $VERSION > /tmp/clusterinfo
