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