(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:SNMPD)
          op: assign_op.Equal
          rhs: {<'/usr/local/bin/bsnmpd'>}
          spids: [99]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:PID)
          op: assign_op.Equal
          rhs: {<'/var/run/snmpd.pid'>}
          spids: [102]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:CONF)
          op: assign_op.Equal
          rhs: {<'/etc/snmpd.conf'>}
          spids: [105]
        )
      ]
    )
    (command.Case
      to_match: {(DQ ($ Id.VSub_Number '$1'))}
      arms: [
        (case_arm
          pat_list: [{<start>}]
          action: [
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {<-r>} {(${ Id.VSub_Name PID)} 
                              {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.Sentence
                                  child: 
                                    (C {<kill>} {<-0>} 
                                      {
                                        (command_sub
                                          left_token: <Id.Left_Backtick '`'>
                                          child: (C {<cat>} {(${ Id.VSub_Name PID)})
                                        )
                                      }
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                            )
                          action: [
                            (command.Simple
                              words: [
                                {<echo>}
                                {
                                  (DQ <'snmpd already running -- pid '> 
                                    (command_sub
                                      left_token: <Id.Left_Backtick '`'>
                                      child: (C {<cat>} {(${ Id.VSub_Name PID)})
                                    )
                                  )
                                }
                              ]
                              redirects: [
                                (redir
                                  op: <Id.Redir_Great '>'>
                                  loc: (redir_loc.Fd fd:1)
                                  arg: {<'/dev/stderr'>}
                                )
                              ]
                              do_fork: T
                            )
                            (command.ControlFlow
                              token: <Id.ControlFlow_Exit exit>
                              arg_word: {<1>}
                            )
                          ]
                          spids: [139 157]
                        )
                      ]
                    )
                    (C {<rm>} {<-f>} {(${ Id.VSub_Name PID)})
                  ]
                  spids: [122 136]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {(${ Id.VSub_Name SNMPD)} {<-c>} {(${ Id.VSub_Name CONF)} {<-p>} 
                              {(${ Id.VSub_Name PID)}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [(C {<echo>} {(DQ <'snmpd started'>)})]
                  spids: [199 219]
                )
              ]
            )
          ]
          spids: [118 119 232 -1]
        )
        (case_arm
          pat_list: [{<stop>}]
          action: [
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {<-r>} {(${ Id.VSub_Name PID)} 
                              {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.Sentence
                                  child: 
                                    (C {<kill>} {<-0>} 
                                      {
                                        (command_sub
                                          left_token: <Id.Left_Backtick '`'>
                                          child: (C {<cat>} {(${ Id.VSub_Name PID)})
                                        )
                                      }
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                            )
                          action: [
                            (command.If
                              arms: [
                                (if_arm
                                  cond: 
                                    (condition.Shell
                                      commands: [
                                        (command.Sentence
                                          child: 
                                            (C {<kill>} {<-15>} 
                                              {
                                                (command_sub
                                                  left_token: <Id.Left_Backtick '`'>
                                                  child: (C {<cat>} {(${ Id.VSub_Name PID)})
                                                )
                                              }
                                            )
                                          terminator: <Id.Op_Semi _>
                                        )
                                      ]
                                    )
                                  action: [
                                    (C {<echo>} {(DQ <'snmpd stopped'>)})
                                    (command.ControlFlow
                                      token: <Id.ControlFlow_Exit exit>
                                      arg_word: {<0>}
                                    )
                                  ]
                                  spids: [277 295]
                                )
                              ]
                            )
                            (command.Simple
                              words: [{<echo>} {(DQ <'cannot kill snmpd'>)}]
                              redirects: [
                                (redir
                                  op: <Id.Redir_Great '>'>
                                  loc: (redir_loc.Fd fd:1)
                                  arg: {<'/dev/stderr'>}
                                )
                              ]
                              do_fork: T
                            )
                            (command.ControlFlow
                              token: <Id.ControlFlow_Exit exit>
                              arg_word: {<1>}
                            )
                          ]
                          spids: [256 274]
                        )
                      ]
                    )
                    (command.Simple
                      words: [{<echo>} {(DQ <'stale pid file -- removing'>)}]
                      redirects: [
                        (redir
                          op: <Id.Redir_Great '>'>
                          loc: (redir_loc.Fd fd:1)
                          arg: {<'/dev/stderr'>}
                        )
                      ]
                      do_fork: T
                    )
                    (C {<rm>} {<-f>} {(${ Id.VSub_Name PID)})
                    (command.ControlFlow
                      token: <Id.ControlFlow_Exit exit>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [239 253]
                )
              ]
            )
            (command.Simple
              words: [{<echo>} {(DQ <'snmpd not running'>)}]
              redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<'/dev/stderr'>})]
              do_fork: T
            )
          ]
          spids: [235 236 368 -1]
        )
        (case_arm
          pat_list: [{<status>}]
          action: [
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {<-r>} {(${ Id.VSub_Name PID)} 
                              {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [(C {<echo>} {(DQ <'snmpd not running'>)})]
                  spids: [375 391]
                )
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<kill>} {<-0>} 
                              {
                                (command_sub
                                  left_token: <Id.Left_Backtick '`'>
                                  child: (C {<cat>} {(${ Id.VSub_Name PID)})
                                )
                              }
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (C {<echo>} 
                      {
                        (DQ <'snmpd pid '> 
                          (command_sub
                            left_token: <Id.Left_Backtick '`'>
                            child: (C {<cat>} {(${ Id.VSub_Name PID)})
                          )
                        )
                      }
                    )
                  ]
                  spids: [401 419]
                )
              ]
              else_action: [
                (C {<echo>} 
                  {
                    (DQ <'stale pid file -- pid '> 
                      (command_sub
                        left_token: <Id.Left_Backtick '`'>
                        child: (C {<cat>} {(${ Id.VSub_Name PID)})
                      )
                    )
                  }
                )
              ]
            )
          ]
          spids: [371 372 460 -1]
        )
        (case_arm
          pat_list: [{<Id.Lit_Star '*'>}]
          action: [
            (C {<echo>} 
              {
                (DQ <'usage: '> 
                  (command_sub
                    left_token: <Id.Left_Backtick '`'>
                    child: (C {<basename>} {($ Id.VSub_Number '$0')})
                  ) <' {start|stop|status}'>
                )
              }
            )
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})
          ]
          spids: [463 464 -1 486]
        )
      ]
    )
    (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<0>})
  ]
)