(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'NETDOWN='> name:NETDOWN)
          op: assign_op.Equal
          rhs: {<yes>}
          spids: [31]
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'PATH='> name:PATH)
          op: assign_op.Equal
          rhs: 
            {<'/sbin'> <Id.Lit_Colon ':'> <'/usr/sbin'> <Id.Lit_Colon ':'> <'/bin'> <Id.Lit_Colon ':'> 
              <'/usr/bin'>
            }
          spids: [35]
        )
      ]
      redirects: []
    )
    (command.AndOr
      ops: [Id.Op_DAmp]
      children: [
        (C {<Id.Lit_LBracket '['>} {<-f>} {<'/etc/default/halt'>} {<Id.Lit_RBracket ']'>})
        (C {<.>} {<'/etc/default/halt'>})
      ]
    )
    (C {<.>} {<'/lib/lsb/init-functions'>})
    (command.ShFunction
      name: do_stop
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName INIT_HALT))} 
                          {<Id.Lit_Equals '='>} {(DQ )} {<Id.Lit_RBracket ']'>}
                        )
                      ]
                    )
                  action: [
                    (command.Case
                      to_match: {(DQ ($ Id.VSub_DollarName HALT))}
                      arms: [
                        (case_arm
                          pat_list: [
                            {<Id.Lit_LBracket '['> <Pp> <Id.Lit_RBracket ']'> <Id.Lit_Star '*'>}
                          ]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: 
                                    (sh_lhs_expr.Name
                                      left: <Id.Lit_VarLike 'INIT_HALT='>
                                      name: INIT_HALT
                                    )
                                  op: assign_op.Equal
                                  rhs: {<POWEROFF>}
                                  spids: [107]
                                )
                              ]
                              redirects: []
                            )
                          ]
                          spids: [100 104 111 -1]
                        )
                        (case_arm
                          pat_list: [
                            {<Id.Lit_LBracket '['> <Hh> <Id.Lit_RBracket ']'> <Id.Lit_Star '*'>}
                          ]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: 
                                    (sh_lhs_expr.Name
                                      left: <Id.Lit_VarLike 'INIT_HALT='>
                                      name: INIT_HALT
                                    )
                                  op: assign_op.Equal
                                  rhs: {<HALT>}
                                  spids: [121]
                                )
                              ]
                              redirects: []
                            )
                          ]
                          spids: [114 118 125 -1]
                        )
                        (case_arm
                          pat_list: [{<Id.Lit_Star '*'>}]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: 
                                    (sh_lhs_expr.Name
                                      left: <Id.Lit_VarLike 'INIT_HALT='>
                                      name: INIT_HALT
                                    )
                                  op: assign_op.Equal
                                  rhs: {<POWEROFF>}
                                  spids: [132]
                                )
                              ]
                              redirects: []
                            )
                          ]
                          spids: [128 129 136 -1]
                        )
                      ]
                      redirects: []
                    )
                  ]
                  spids: [72 88]
                )
              ]
              else_action: []
              redirects: []
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.AndOr
                          ops: [Id.Op_DAmp]
                          children: [
                            (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName INIT_HALT))} 
                              {<Id.Lit_Equals '='>} {(DQ <POWEROFF>)} {<Id.Lit_RBracket ']'>}
                            )
                            (C {<Id.Lit_LBracket '['>} {<-x>} {<'/etc/init.d/ups-monitor'>} 
                              {<Id.Lit_RBracket ']'>}
                            )
                          ]
                        )
                      ]
                    )
                  action: [(C {<'/etc/init.d/ups-monitor'>} {<poweroff>})]
                  spids: [150 177]
                )
              ]
              else_action: []
              redirects: []
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'hddown='> name:hddown)
                  op: assign_op.Equal
                  rhs: {(DQ <-h>)}
                  spids: [193]
                )
              ]
              redirects: []
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [(C {<grep>} {<-qs>} {(SQ <'^md.*active'>)} {<'/proc/mdstat'>})]
                    )
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'hddown='> name:hddown)
                          op: assign_op.Equal
                          rhs: {(DQ )}
                          spids: [215]
                        )
                      ]
                      redirects: []
                    )
                  ]
                  spids: [199 212]
                )
              ]
              else_action: []
              redirects: []
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'poweroff='> name:poweroff)
                  op: assign_op.Equal
                  rhs: {(DQ <-p>)}
                  spids: [228]
                )
              ]
              redirects: []
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName INIT_HALT))} 
                          {<Id.Lit_Equals '='>} {(DQ <HALT>)} {<Id.Lit_RBracket ']'>}
                        )
                      ]
                    )
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'poweroff='> name:poweroff)
                          op: assign_op.Equal
                          rhs: {(DQ )}
                          spids: [254]
                        )
                      ]
                      redirects: []
                    )
                  ]
                  spids: [234 251]
                )
              ]
              else_action: []
              redirects: []
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'netdown='> name:netdown)
                  op: assign_op.Equal
                  rhs: {(DQ <-i>)}
                  spids: [271]
                )
              ]
              redirects: []
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName NETDOWN))} 
                              {<Id.Lit_Equals '='>} {(DQ <no>)} {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'netdown='> name:netdown)
                          op: assign_op.Equal
                          rhs: {(DQ )}
                          spids: [297]
                        )
                      ]
                      redirects: []
                    )
                  ]
                  spids: [277 294]
                )
              ]
              else_action: []
              redirects: []
            )
            (C {<log_action_msg>} {(DQ <'Will now halt'>)})
            (C {<halt>} {<-d>} {<-f>} {($ Id.VSub_DollarName netdown)} {($ Id.VSub_DollarName poweroff)} 
              {($ Id.VSub_DollarName hddown)}
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.Case
      to_match: {(DQ ($ Id.VSub_Number 1))}
      arms: [
        (case_arm pat_list:[{<start>} {<status>}] action:[] spids:[337 340 347 -1])
        (case_arm
          pat_list: [{<restart>} {<reload>} {<force-reload>}]
          action: [
            (command.Simple
              words: [{<echo>} {(DQ <'Error: argument \''> ($ Id.VSub_Number 1) <'\' not supported'>)}]
              redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
              more_env: []
              do_fork: T
            )
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<3>})
          ]
          spids: [350 355 375 -1]
        )
        (case_arm pat_list:[{<stop>}] action:[(C {<do_stop>})] spids:[378 379 385 -1])
        (case_arm
          pat_list: [{<Id.Lit_Star '*'>}]
          action: [
            (command.Simple
              words: [{<echo>} {(DQ <'Usage: '> ($ Id.VSub_Number 0) <' start|stop'>)}]
              redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
              more_env: []
              do_fork: T
            )
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<3>})
          ]
          spids: [388 389 409 -1]
        )
      ]
      redirects: []
    )
    (C {<Id.Lit_Colon ':'>})
  ]
)