File tree Expand file tree Collapse file tree 1 file changed +17
-16
lines changed Expand file tree Collapse file tree 1 file changed +17
-16
lines changed Original file line number Diff line number Diff line change 41
41
# $GHE_HOSTNAME configured in backup.config when not present.
42
42
host=" ${1:- $GHE_HOSTNAME } "
43
43
44
- CLUSTER=false
45
- if ghe-ssh " $host " -- \
46
- " [ -f '$GHE_REMOTE_ROOT_DIR /etc/github/cluster' ]" ; then
47
- CLUSTER=true
48
- fi
49
-
50
- if " $CLUSTER " ; then
51
- node_version_list=$( ghe-ssh " $host " ghe-cluster-each -- ghe-version)
52
- distinct_versions=$( echo " $node_version_list " | awk ' {split($0, a, ":"); print a[2]}' | awk ' {print $4}' | uniq | wc -l)
53
- if [ " $distinct_versions " -ne 1 ]; then
54
- echo " $node_version_list " 1>&2
55
- echo " Error: Not all nodes are running the same version! Please ensure all nodes are running the same version before using backup-utils." 1>&2
56
- exit 1
57
- fi
58
- fi
59
-
60
44
# Options to pass to SSH during connection check
61
45
options="
62
46
-o PasswordAuthentication=no
@@ -100,6 +84,23 @@ if [ $rc -ne 0 ]; then
100
84
exit $rc
101
85
fi
102
86
87
+ CLUSTER=false
88
+ if ghe-ssh " $host " -- \
89
+ " [ -f '$GHE_REMOTE_ROOT_DIR /etc/github/cluster' ]" ; then
90
+ CLUSTER=true
91
+ fi
92
+
93
+ # ensure all nodes in the cluster are running the same version
94
+ if " $CLUSTER " ; then
95
+ node_version_list=$( ghe-ssh " $host " ghe-cluster-each -- ghe-version)
96
+ distinct_versions=$( echo " $node_version_list " | awk ' {split($0, a, ":"); print a[2]}' | awk ' {print $4}' | uniq | wc -l)
97
+ if [ " $distinct_versions " -ne 1 ]; then
98
+ echo " $node_version_list " 1>&2
99
+ echo " Error: Not all nodes are running the same version! Please ensure all nodes are running the same version before using backup-utils." 1>&2
100
+ exit 1
101
+ fi
102
+ fi
103
+
103
104
version=$( echo " $output " | grep " GitHub Enterprise" | awk ' {print $NF}' )
104
105
105
106
if [ -z " $version " ]; then
You can’t perform that action at this time.
0 commit comments