(command.CommandList
  children: [
    (command.ShFunction
      name: myping
      body: 
        (BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.Simple
                              words: [{<hash>} {<fping>}]
                              redirects: [
                                (redir
                                  op: <Id.Redir_Great '2>'>
                                  loc: (redir_loc.Fd fd:2)
                                  arg: {<'/dev/null'>}
                                )
                              ]
                              do_fork: T
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:RES)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: <Id.Left_Backtick '`'>
                                child: (C {<fping>} {<-aq>} {($ Id.VSub_Number '$1')})
                              )
                            }
                          spids: [45]
                        )
                      ]
                    )
                  ]
                  spids: [32 42]
                )
              ]
              else_action: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:RES)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (command_sub
                            left_token: <Id.Left_Backtick '`'>
                            child: 
                              (command.Pipeline
                                children: [
                                  (C {<ping>} {<-c>} {<1>} {($ Id.VSub_Number '$1')})
                                  (C {<grep>} {<ttl>})
                                ]
                                negated: F
                              )
                          )
                        }
                      spids: [60]
                    )
                  ]
                )
              ]
            )
            (C {<echo>} {($ Id.VSub_DollarName '$RES')})
          ]
        )
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (command.DBracket
                      expr: (bool_expr.Unary op_id:Id.BoolUnary_z child:{(DQ ($ Id.VSub_Number '$1'))})
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (C {<echo>} {(DQ <'Usage: '> ($ Id.VSub_Number '$0') <' environment (role)'>)})
            (command.ControlFlow token:<Id.ControlFlow_Exit exit>)
          ]
          spids: [89 102]
        )
      ]
      else_action: [
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:ENVIRONMENT)
              op: assign_op.Equal
              rhs: {(DQ ($ Id.VSub_Number '$1'))}
              spids: [119]
            )
          ]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:ROLE_REQUESTED)
          op: assign_op.Equal
          rhs: {(DQ ($ Id.VSub_Number '$2'))}
          spids: [126]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (command.DBracket
                      expr: (bool_expr.Unary op_id:Id.BoolUnary_f child:{<cluster.txt>})
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (command.WhileUntil
              keyword: <Id.KW_While while>
              cond: 
                (condition.Shell
                  commands: [
                    (command.Sentence
                      child: 
                        (C {<read>} {<HOSTNAME>} {<MACADDR>} {<IPADDR>} {<ILOIPADDR>} {<DOMAIN>} {<ROLE>})
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                )
              body: 
                (command.DoGroup
                  children: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.Sentence
                                  child: 
                                    (command.DBracket
                                      expr: 
                                        (bool_expr.Binary
                                          op_id: Id.BoolBinary_GlobEqual
                                          left: {($ Id.VSub_DollarName '$HOSTNAME')}
                                          right: {(DQ <end>)}
                                        )
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                            )
                          action: [(command.ControlFlow token:<Id.ControlFlow_Continue continue>)]
                          spids: [165 180]
                        )
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.Sentence
                                  child: 
                                    (command.DBracket
                                      expr: 
                                        (bool_expr.LogicalOr
                                          left: 
                                            (bool_expr.Unary
                                              op_id: Id.BoolUnary_z
                                              child: {(DQ ($ Id.VSub_DollarName '$ROLE_REQUESTED'))}
                                            )
                                          right: 
                                            (bool_expr.Binary
                                              op_id: Id.BoolBinary_GlobEqual
                                              left: {(DQ ($ Id.VSub_DollarName '$ROLE'))}
                                              right: {(DQ ($ Id.VSub_DollarName '$ROLE_REQUESTED'))}
                                            )
                                        )
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                            )
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:HOSTS)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (DQ ($ Id.VSub_DollarName '$HOSTS') <' '> 
                                        ($ Id.VSub_DollarName '$HOSTNAME')
                                      )
                                    }
                                  spids: [217]
                                )
                              ]
                            )
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:IPS)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (DQ ($ Id.VSub_DollarName '$IPS') <' '> 
                                        ($ Id.VSub_DollarName '$IPADDR')
                                      )
                                    }
                                  spids: [225]
                                )
                              ]
                            )
                          ]
                          spids: [189 214]
                        )
                      ]
                    )
                  ]
                )
              redirects: [(redir op:<Id.Redir_Less '<'> loc:(redir_loc.Fd fd:0) arg:{<cluster.txt>})]
            )
            (C {<echo>} {(DQ <'HOSTS = '> ($ Id.VSub_DollarName '$HOSTS'))})
            (command.ForEach
              iter_name: HOST
              iter_words: [{($ Id.VSub_DollarName '$IPS')}]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:RES)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: <Id.Left_Backtick '`'>
                                child: (C {<myping>} {($ Id.VSub_DollarName '$HOST')})
                              )
                            }
                          spids: [263]
                        )
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.Sentence
                                  child: 
                                    (command.DBracket
                                      expr: 
                                        (bool_expr.Unary
                                          op_id: Id.BoolUnary_z
                                          child: {($ Id.VSub_DollarName '$RES')}
                                        )
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                            )
                          action: [
                            (C {<echo>} {($ Id.VSub_DollarName '$HOST')} {<is>} {<down>})
                            (command.ControlFlow
                              token: <Id.ControlFlow_Continue continue>
                            )
                          ]
                          spids: [273 284]
                        )
                      ]
                      else_action: [(C {<echo>} {($ Id.VSub_DollarName '$HOST')} {<is>} {<up>})]
                    )
                    (C {<'./nodessh.sh'>} {($ Id.VSub_DollarName '$ENVIRONMENT')} 
                      {($ Id.VSub_DollarName '$HOST')} {(DQ <chef-client>)} {<sudo>}
                    )
                  ]
                )
            )
          ]
          spids: [131 142]
        )
      ]
    )
  ]
)