(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:PIDDIR)
          op: assign_op.Equal
          rhs: {(/var/run/samba)}
          spids: [33]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:NMBDPID)
          op: assign_op.Equal
          rhs: {($ Id.VSub_DollarName '$PIDDIR') (/nmbd.pid)}
          spids: [36]
        )
      ]
    )
    (C {(unset)} {(TMPDIR)})
    (command.AndOr
      ops: [Id.Op_DPipe]
      children: [
        (C {(test)} {(-x)} {(/usr/sbin/nmbd)})
        (command.ControlFlow
          token: (Token id:Id.ControlFlow_Exit val:exit span_id:60)
          arg_word: {(0)}
        )
      ]
    )
    (C {(.)} {(/lib/lsb/init-functions)})
    (command.Case
      to_match: {($ Id.VSub_Number '$1')}
      arms: [
        (case_arm
          pat_list: [{(start)}]
          action: [
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: (C {(init_is_upstart)})
                      terminator: (Token id:Id.Op_Semi val:';' span_id:84)
                    )
                  ]
                  action: [
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Exit val:exit span_id:89)
                      arg_word: {(1)}
                    )
                  ]
                  spids: [81 86]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:SERVER_ROLE)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: (Token id:Id.Left_Backtick val:'`' span_id:98)
                        command_list: 
                          (command.CommandList
                            children: [
                              (command.Pipeline
                                children: [
                                  (command.Simple
                                    words: [
                                      {(samba-tool)}
                                      {(testparm)}
                                      {(--parameter-name) (Id.Lit_Equals '=') (DQ ('server role'))}
                                    ]
                                    redirects: [
                                      (redir.Redir
                                        op: (Token id:Id.Redir_Great val:'2>' span_id:111)
                                        fd: 2
                                        arg_word: {(/dev/null)}
                                      )
                                    ]
                                  )
                                  (C {(tail)} {(-1)})
                                ]
                                negated: F
                              )
                            ]
                          )
                      )
                    }
                  spids: [97]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(DQ ($ Id.VSub_DollarName '$SERVER_ROLE'))} 
                          {(Id.Lit_Equals '=')} {(DQ ('active directory domain controller'))} {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:137)
                    )
                  ]
                  action: [
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Exit val:exit span_id:142)
                      arg_word: {(0)}
                    )
                  ]
                  spids: [122 139]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (C {(Id.Lit_LBracket '[')} {(-n)} 
                      {
                        (command_sub
                          left_token: (Token id:Id.Left_Backtick val:'`' span_id:157)
                          command_list: (command.CommandList children:[(C {(which)} {(testparm)})])
                        )
                      } {(Id.Lit_RBracket ']')}
                    )
                  ]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:NMBD_DISABLED)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: (Token id:Id.Left_Backtick val:'`' span_id:172)
                                command_list: 
                                  (command.CommandList
                                    children: [
                                      (command.Simple
                                        words: [
                                          {(testparm)}
                                          {(-s)}
                                          {(--parameter-name) (Id.Lit_Equals '=') 
                                            (SQ 
                                              (Token
                                                id: Id.Lit_Chars
                                                val: 'disable netbios'
                                                span_id: 182
                                              )
                                            )
                                          }
                                        ]
                                        redirects: [
                                          (redir.Redir
                                            op: (Token id:Id.Redir_Great val:'2>' span_id:185)
                                            fd: 2
                                            arg_word: {(/dev/null)}
                                          )
                                        ]
                                      )
                                    ]
                                  )
                              )
                            }
                          spids: [171]
                        )
                      ]
                    )
                  ]
                  spids: [151 168]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(DQ ($ Id.VSub_DollarName '$NMBD_DISABLED'))} 
                          {(Id.KW_Bang '!') (Id.Lit_Equals '=')} {(Yes)} {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:207)
                    )
                  ]
                  action: [
                    (C {(log_daemon_msg)} {(DQ ('Starting NetBIOS name server'))} {(nmbd)})
                    (C {(install)} {(-o)} {(root)} {(-g)} {(root)} {(-m)} {(755)} {(-d)} 
                      {($ Id.VSub_DollarName '$PIDDIR')}
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Pipeline
                              children: [
                                (C {(start-stop-daemon)} {(--start)} {(--quiet)} {(--oknodo)} {(--exec)} 
                                  {(/usr/sbin/nmbd)} {(--)} {(-D)}
                                )
                              ]
                              negated: T
                            )
                          ]
                          action: [
                            (C {(log_end_msg)} {(1)})
                            (command.ControlFlow
                              token: (Token id:Id.ControlFlow_Exit val:exit span_id:274)
                              arg_word: {(1)}
                            )
                          ]
                          spids: [245 266]
                        )
                      ]
                    )
                    (C {(log_end_msg)} {(0)})
                  ]
                  spids: [193 209]
                )
              ]
            )
          ]
          spids: [77 78 291 -1]
        )
        (case_arm
          pat_list: [{(stop)}]
          action: [
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: (C {(init_is_upstart)})
                      terminator: (Token id:Id.Op_Semi val:';' span_id:301)
                    )
                  ]
                  action: [
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Exit val:exit span_id:306)
                      arg_word: {(0)}
                    )
                  ]
                  spids: [298 303]
                )
              ]
            )
            (C {(log_daemon_msg)} {(DQ ('Stopping NetBIOS name server'))} {(nmbd)})
            (C {(start-stop-daemon)} {(--stop)} {(--quiet)} {(--pidfile)} 
              {($ Id.VSub_DollarName '$NMBDPID')}
            )
            (C {(sleep)} {(1)})
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [
                        (C {(Id.Lit_LBracket '[')} {(-f)} {($ Id.VSub_DollarName '$NMBDPID')} 
                          {(Id.Lit_RBracket ']')}
                        )
                        (command.Pipeline
                          children: [
                            (command.Simple
                              words: [
                                {(ps)}
                                {(h)}
                                {
                                  (command_sub
                                    left_token: (Token id:Id.Left_Backtick val:'`' span_id:363)
                                    command_list: 
                                      (command.CommandList
                                        children: [(C {(cat)} {($ Id.VSub_DollarName '$NMBDPID')})]
                                      )
                                  )
                                }
                              ]
                              redirects: [
                                (redir.Redir
                                  op: (Token id:Id.Redir_Great val:'>' span_id:371)
                                  fd: -1
                                  arg_word: {(/dev/null)}
                                )
                              ]
                            )
                          ]
                          negated: T
                        )
                      ]
                    )
                  ]
                  action: [(C {(rm)} {(-f)} {($ Id.VSub_DollarName '$NMBDPID')})]
                  spids: [345 376]
                )
              ]
            )
            (C {(log_end_msg)} {(0)})
          ]
          spids: [294 295 404 -1]
        )
        (case_arm
          pat_list: [{(restart)} {(force-reload)}]
          action: [
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: (C {(init_is_upstart)})
                      terminator: (Token id:Id.Op_Semi val:';' span_id:416)
                    )
                  ]
                  action: [
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Exit val:exit span_id:421)
                      arg_word: {(1)}
                    )
                  ]
                  spids: [413 418]
                )
              ]
            )
            (C {($ Id.VSub_Number '$0')} {(stop)})
            (C {(sleep)} {(1)})
            (C {($ Id.VSub_Number '$0')} {(start)})
          ]
          spids: [407 410 444 -1]
        )
        (case_arm
          pat_list: [{(status)}]
          action: [
            (C {(status_of_proc)} {(-p)} {($ Id.VSub_DollarName '$NMBDPID')} {(/usr/sbin/nmbd)} {(nmbd)})
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Exit val:exit span_id:462)
              arg_word: {($ Id.VSub_QMark '$?')}
            )
          ]
          spids: [447 448 467 -1]
        )
        (case_arm
          pat_list: [{(Id.Lit_Star '*')}]
          action: [
            (C {(echo)} {(DQ ('Usage: /etc/init.d/nmbd {start|stop|restart|force-reload|status}'))})
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Exit val:exit span_id:481)
              arg_word: {(1)}
            )
          ]
          spids: [470 471 486 -1]
        )
      ]
    )
    (command.ControlFlow token:(Token id:Id.ControlFlow_Exit val:exit span_id:491) arg_word:{(0)})
  ]
)