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

Revision 6590, 1.0 KB checked in by miki, 31 years ago (diff)
made more portable
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# $Id: save_cluster_info.sh,v 1.7 1993-04-29 19:06:13 miki Exp $
7#
8# Errors from getcluster guarantee that stdout will be size 0,
9# therefore a size # 0 is a sufficient test.
10# Use old data from last session if getcluster fails.
11
12PATH=/bin:/usr/ucb; export PATH
13
14. /etc/athena/rc.conf
15HOSTNAME=`hostname`
16VERSION=`awk '{vers = $5}; END {print vers}' /etc/athena/version`
17
18if [ "${VERSION}" = "Update" ]; then
19        echo "This system is in the middle of an update."
20        echo "Please contact Athena Operations."
21        exit 1
22fi
23
24/bin/athena/getcluster -b ${HOSTNAME} ${VERSION} > /tmp/clusterinfo.bsh
25if [ -s /tmp/clusterinfo.bsh ]
26then
27        cp /tmp/clusterinfo.bsh /etc/athena/clusterinfo.bsh
28        chmod 666 /etc/athena/clusterinfo.bsh 2>/dev/null
29fi
30/bin/athena/getcluster ${HOSTNAME} ${VERSION} > /tmp/clusterinfo
31if [ -s /tmp/clusterinfo ]
32then
33        cp /tmp/clusterinfo /etc/athena/clusterinfo
34        chmod 666 /etc/athena/clusterinfo 2>/dev/null
35fi
Note: See TracBrowser for help on using the repository browser.