(command.CommandList
  children: [
    (C {(set)} {(-e)})
    (command.Case
      to_match: {($ 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 16777215]
        )
        (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 16777215]
        )
        (case_arm
          pat_list: [{(reload)}]
          action: [(C {(/etc/init.d/smbd)} {(reload)})]
          spids: [91 92 100 16777215]
        )
        (case_arm
          pat_list: [{(restart)} {(force-reload)}]
          action: [
            (C {(/etc/init.d/nmbd)} {(DQ ($ VSub_Number '$1'))})
            (C {(/etc/init.d/smbd)} {(DQ ($ VSub_Number '$1'))})
            (C {(/etc/init.d/samba-ad-dc)} {(DQ ($ VSub_Number '$1'))})
          ]
          spids: [103 106 130 16777215]
        )
        (case_arm
          pat_list: [{(status)}]
          action: [
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:status spids:[137])
                  op: Equal
                  rhs: {(0)}
                  spids: [137]
                )
              ]
              spids: [137]
            )
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:NMBD_DISABLED spids:[141])
                  op: Equal
                  rhs: 
                    {
                      (word_part.CommandSubPart
                        command_list: 
                          (command.CommandList
                            children: [
                              (command.AndOr
                                ops: [Op_DPipe]
                                children: [
                                  (command.SimpleCommand
                                    words: [
                                      {(testparm)}
                                      {(-s)}
                                      {(--parameter-name) (Lit_Other '=') (SQ <'disable netbios'>)}
                                    ]
                                    redirects: [
                                      (redir.Redir
                                        op: <Redir_Great '2>'>
                                        fd: 2
                                        arg_word: {(/dev/null)}
                                      )
                                    ]
                                  )
                                  (C {(true)})
                                ]
                              )
                            ]
                          )
                        left_token: <Left_Backtick '`'>
                        spids: [142 161]
                      )
                    }
                  spids: [141]
                )
              ]
              spids: [141]
            )
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:SERVER_ROLE spids:[164])
                  op: Equal
                  rhs: 
                    {
                      (word_part.CommandSubPart
                        command_list: 
                          (command.CommandList
                            children: [
                              (command.AndOr
                                ops: [Op_DPipe]
                                children: [
                                  (command.Pipeline
                                    children: [
                                      (command.SimpleCommand
                                        words: [
                                          {(samba-tool)}
                                          {(testparm)}
                                          {(--parameter-name) (Lit_Other '=') (DQ ('server role'))}
                                        ]
                                        redirects: [
                                          (redir.Redir
                                            op: <Redir_Great '2>'>
                                            fd: 2
                                            arg_word: {(/dev/null)}
                                          )
                                        ]
                                      )
                                      (C {(tail)} {(-1)})
                                    ]
                                    negated: F
                                  )
                                  (C {(true)})
                                ]
                              )
                            ]
                          )
                        left_token: <Left_Backtick '`'>
                        spids: [165 190]
                      )
                    }
                  spids: [164]
                )
              ]
              spids: [164]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Lit_Other '[')} {(DQ ($ VSub_DollarName '$SERVER_ROLE'))} 
                          {(KW_Bang '!') (Lit_Other '=')} {(DQ ('active directory domain controller'))} {(Lit_Other ']')}
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {(Lit_Other '[')} {(DQ ($ VSub_DollarName '$NMBD_DISABLED'))} 
                                  {(KW_Bang '!') (Lit_Other '=')} {(DQ (Yes))} {(Lit_Other ']')}
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (command.AndOr
                              ops: [Op_DPipe]
                              children: [
                                (C {(/etc/init.d/nmbd)} {(status)})
                                (command.Assignment
                                  keyword: Assign_None
                                  pairs: [
                                    (assign_pair
                                      lhs: (lhs_expr.LhsName name:status spids:[241])
                                      op: Equal
                                      rhs: {($ VSub_QMark '$?')}
                                      spids: [241]
                                    )
                                  ]
                                  spids: [241]
                                )
                              ]
                            )
                          ]
                          spids: [16777215 232]
                        )
                      ]
                      spids: [16777215 245]
                    )
                    (command.AndOr
                      ops: [Op_DPipe]
                      children: [
                        (C {(/etc/init.d/smbd)} {(status)})
                        (command.Assignment
                          keyword: Assign_None
                          pairs: [
                            (assign_pair
                              lhs: (lhs_expr.LhsName name:status spids:[254])
                              op: Equal
                              rhs: {($ VSub_QMark '$?')}
                              spids: [254]
                            )
                          ]
                          spids: [254]
                        )
                      ]
                    )
                  ]
                  spids: [16777215 211]
                )
              ]
              else_action: [
                (command.AndOr
                  ops: [Op_DPipe]
                  children: [
                    (C {(/etc/init.d/samba-ad-dc)} {(status)})
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:status spids:[267])
                          op: Equal
                          rhs: {($ VSub_QMark '$?')}
                          spids: [267]
                        )
                      ]
                      spids: [267]
                    )
                  ]
                )
              ]
              spids: [258 271]
            )
            (command.ControlFlow
              token: <ControlFlow_Exit exit>
              arg_word: {($ VSub_DollarName '$status')}
            )
          ]
          spids: [133 134 279 16777215]
        )
        (case_arm
          pat_list: [{(Lit_Other '*')}]
          action: [
            (C {(echo)} 
              {(DQ ('Usage: /etc/init.d/samba {start|stop|reload|restart|force-reload|status}'))}
            )
            (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})
          ]
          spids: [282 283 298 16777215]
        )
      ]
      spids: [40 44 300]
    )
  ]
)