ffd044854f72deeca1e2facb00b7fcc24c74742f
[oom.git] / kubernetes / sdnc / resources / geo / bin / sdnc.isPrimaryCluster
1 #!/bin/bash
2 {{/*
3
4 # Copyright © 2018 Amdocs
5 #
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 #       http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 */}}
18
19 dir=$( dirname $0 )
20
21 IS_PRIMARY_CLUSTER=`awk '/isPrimaryCluster/ {print $2}' $dir/../../../values.yaml`
22
23 if [ "$?" -eq "2" ]; then
24       echo "Make sure you are ubuntu user." >&2
25 fi
26
27 case $IS_PRIMARY_CLUSTER in
28 true|false)
29         echo $IS_PRIMARY_CLUSTER
30         ;;
31 *)
32         echo "NOT CLUSTERED"
33         exit 1
34         ;;
35 esac