source: trunk/packs/maint/save_cluster_info.sh @ 12180

Revision 12180, 1.3 KB checked in by ghudson, 26 years ago (diff)
Move save_cluster_info from athena/bin/getcluster to here.
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.1 1998-12-03 19:36:37 ghudson Exp $
7#
8# Use old data from last session if getcluster fails.
9
10PATH=/bin:/usr/bin:/usr/ucb:/usr/bsd; export PATH
11
12. /etc/athena/rc.conf
13VERSION=`awk '{vers = $5}; END {print vers}' /etc/athena/version`
14
15if [ "${VERSION}" = "Update" ]; then
16        echo "This system is in the middle of an update."
17        echo "Please contact Athena Operations."
18        exit 1
19fi
20
21# Source existing clusterinfo file to get update timestamp, if any.
22if [ -s /var/athena/clusterinfo.bsh ]; then
23        . /var/athena/clusterinfo.bsh
24fi
25
26/bin/athena/getcluster -b -l /etc/athena/cluster.local ${HOST} ${VERSION} \
27        > /var/athena/clusterinfo.bsh.new
28if [ $? -eq 0 -a -s /var/athena/clusterinfo.bsh.new ]
29then
30        rm -f /var/athena/clusterinfo.bsh
31        mv /var/athena/clusterinfo.bsh.new /var/athena/clusterinfo.bsh
32        chmod 644 /var/athena/clusterinfo.bsh
33fi
34/bin/athena/getcluster -l /etc/athena/cluster.local ${HOST} ${VERSION} \
35        > /var/athena/clusterinfo.new
36if [ $? -eq 0 -a -s /var/athena/clusterinfo.new ]
37then
38        rm -f /var/athena/clusterinfo
39        mv /var/athena/clusterinfo.new /var/athena/clusterinfo
40        chmod 644 /var/athena/clusterinfo
41fi
Note: See TracBrowser for help on using the repository browser.