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

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