(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: [
            (command.Sentence
              child: 
                (C {(Id.Lit_LBracket '[')} {($ Id.VSub_Pound '$#')} {(-eq)} {(3)} {(Id.Lit_RBracket ']')})
              terminator: (Token id:Id.Op_Semi val:';' span_id:28)
            )
          ]
          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: (Token id:Id.Left_DollarParen val:'$(' span_id:46)
                        command_list: 
                          (command.CommandList
                            children: [
                              (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: (Token id:Id.VSub_Name val:status span_id:69)
                          suffix_op: (suffix_op.Unary op_id:Id.VOp1_Pound arg_word:{('*=')})
                        )
                      )
                    }
                  spids: [66]
                )
              ]
            )
            (command.Simple
              words: [{(echo)} {(DQ (${ Id.VSub_Name status))}]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_Great val:'>' span_id:84)
                  fd: -1
                  arg_word: {(DQ (/rkt/status/) ($ Id.VSub_DollarName '$app'))}
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {(DQ (${ Id.VSub_Name status))} 
                          {(Id.KW_Bang '!') (Id.Lit_Equals '=')} {(0)} {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:109)
                    )
                  ]
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {(Id.Lit_LBracket '[')} {(-n)} 
                                  {(DQ ($ Id.VSub_DollarName '$EXIT_POD'))} {(Id.Lit_RBracket ']')}
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:142)
                            )
                          ]
                          action: [
                            (command.Simple
                              words: [
                                {(${ Id.VSub_Name SYSCTL)}
                                {(Id.ControlFlow_Exit exit)}
                                {
                                  (braced_var_sub
                                    token: (Token id:Id.VSub_Name val:status span_id:154)
                                    suffix_op: (suffix_op.Unary op_id:Id.VOp1_Pound arg_word:{('*=')})
                                  )
                                }
                              ]
                              redirects: [
                                (redir.Redir
                                  op: (Token id:Id.Redir_Great val:'2>' span_id:159)
                                  fd: 2
                                  arg_word: {(/dev/null)}
                                )
                              ]
                            )
                          ]
                          spids: [130 144]
                        )
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {(Id.Lit_LBracket '[')} {(DQ (${ Id.VSub_Name status))} 
                                  {(Id.Lit_Equals '=') (Id.Lit_Equals '=')} {(203)} {(Id.Lit_RBracket ']')}
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:186)
                            )
                          ]
                          action: [
                            (command.Simple
                              words: [
                                {(DQ (${ Id.VSub_Name DIAG))}
                                {(DQ (${ Id.VSub_Name root_dir))}
                                {(DQ (${ Id.VSub_Name target))}
                              ]
                              redirects: [
                                (redir.Redir
                                  op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:209)
                                  fd: 2
                                  arg_word: {(1)}
                                )
                              ]
                            )
                          ]
                          spids: [170 188]
                        )
                      ]
                    )
                  ]
                  spids: [92 111]
                )
              ]
            )
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Exit val:exit span_id:219)
              arg_word: {(0)}
            )
          ]
          spids: [17 30]
        )
      ]
    )
  ]
)