source: trunk/athena/bin/getcluster/save_cluster_info.sh @ 751

Revision 751, 1.1 KB checked in by treese, 37 years ago (diff)
Updated to use version information for calling getcluster.
Line 
1#!/bin/sh
2# Get cluster information from Hesiod and save it.
3# This is normally exected by /etc/rc and each time a workstation is
4# activated.
5#
6#       $Source: /afs/dev.mit.edu/source/repository/athena/bin/getcluster/save_cluster_info.sh,v $
7#       $Author: treese $
8#       $Header: /afs/dev.mit.edu/source/repository/athena/bin/getcluster/save_cluster_info.sh,v 1.4 1987-08-22 17:42:07 treese Exp $
9#
10# Errors from getcluster guarantee that stdout will be size 0,
11# therefore a size # 0 is a sufficient test.
12# Use old data from last session if getcluster fails.
13
14HOSTNAME=`/bin/hostname`
15VERSION=`/bin/awk '{vers = $5} END {print vers}' /etc/version`
16
17if [ ${VERSION}x = Updatex ]; then
18        echo "This system is in the middle of an update."
19        echo "Please contact Athena Operations."
20        exit 1
21fi
22
23/bin/athena/getcluster -b $HOSTNAME $VERSION > /tmp/clusterinfo.bsh
24if [ -s /tmp/clusterinfo.bsh ]
25then
26        /bin/cp /tmp/clusterinfo.bsh /etc/clusterinfo.bsh
27        chmod 666 /etc/clusterinfo.bsh 2>/dev/null
28fi
29/bin/athena/getcluster $HOSTNAME $VERSION > /tmp/clusterinfo
30if [ -s /tmp/clusterinfo ]
31then
32        /bin/cp /tmp/clusterinfo /etc/clusterinfo
33        chmod 666 /etc/clusterinfo 2>/dev/null
34fi
Note: See TracBrowser for help on using the repository browser.