(command.CommandList
  children: [
    (C {(Id.KW_Set set)} {(-e)})
    (command.Case
      to_match: {($ Id.VSub_Number '$1')}
      arms: [
        (case_arm
          pat_list: [{(start)}]
          action: [
            (C {(/etc/init.d/nmbd)} {(start)})
            (C {(/etc/init.d/smbd)} {(start)})
            (C {(/etc/init.d/samba-ad-dc)} {(start)})
          ]
          spids: [47 48 66 -1]
        )
        (case_arm
          pat_list: [{(stop)}]
          action: [
            (C {(/etc/init.d/samba-ad-dc)} {(stop)})
            (C {(/etc/init.d/smbd)} {(stop)})
            (C {(/etc/init.d/nmbd)} {(stop)})
          ]
          spids: [69 70 88 -1]
        )
        (case_arm
          pat_list: [{(reload)}]
          action: [(C {(/etc/init.d/smbd)} {(reload)})]
          spids: [91 92 100 -1]
        )
        (case_arm
          pat_list: [{(restart)} {(force-reload)}]
          action: [
            (C {(/etc/init.d/nmbd)} {(DQ ($ Id.VSub_Number '$1'))})
            (C {(/etc/init.d/smbd)} {(DQ ($ Id.VSub_Number '$1'))})
            (C {(/etc/init.d/samba-ad-dc)} {(DQ ($ Id.VSub_Number '$1'))})
          ]
          spids: [103 106 130 -1]
        )
        (case_arm
          pat_list: [{(status)}]
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:status)
                  op: assign_op.Equal
                  rhs: {(0)}
                  spids: [137]
                )
              ]
            )
            (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:142)
                        command_list: 
                          (command.CommandList
                            children: [
                              (command.AndOr
                                ops: [Id.Op_DPipe]
                                children: [
                                  (command.Simple
                                    words: [
                                      {(testparm)}
                                      {(-s)}
                                      {(--parameter-name) (Id.Lit_Equals '=') 
                                        (SQ (Token id:Id.Lit_Chars val:'disable netbios' span_id:152))
                                      }
                                    ]
                                    redirects: [
                                      (redir.Redir
                                        op: (Token id:Id.Redir_Great val:'2>' span_id:155)
                                        fd: 2
                                        arg_word: {(/dev/null)}
                                      )
                                    ]
                                  )
                                  (C {(true)})
                                ]
                              )
                            ]
                          )
                      )
                    }
                  spids: [141]
                )
              ]
            )
            (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:165)
                        command_list: 
                          (command.CommandList
                            children: [
                              (command.AndOr
                                ops: [Id.Op_DPipe]
                                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:178)
                                            fd: 2
                                            arg_word: {(/dev/null)}
                                          )
                                        ]
                                      )
                                      (C {(tail)} {(-1)})
                                    ]
                                    negated: F
                                  )
                                  (C {(true)})
                                ]
                              )
                            ]
                          )
                      )
                    }
                  spids: [164]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(DQ ($ Id.VSub_DollarName '$SERVER_ROLE'))} 
                          {(Id.KW_Bang '!') (Id.Lit_Equals '=')} {(DQ ('active directory domain controller'))} {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:209)
                    )
                  ]
                  action: [
                    (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 '=')} {(DQ (Yes))} {(Id.Lit_RBracket ']')}
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:230)
                            )
                          ]
                          action: [
                            (command.AndOr
                              ops: [Id.Op_DPipe]
                              children: [
                                (C {(/etc/init.d/nmbd)} {(status)})
                                (command.ShAssignment
                                  pairs: [
                                    (assign_pair
                                      lhs: (sh_lhs_expr.Name name:status)
                                      op: assign_op.Equal
                                      rhs: {($ Id.VSub_QMark '$?')}
                                      spids: [241]
                                    )
                                  ]
                                )
                              ]
                            )
                          ]
                          spids: [214 232]
                        )
                      ]
                    )
                    (command.AndOr
                      ops: [Id.Op_DPipe]
                      children: [
                        (C {(/etc/init.d/smbd)} {(status)})
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:status)
                              op: assign_op.Equal
                              rhs: {($ Id.VSub_QMark '$?')}
                              spids: [254]
                            )
                          ]
                        )
                      ]
                    )
                  ]
                  spids: [193 211]
                )
              ]
              else_action: [
                (command.AndOr
                  ops: [Id.Op_DPipe]
                  children: [
                    (C {(/etc/init.d/samba-ad-dc)} {(status)})
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:status)
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_QMark '$?')}
                          spids: [267]
                        )
                      ]
                    )
                  ]
                )
              ]
            )
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Exit val:exit span_id:274)
              arg_word: {($ Id.VSub_DollarName '$status')}
            )
          ]
          spids: [133 134 279 -1]
        )
        (case_arm
          pat_list: [{(Id.Lit_Star '*')}]
          action: [
            (C {(echo)} 
              {(DQ ('Usage: /etc/init.d/samba {start|stop|reload|restart|force-reload|status}'))}
            )
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Exit val:exit span_id:293)
              arg_word: {(1)}
            )
          ]
          spids: [282 283 298 -1]
        )
      ]
    )
  ]
)