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 | |
---|
10 | PATH=/bin/athena:/bin:/usr/bin:/usr/ucb:/usr/bsd; export PATH |
---|
11 | |
---|
12 | vers=`awk '{vers = $5}; END {print vers}' /etc/athena/version` |
---|
13 | |
---|
14 | if [ 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 |
---|
18 | fi |
---|
19 | |
---|
20 | # Source existing clusterinfo file to get update timestamp, if any. |
---|
21 | if [ -s /var/athena/clusterinfo.bsh ]; then |
---|
22 | . /var/athena/clusterinfo.bsh |
---|
23 | fi |
---|
24 | |
---|
25 | getcluster -b "$vers" > /var/athena/clusterinfo.bsh.new |
---|
26 | if [ $? -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 |
---|
30 | fi |
---|
31 | |
---|
32 | getcluster "$vers" > /var/athena/clusterinfo.new |
---|
33 | if [ $? -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 |
---|
37 | fi |
---|
Note: See
TracBrowser
for help on using the repository browser.