(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:COUNT) op:assign_op.Equal rhs:{(0)} spids:[9])]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.DBracket
                  expr: 
                    (bool_expr.LogicalNot
                      child: (bool_expr.Unary op_id:Id.BoolUnary_z child:{(DQ ($ Id.VSub_Number '$1'))})
                    )
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:25)
            )
          ]
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:WANTED)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number '$1'))}
                  spids: [30]
                )
              ]
            )
          ]
          spids: [12 27]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.DBracket
                  expr: (bool_expr.Unary op_id:Id.BoolUnary_f child:{(cluster.txt)})
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:46)
            )
          ]
          action: [
            (command.WhileUntil
              keyword: (Token id:Id.KW_While val:while span_id:56)
              cond: [
                (command.Sentence
                  child: 
                    (C {(read)} {(HOSTNAME)} {(MACADDR)} {(IPADDR)} {(ILOIPADDR)} {(DOMAIN)} {(ROLE)})
                  terminator: (Token id:Id.Op_Semi val:';' span_id:71)
                )
              ]
              body: 
                (command.DoGroup
                  children: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.DBracket
                                  expr: 
                                    (bool_expr.Binary
                                      op_id: Id.BoolBinary_GlobEqual
                                      left: {(DQ ($ Id.VSub_DollarName '$HOSTNAME'))}
                                      right: {(end)}
                                    )
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:89)
                            )
                          ]
                          action: [
                            (command.ControlFlow
                              token: (Token id:Id.ControlFlow_Continue val:continue span_id:94)
                            )
                          ]
                          spids: [76 91]
                        )
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.DBracket
                                  expr: 
                                    (bool_expr.LogicalOr
                                      left: 
                                        (bool_expr.Unary
                                          op_id: Id.BoolUnary_z
                                          child: {(DQ ($ Id.VSub_DollarName '$WANTED'))}
                                        )
                                      right: 
                                        (bool_expr.LogicalOr
                                          left: 
                                            (bool_expr.Binary
                                              op_id: Id.BoolBinary_GlobEqual
                                              left: {(DQ ($ Id.VSub_DollarName '$WANTED'))}
                                              right: {(all)}
                                            )
                                          right: 
                                            (bool_expr.LogicalOr
                                              left: 
                                                (bool_expr.Binary
                                                  op_id: Id.BoolBinary_GlobEqual
                                                  left: {(DQ ($ Id.VSub_DollarName '$WANTED'))}
                                                  right: {(DQ ($ Id.VSub_DollarName '$ROLE'))}
                                                )
                                              right: 
                                                (bool_expr.LogicalOr
                                                  left: 
                                                    (bool_expr.Binary
                                                      op_id: Id.BoolBinary_GlobEqual
                                                      left: {(DQ ($ Id.VSub_DollarName '$WANTED'))}
                                                      right: {(DQ (IPADDR))}
                                                    )
                                                  right: 
                                                    (bool_expr.Binary
                                                      op_id: Id.BoolBinary_GlobEqual
                                                      left: {(DQ ($ Id.VSub_DollarName '$WANTED'))}
                                                      right: {(DQ ($ Id.VSub_DollarName '$HOSTNAME'))}
                                                    )
                                                )
                                            )
                                        )
                                    )
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:157)
                            )
                          ]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:ALLHOSTS)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (DQ ($ Id.VSub_DollarName '$ALLHOSTS') (' ') 
                                        ($ Id.VSub_DollarName '$IPADDR')
                                      )
                                    }
                                  spids: [162]
                                )
                              ]
                            )
                          ]
                          spids: [100 159]
                        )
                      ]
                    )
                  ]
                )
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_Less val:'<' span_id:175)
                  fd: -1
                  arg_word: {(cluster.txt)}
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DBracket
                          expr: 
                            (bool_expr.Unary
                              op_id: Id.BoolUnary_z
                              child: {(DQ ($ Id.VSub_DollarName '$ALLHOSTS'))}
                            )
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:192)
                    )
                  ]
                  action: [
                    (command.Sentence
                      child: 
                        (command.ControlFlow
                          token: (Token id:Id.ControlFlow_Exit val:exit span_id:196)
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:197)
                    )
                  ]
                  spids: [181 194]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DBracket
                          expr: 
                            (bool_expr.Unary
                              op_id: Id.BoolUnary_z
                              child: 
                                {
                                  (command_sub
                                    left_token: (Token id:Id.Left_Backtick val:'`' span_id:213)
                                    command_list: 
                                      (command.CommandList
                                        children: [(C {(which)} {(fping)})]
                                      )
                                  )
                                }
                            )
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:222)
                    )
                  ]
                  action: [
                    (command.ForEach
                      iter_name: IP
                      iter_words: [{($ Id.VSub_DollarName '$ALLHOSTS')}]
                      do_arg_iter: F
                      body: 
                        (command.DoGroup
                          children: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:UP)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (command_sub
                                        left_token: (Token id:Id.Left_Backtick val:'`' span_id:244)
                                        command_list: 
                                          (command.CommandList
                                            children: [
                                              (command.Pipeline
                                                children: [
                                                  (C {(ping)} {(-c)} {(1)} {($ Id.VSub_DollarName '$IP')})
                                                  (C {(grep)} {(ttl)})
                                                  (C {(cut)} {(-f4)} {(-d) (DQ (' '))})
                                                  (C {(cut)} {(-f1)} {(-d) (DQ (':'))})
                                                ]
                                                negated: F
                                              )
                                            ]
                                          )
                                      )
                                    }
                                  spids: [243]
                                )
                              ]
                            )
                            (command.If
                              arms: [
                                (if_arm
                                  cond: [
                                    (command.Sentence
                                      child: 
                                        (command.DBracket
                                          expr: 
                                            (bool_expr.LogicalNot
                                              child: 
                                                (bool_expr.Unary
                                                  op_id: Id.BoolUnary_z
                                                  child: {(DQ ($ Id.VSub_DollarName '$UP'))}
                                                )
                                            )
                                        )
                                      terminator: (Token id:Id.Op_Semi val:';' span_id:297)
                                    )
                                  ]
                                  action: [
                                    (command.ShAssignment
                                      pairs: [
                                        (assign_pair
                                          lhs: (sh_lhs_expr.Name name:COUNT)
                                          op: assign_op.Equal
                                          rhs: 
                                            {
                                              (word_part.ArithSub
                                                anode: 
                                                  (arith_expr.Binary
                                                    op_id: Id.Arith_Plus
                                                    left: 
                                                      (arith_expr.VarRef
                                                        token: 
                                                          (Token
                                                            id: Id.Lit_ArithVarLike
                                                            val: COUNT
                                                            span_id: 304
                                                          )
                                                      )
                                                    right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)})
                                                  )
                                              )
                                            }
                                          spids: [302]
                                        )
                                      ]
                                    )
                                    (C {(echo)} {($ Id.VSub_DollarName '$UP')} 
                                      {($ Id.VSub_DollarName '$ROLE')}
                                    )
                                  ]
                                  spids: [284 299]
                                )
                              ]
                            )
                          ]
                        )
                    )
                  ]
                  spids: [207 224]
                )
              ]
              else_action: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:UP)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (command_sub
                            left_token: (Token id:Id.Left_Backtick val:'`' span_id:334)
                            command_list: 
                              (command.CommandList
                                children: [
                                  (command.Simple
                                    words: [{(fping)} {(-aq)} {($ Id.VSub_DollarName '$ALLHOSTS')}]
                                    redirects: [
                                      (redir.Redir
                                        op: (Token id:Id.Redir_Great val:'2>' span_id:343)
                                        fd: 2
                                        arg_word: {(/dev/null)}
                                      )
                                    ]
                                  )
                                ]
                              )
                          )
                        }
                      spids: [333]
                    )
                  ]
                )
                (command.ForEach
                  iter_name: H
                  iter_words: [{($ Id.VSub_DollarName '$UP')}]
                  do_arg_iter: F
                  body: 
                    (command.DoGroup
                      children: [
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:COUNT)
                              op: assign_op.Equal
                              rhs: 
                                {
                                  (word_part.ArithSub
                                    anode: 
                                      (arith_expr.Binary
                                        op_id: Id.Arith_Plus
                                        left: 
                                          (arith_expr.VarRef
                                            token: 
                                              (Token
                                                id: Id.Lit_ArithVarLike
                                                val: COUNT
                                                span_id: 363
                                              )
                                          )
                                        right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)})
                                      )
                                  )
                                }
                              spids: [361]
                            )
                          ]
                        )
                        (C {(echo)} {($ Id.VSub_DollarName '$H')})
                      ]
                    )
                )
              ]
            )
            (C {(echo)} {(DQ ($ Id.VSub_DollarName '$COUNT') (' hosts up'))})
          ]
          spids: [37 48]
        )
      ]
      else_action: [(C {(echo)} {(DQ ('Warning : no cluster definition (cluster.txt) found'))})]
    )
  ]
)