(command.CommandList
  children: [
    (C {<shopt>} {<-s>} {<nullglob>})
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:SYSCTL)
          op: assign_op.Equal
          rhs: {<'/usr/bin/systemctl'>}
          spids: [10]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:DIAG)
          op: assign_op.Equal
          rhs: {<'/diagnostic'>}
          spids: [13]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (C {<Id.Lit_LBracket '['>} {($ Id.VSub_Pound '$#')} {<-eq>} {<3>} 
                      {<Id.Lit_RBracket ']'>}
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:app)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$1')}
                  spids: [33]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:root_dir)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$2')}
                  spids: [37]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:target)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$3')}
                  spids: [41]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:status)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: 
                          (C {(${ Id.VSub_Name SYSCTL)} {<show>} {<--property>} {<ExecMainStatus>} 
                            {(DQ (${ Id.VSub_Name app) <.service>)}
                          )
                      )
                    }
                  spids: [45]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:status)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ 
                        (braced_var_sub
                          token: <Id.VSub_Name status>
                          suffix_op: 
                            (suffix_op.Unary
                              tok: <Id.VOp1_Pound '#'>
                              arg_word: {<Id.Lit_Other '*'> <'='>}
                            )
                        )
                      )
                    }
                  spids: [66]
                )
              ]
            )
            (command.Simple
              words: [{<echo>} {(DQ (${ Id.VSub_Name status))}]
              redirects: [
                (redir
                  op: <Id.Redir_Great '>'>
                  loc: (redir_loc.Fd fd:1)
                  arg: {(DQ <'/rkt/status/'> ($ Id.VSub_DollarName '$app'))}
                )
              ]
              do_fork: T
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {(DQ (${ Id.VSub_Name status))} 
                              {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {<0>} {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.Sentence
                                  child: 
                                    (C {<Id.Lit_LBracket '['>} {<-n>} 
                                      {(DQ ($ Id.VSub_DollarName '$EXIT_POD'))} {<Id.Lit_RBracket ']'>}
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                            )
                          action: [
                            (command.Simple
                              words: [
                                {(${ Id.VSub_Name SYSCTL)}
                                {<Id.ControlFlow_Exit exit>}
                                {
                                  (braced_var_sub
                                    token: <Id.VSub_Name status>
                                    suffix_op: 
                                      (suffix_op.Unary
                                        tok: <Id.VOp1_Pound '#'>
                                        arg_word: {<Id.Lit_Other '*'> <'='>}
                                      )
                                  )
                                }
                              ]
                              redirects: [
                                (redir
                                  op: <Id.Redir_Great '2>'>
                                  loc: (redir_loc.Fd fd:2)
                                  arg: {<'/dev/null'>}
                                )
                              ]
                              do_fork: T
                            )
                          ]
                          spids: [131 145]
                        )
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.Sentence
                                  child: 
                                    (C {<Id.Lit_LBracket '['>} {(DQ (${ Id.VSub_Name status))} 
                                      {<Id.Lit_Equals '='> <Id.Lit_Equals '='>} {<203>} {<Id.Lit_RBracket ']'>}
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                            )
                          action: [
                            (command.Simple
                              words: [
                                {(DQ (${ Id.VSub_Name DIAG))}
                                {(DQ (${ Id.VSub_Name root_dir))}
                                {(DQ (${ Id.VSub_Name target))}
                              ]
                              redirects: [
                                (redir
                                  op: <Id.Redir_GreatAnd '2>&'>
                                  loc: (redir_loc.Fd fd:2)
                                  arg: {<1>}
                                )
                              ]
                              do_fork: T
                            )
                          ]
                          spids: [172 190]
                        )
                      ]
                    )
                  ]
                  spids: [93 112]
                )
              ]
            )
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<0>})
          ]
          spids: [17 30]
        )
      ]
    )
  ]
)