(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:PIDDIR) op:Equal rhs:{(/var/run/samba)} spids:[42])]
      spids: [42]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:SAMBAPID)
          op: Equal
          rhs: {($ VSub_Name '$PIDDIR') (/samba.pid)}
          spids: [45]
        )
      ]
      spids: [45]
    )
    (C {(unset)} {(TMPDIR)})
    (AndOr
      ops: [Op_DPipe]
      children: [
        (C {(test)} {(-x)} {(/usr/sbin/samba)} {(-a)} {(-r)} {(/etc/samba/smb.conf)})
        (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)})
      ]
    )
    (C {(.)} {(/lib/lsb/init-functions)})
    (Case
      to_match: {(DQ ($ VSub_Number '$1'))}
      arms: [
        (case_arm
          pat_list: [{(start)}]
          action: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:SERVER_ROLE)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [
                              (Pipeline
                                children: [
                                  (SimpleCommand
                                    words: [
                                      {(samba-tool)}
                                      {(testparm)}
                                      {(--parameter-name) (Lit_Other '=') (DQ ('server role'))}
                                    ]
                                    redirects: [
                                      (Redir
                                        op_id: Redir_Great
                                        fd: 2
                                        arg_word: {(/dev/null)}
                                        spids: [110]
                                      )
                                    ]
                                  )
                                  (C {(tail)} {(-1)})
                                ]
                                negated: F
                              )
                            ]
                          )
                        left_token: <Left_Backtick '`'>
                        spids: [99 118]
                      )
                    }
                  spids: [98]
                )
              ]
              spids: [98]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$SERVER_ROLE'))} 
                          {(KW_Bang '!') (Lit_Other '=')} {(DQ ('active directory domain controller'))} {(Lit_Other ']')}
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [(ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)})]
                  spids: [16777215 139]
                )
              ]
              spids: [16777215 147]
            )
            (If
              arms: [
                (if_arm
                  cond: [(Sentence child:(C {(init_is_upstart)}) terminator:<Op_Semi ';'>)]
                  action: [(ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})]
                  spids: [16777215 156]
                )
              ]
              spids: [16777215 164]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:KEYFILE)
                  op: Equal
                  rhs: {(/var/lib/samba/private/tls/key.pem)}
                  spids: [172]
                )
              ]
              spids: [172]
            )
            (If
              arms: [
                (if_arm
                  cond: [(C {(Lit_Other '[')} {(-e)} {($ VSub_Name '$KEYFILE')} {(Lit_Other ']')})]
                  action: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:KEYPERMS)
                          op: Equal
                          rhs: 
                            {
                              (CommandSubPart
                                command_list: 
                                  (CommandList
                                    children: [
                                      (C {(stat)} {(-c)} {(Lit_Other '%') (a)} {($ VSub_Name '$KEYFILE')})
                                    ]
                                  )
                                left_token: <Left_Backtick '`'>
                                spids: [191 200]
                              )
                            }
                          spids: [190]
                        )
                      ]
                      spids: [190]
                    )
                    (If
                      arms: [
                        (if_arm
                          cond: [
                            (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$KEYPERMS'))} 
                              {(KW_Bang '!') (Lit_Other '=')} {(DQ (600))} {(Lit_Other ']')}
                            )
                          ]
                          action: [
                            (C {(echo)} 
                              {
                                (DQ ('wrong permission on ') ($ VSub_Name '$KEYFILE') (', must be 600'))
                              }
                            )
                            (C {(echo)} {(DQ ('samba will not start (CVE-2013-4475)'))})
                            (C {(echo)} 
                              {
                                (DQ 
                                  (
'Removing all tls .pem files will cause an auto-regeneration with the correct permissions.'
                                  )
                                )
                              }
                            )
                            (ControlFlow
                              token: <ControlFlow_Exit exit>
                              arg_word: {(1)}
                            )
                          ]
                          spids: [16777215 221]
                        )
                      ]
                      spids: [16777215 252]
                    )
                  ]
                  spids: [16777215 187]
                )
              ]
              spids: [16777215 255]
            )
            (C {(log_daemon_msg)} {(DQ ('Starting Samba AD DC daemon'))} {(DQ (samba))})
            (C {(install)} {(-o)} {(root)} {(-g)} {(root)} {(-m)} {(755)} {(-d)} {($ VSub_Name '$PIDDIR')})
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (Pipeline
                          children: [
                            (C {(start-stop-daemon)} {(--start)} {(--quiet)} {(--oknodo)} {(--exec)} 
                              {(/usr/sbin/samba)} {(--)} {(-D)}
                            )
                          ]
                          negated: T
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(log_end_msg)} {(1)})
                    (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})
                  ]
                  spids: [16777215 315]
                )
              ]
              spids: [16777215 328]
            )
            (C {(log_end_msg)} {(0)})
          ]
          spids: [94 95 337 16777215]
        )
        (case_arm
          pat_list: [{(stop)}]
          action: [
            (If
              arms: [
                (if_arm
                  cond: [(Sentence child:(C {(init_is_upstart)}) terminator:<Op_Semi ';'>)]
                  action: [(ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)})]
                  spids: [16777215 349]
                )
              ]
              spids: [16777215 357]
            )
            (C {(log_daemon_msg)} {(DQ ('Stopping Samba AD DC daemon'))} {(DQ (samba))})
            (C {(start-stop-daemon)} {(--stop)} {(--quiet)} {(--pidfile)} {($ VSub_Name '$SAMBAPID')})
            (C {(sleep)} {(1)})
            (If
              arms: [
                (if_arm
                  cond: [
                    (AndOr
                      ops: [Op_DAmp]
                      children: [
                        (C {(Lit_Other '[')} {(-f)} {($ VSub_Name '$SAMBAPID')} {(Lit_Other ']')})
                        (Pipeline
                          children: [
                            (SimpleCommand
                              words: [
                                {(ps)}
                                {(h)}
                                {
                                  (CommandSubPart
                                    command_list: 
                                      (CommandList
                                        children: [(C {(cat)} {($ VSub_Name '$SAMBAPID')})]
                                      )
                                    left_token: <Left_Backtick '`'>
                                    spids: [410 414]
                                  )
                                }
                              ]
                              redirects: [
                                (Redir
                                  op_id: Redir_Great
                                  fd: 16777215
                                  arg_word: {(/dev/null)}
                                  spids: [416]
                                )
                              ]
                            )
                          ]
                          negated: T
                        )
                      ]
                    )
                  ]
                  action: [(C {(rm)} {(-f)} {($ VSub_Name '$SAMBAPID')})]
                  spids: [16777215 421]
                )
              ]
              spids: [16777215 439]
            )
            (C {(log_end_msg)} {(0)})
          ]
          spids: [340 341 449 16777215]
        )
        (case_arm
          pat_list: [{(restart)} {(force-reload)}]
          action: [
            (If
              arms: [
                (if_arm
                  cond: [(Sentence child:(C {(init_is_upstart)}) terminator:<Op_Semi ';'>)]
                  action: [(ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})]
                  spids: [16777215 463]
                )
              ]
              spids: [16777215 471]
            )
            (C {($ VSub_Number '$0')} {(stop)})
            (C {(sleep)} {(1)})
            (C {($ VSub_Number '$0')} {(start)})
          ]
          spids: [452 455 489 16777215]
        )
        (case_arm
          pat_list: [{(status)}]
          action: [
            (C {(status_of_proc)} {(-p)} {($ VSub_Name '$SAMBAPID')} {(/usr/sbin/samba)} {(samba)})
            (ControlFlow token:<ControlFlow_Exit exit> arg_word:{($ VSub_QMark '$?')})
          ]
          spids: [492 493 512 16777215]
        )
        (case_arm
          pat_list: [{(Lit_Other '*')}]
          action: [
            (C {(echo)} 
              {(DQ ('Usage: /etc/init.d/samba-ad-dc {start|stop|restart|force-reload|status}'))}
            )
            (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})
          ]
          spids: [515 516 531 16777215]
        )
      ]
      spids: [85 91 533]
    )
    (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)})
  ]
)