#!/bin/bash # Copyright 2016 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. if [[ $(nodetool status | grep $POD_IP) == *"UN"* ]] { if [[ $DEBUG ]] { echo "UN"; } exit 0; } else { if [[ $DEBUG ]] { echo "Not Up"; } exit 1; } (CommandList children: [ (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(nodetool)} {(status)}) (C {(grep)} {($ VSub_Name "$POD_IP")}) ] negated: False ) ] ) left_token: spids: [48 58] ) } right: {(Lit_Other "*") (DQ (UN)) (Lit_Other "*")} ) ) terminator: ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr:(WordTest w:{($ VSub_Name "$DEBUG")})) terminator: ) ] action: [(Sentence child:(C {(echo)} {(DQ (UN))}) terminator:)] spids: [-1 83] ) ] spids: [-1 94] ) (Sentence child:(C {(exit)} {(0)}) terminator:) ] spids: [-1 71] ) ] else_action: [ (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr:(WordTest w:{($ VSub_Name "$DEBUG")})) terminator: ) ] action: [(Sentence child:(C {(echo)} {(DQ ("Not Up"))}) terminator:)] spids: [-1 114] ) ] spids: [-1 125] ) (Sentence child:(C {(exit)} {(1)}) terminator:) ] spids: [102 133] ) ] )