(command.BraceGroup
  children: [
    (command.ShAssignment
      pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:INPUT) op:assign_op.Equal rhs:{<0>} spids:[75])]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.DBracket
                  expr: 
                    (bool_expr.Binary
                      op_id: Id.BoolBinary_EqualTilde
                      left: {($ Id.VSub_Number '$1')}
                      right: 
                        {<Id.Lit_Other '^'> <-> <Id.Lit_Other '?'> <Id.Lit_Other '['> <0-9> 
                          <Id.Lit_Other ']'> <Id.Lit_Other '+'> <Id.Lit_Other '$'>
                        }
                    )
                )
              terminator: <Id.Op_Semi _>
            )
          ]
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:INPUT)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$1')}
                  spids: [102]
                )
              ]
            )
          ]
          spids: [79 99]
        )
      ]
    )
    (C {<.>} {</DietPi/dietpi/func/dietpi-globals>})
    (C {<G_CHECK_ROOT_USER>})
    (C {<G_CHECK_ROOTFS_RW>})
    (C {<export>} {<Id.Lit_VarLike 'G_PROGRAM_NAME='> (SQ <DietPi-Letsencrypt>)})
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:DP_LOGFILE)
          op: assign_op.Equal
          rhs: {(DQ </var/log/dietpi-letsencrypt.log>)}
          spids: [150]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:DP_MONTHLY_CRON)
          op: assign_op.Equal
          rhs: {(DQ </etc/cron.monthly/dietpi-letsencrypt>)}
          spids: [156]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:DP_LETSENCRYPT_BINARY)
          op: assign_op.Equal
          rhs: {(DQ </usr/bin/certbot>)}
          spids: [162]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.DParen
                  child: 
                    (arith_expr.Binary
                      op_id: Id.Arith_Less
                      left: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$G_DISTRO')})
                      right: (arith_expr.ArithWord w:{<Id.Lit_Digits 4>})
                    )
                )
              terminator: <Id.Op_Semi _>
            )
          ]
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:DP_LETSENCRYPT_BINARY)
                  op: assign_op.Equal
                  rhs: {(DQ </etc/certbot_scripts/certbot-auto>)}
                  spids: [185]
                )
              ]
            )
          ]
          spids: [168 182]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:DP_WEBSERVER_INDEX)
          op: assign_op.Equal
          rhs: {<0>}
          spids: [194]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:LETSENCRYPT_INSTALLED)
          op: assign_op.Equal
          rhs: {<0>}
          spids: [202]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (C {<Id.Lit_LBracket '['>} {<-f>} {(DQ ($ Id.VSub_DollarName '$DP_LETSENCRYPT_BINARY'))} 
                  {<Id.Lit_RBracket ']'>}
                )
              terminator: <Id.Op_Semi _>
            )
          ]
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:LETSENCRYPT_INSTALLED)
                  op: assign_op.Equal
                  rhs: {<1>}
                  spids: [222]
                )
              ]
            )
          ]
          spids: [206 219]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:LETSENCRYPT_DOMAIN)
          op: assign_op.Equal
          rhs: {(DQ <mydomain.com>)}
          spids: [229]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:LETSENCRYPT_EMAIL)
          op: assign_op.Equal
          rhs: {(DQ <'myemail@email.com'>)}
          spids: [235]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:LETSENCRYPT_REDIRECT)
          op: assign_op.Equal
          rhs: {<0>}
          spids: [241]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:LETSENCRYPT_AUTORENEW)
          op: assign_op.Equal
          rhs: {<0>}
          spids: [245]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:LETSENCRYPT_KEYSIZE)
          op: assign_op.Equal
          rhs: {<4096>}
          spids: [249]
        )
      ]
    )
    (command.ShFunction
      name: Run_Lets_Encrypt
      body: 
        (command.BraceGroup
          children: [
            (C {<G_DIETPI-NOTIFY>} {<3>} {(DQ ($ Id.VSub_DollarName '$PROGRAM_NAME'))} 
              {(DQ <'Running cert'>)}
            )
            (C {<local>} {<Id.Lit_VarLike 'run_conditions_met='> <1>})
            (C {</DietPi/dietpi/dietpi-services>} {<start>})
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DParen
                          child: 
                            (arith_expr.ArithWord
                              w: 
                                {
                                  (command_sub
                                    left_token: <Id.Left_DollarParen '$('>
                                    command_list: 
                                      (command.CommandList
                                        children: [
                                          (command.Pipeline
                                            children: [
                                              (C {<ps>} {<aux>})
                                              (C {<grep>} {<-ci>} {<-m1>} {(SQ <'[a]pache'>)})
                                            ]
                                            negated: F
                                          )
                                        ]
                                      )
                                  )
                                }
                            )
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:DP_WEBSERVER_INDEX)
                          op: assign_op.Equal
                          rhs: {<0>}
                          spids: [326]
                        )
                      ]
                    )
                    (C {<G_DIETPI-NOTIFY>} {<0>} {(DQ <'Apache2 webserver detected'>)})
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.DParen
                                  child: 
                                    (arith_expr.Binary
                                      op_id: Id.Arith_GreatEqual
                                      left: 
                                        (arith_expr.ArithWord
                                          w: {($ Id.VSub_DollarName '$G_DISTRO')}
                                        )
                                      right: (arith_expr.ArithWord w:{<Id.Lit_Digits 4>})
                                    )
                                )
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:DP_LETSENCRYPT_BINARY)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (DQ ($ Id.VSub_DollarName '$DP_LETSENCRYPT_BINARY') 
                                        <' --apache'>
                                      )
                                    }
                                  spids: [356]
                                )
                              ]
                            )
                          ]
                          spids: [339 353]
                        )
                      ]
                    )
                  ]
                  spids: [296 322]
                )
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DParen
                          child: 
                            (arith_expr.ArithWord
                              w: 
                                {
                                  (command_sub
                                    left_token: <Id.Left_DollarParen '$('>
                                    command_list: 
                                      (command.CommandList
                                        children: [
                                          (command.Pipeline
                                            children: [
                                              (C {<ps>} {<aux>})
                                              (C {<grep>} {<-ci>} {<-m1>} {(SQ <'[l]ighttpd'>)})
                                            ]
                                            negated: F
                                          )
                                        ]
                                      )
                                  )
                                }
                            )
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:DP_WEBSERVER_INDEX)
                          op: assign_op.Equal
                          rhs: {<1>}
                          spids: [397]
                        )
                      ]
                    )
                    (C {<G_DIETPI-NOTIFY>} {<0>} {(DQ <'Lighttpd webserver detected'>)})
                  ]
                  spids: [367 393]
                )
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DParen
                          child: 
                            (arith_expr.ArithWord
                              w: 
                                {
                                  (command_sub
                                    left_token: <Id.Left_DollarParen '$('>
                                    command_list: 
                                      (command.CommandList
                                        children: [
                                          (command.Pipeline
                                            children: [
                                              (C {<ps>} {<aux>})
                                              (C {<grep>} {<-ci>} {<-m1>} {(SQ <'[n]ginx'>)})
                                            ]
                                            negated: F
                                          )
                                        ]
                                      )
                                  )
                                }
                            )
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:DP_WEBSERVER_INDEX)
                          op: assign_op.Equal
                          rhs: {<2>}
                          spids: [441]
                        )
                      ]
                    )
                    (C {<G_DIETPI-NOTIFY>} {<0>} {(DQ <'Nginx webserver detected'>)})
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.DParen
                                  child: 
                                    (arith_expr.Binary
                                      op_id: Id.Arith_GreatEqual
                                      left: 
                                        (arith_expr.ArithWord
                                          w: {($ Id.VSub_DollarName '$G_DISTRO')}
                                        )
                                      right: (arith_expr.ArithWord w:{<Id.Lit_Digits 4>})
                                    )
                                )
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:DP_LETSENCRYPT_BINARY)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (DQ ($ Id.VSub_DollarName '$DP_LETSENCRYPT_BINARY') <' --nginx'>)
                                    }
                                  spids: [471]
                                )
                              ]
                            )
                          ]
                          spids: [454 468]
                        )
                      ]
                    )
                  ]
                  spids: [411 437]
                )
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DParen
                          child: 
                            (arith_expr.ArithWord
                              w: 
                                {
                                  (command_sub
                                    left_token: <Id.Left_DollarParen '$('>
                                    command_list: 
                                      (command.CommandList
                                        children: [
                                          (command.Pipeline
                                            children: [
                                              (C {<ps>} {<aux>})
                                              (C {<grep>} {<-ci>} {<-m1>} {(SQ <'[m]inio'>)})
                                            ]
                                            negated: F
                                          )
                                        ]
                                      )
                                  )
                                }
                            )
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:DP_WEBSERVER_INDEX)
                          op: assign_op.Equal
                          rhs: {<3>}
                          spids: [512]
                        )
                      ]
                    )
                    (C {<G_DIETPI-NOTIFY>} {<0>} {(DQ <'Minio S3 server detected'>)})
                  ]
                  spids: [482 508]
                )
              ]
              else_action: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:run_conditions_met)
                      op: assign_op.Equal
                      rhs: {<0>}
                      spids: [530]
                    )
                  ]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DParen
                          child: 
                            (arith_expr.Unary
                              op_id: Id.Arith_Bang
                              child: 
                                (arith_expr.ArithWord
                                  w: {($ Id.VSub_DollarName '$run_conditions_met')}
                                )
                            )
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (command.Simple
                      words: [
                        {<echo>}
                        {<-e>}
                        {(DQ <'Error: No compatible and/or active webserver was found. Aborting.'>)}
                      ]
                      redirects: [
                        (redir.Redir
                          op: <Id.Redir_DGreat '>>'>
                          fd: -1
                          arg_word: {(DQ ($ Id.VSub_DollarName '$DP_LOGFILE'))}
                        )
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.DParen
                                  child: 
                                    (arith_expr.Binary
                                      op_id: Id.Arith_DEqual
                                      left: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$INPUT')})
                                      right: (arith_expr.ArithWord w:{<Id.Lit_Digits 0>})
                                    )
                                )
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                          action: [
                            (C {<whiptail>} {<--title>} {(DQ <Error>)} {<--msgbox>} 
                              {
                                (DQ 
                                  <
'Error: No compatible and/or active webserver was found. Aborting.'
                                  >
                                )
                              } {<--backtitle>} {(DQ ($ Id.VSub_DollarName '$PROGRAM_NAME'))} {<8>} {<60>}
                            )
                          ]
                          spids: [574 588]
                        )
                      ]
                    )
                  ]
                  spids: [543 555]
                )
              ]
              else_action: [
                (command.If
                  arms: [
                    (if_arm
                      cond: [
                        (command.Sentence
                          child: 
                            (command.DParen
                              child: 
                                (arith_expr.Binary
                                  op_id: Id.Arith_DEqual
                                  left: 
                                    (arith_expr.ArithWord
                                      w: {($ Id.VSub_DollarName '$DP_WEBSERVER_INDEX')}
                                    )
                                  right: (arith_expr.ArithWord w:{<Id.Lit_Digits 0>})
                                )
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                      action: [
                        (C {<local>} 
                          {<Id.Lit_VarLike 'dp_defaultsite='> 
                            (DQ </etc/apache2/sites-available/000-default.conf>)
                          }
                        )
                        (command.If
                          arms: [
                            (if_arm
                              cond: [
                                (command.Sentence
                                  child: 
                                    (command.DParen
                                      child: 
                                        (arith_expr.Unary
                                          op_id: Id.Arith_Bang
                                          child: 
                                            (arith_expr.ArithWord
                                              w: 
                                                {
                                                  (command_sub
                                                    left_token: <Id.Left_DollarParen '$('>
                                                    command_list: 
                                                      (command.CommandList
                                                        children: [
                                                          (command.Pipeline
                                                            children: [
                                                              (C {<cat>} 
                                                                {
                                                                  (DQ 
                                                                    ($ Id.VSub_DollarName 
'$dp_defaultsite'
                                                                    )
                                                                  )
                                                                }
                                                              )
                                                              (C {<grep>} {<-ci>} {<-m1>} 
                                                                {(SQ <ServerName>)}
                                                              )
                                                            ]
                                                            negated: F
                                                          )
                                                        ]
                                                      )
                                                  )
                                                }
                                            )
                                        )
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                              action: [
                                (C {<sed>} {<-i>} {(DQ <'/ServerAdmin /a ServerName'>)} 
                                  {(DQ ($ Id.VSub_DollarName '$dp_defaultsite'))}
                                )
                                (command.Simple
                                  words: [
                                    {<echo>}
                                    {<-e>}
                                    {
                                      (DQ <'ServerName entry not found in '> 
                                        ($ Id.VSub_DollarName '$dp_defaultsite') <'. Adding it now.'>
                                      )
                                    }
                                  ]
                                  redirects: [
                                    (redir.Redir
                                      op: <Id.Redir_DGreat '>>'>
                                      fd: -1
                                      arg_word: {(DQ ($ Id.VSub_DollarName '$DP_LOGFILE'))}
                                    )
                                  ]
                                )
                              ]
                              spids: [669 699]
                            )
                          ]
                        )
                        (C {<sed>} {<-i>} 
                          {
                            (DQ </ServerName/c> <Id.Lit_Other '\\'> <'        ServerName '> 
                              ($ Id.VSub_DollarName '$LETSENCRYPT_DOMAIN')
                            )
                          } {(DQ ($ Id.VSub_DollarName '$dp_defaultsite'))}
                        )
                        (C {<systemctl>} {<restart>} {<apache2>})
                        (C {<local>} {<Id.Lit_VarLike 'cli_redirect='> (DQ <--no-redirect>)})
                        (command.If
                          arms: [
                            (if_arm
                              cond: [
                                (command.Sentence
                                  child: 
                                    (command.DParen
                                      child: 
                                        (arith_expr.ArithWord
                                          w: {($ Id.VSub_DollarName '$LETSENCRYPT_REDIRECT')}
                                        )
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                              action: [
                                (command.ShAssignment
                                  pairs: [
                                    (assign_pair
                                      lhs: (sh_lhs_expr.Name name:cli_redirect)
                                      op: assign_op.Equal
                                      rhs: {(DQ <--redirect>)}
                                      spids: [798]
                                    )
                                  ]
                                )
                              ]
                              spids: [784 794]
                            )
                          ]
                        )
                        (C {($ Id.VSub_DollarName '$DP_LETSENCRYPT_BINARY')} {<--duplicate>} 
                          {<--agree-tos>} {($ Id.VSub_DollarName '$cli_redirect')} {<--rsa-key-size>} 
                          {($ Id.VSub_DollarName '$LETSENCRYPT_KEYSIZE')} {<--email>} {($ Id.VSub_DollarName '$LETSENCRYPT_EMAIL')} {<-d>} 
                          {($ Id.VSub_DollarName '$LETSENCRYPT_DOMAIN')}
                        )
                      ]
                      spids: [638 652]
                    )
                    (if_arm
                      cond: [
                        (command.Sentence
                          child: 
                            (command.DParen
                              child: 
                                (arith_expr.Binary
                                  op_id: Id.Arith_DEqual
                                  left: 
                                    (arith_expr.ArithWord
                                      w: {($ Id.VSub_DollarName '$DP_WEBSERVER_INDEX')}
                                    )
                                  right: (arith_expr.ArithWord w:{<Id.Lit_Digits 1>})
                                )
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                      action: [
                        (C {</DietPi/dietpi/dietpi-services>} {<stop>})
                        (C {($ Id.VSub_DollarName '$DP_LETSENCRYPT_BINARY')} {<certonly>} 
                          {<--standalone>} {<--duplicate>} {<--agree-tos>} {($ Id.VSub_DollarName '$cli_redirect')} {<--rsa-key-size>} 
                          {($ Id.VSub_DollarName '$LETSENCRYPT_KEYSIZE')} {<--email>} {($ Id.VSub_DollarName '$LETSENCRYPT_EMAIL')} {<-d>} 
                          {($ Id.VSub_DollarName '$LETSENCRYPT_DOMAIN')}
                        )
                        (C {<cd>} 
                          {</etc/letsencrypt/live/> (DQ ($ Id.VSub_DollarName '$LETSENCRYPT_DOMAIN'))}
                        )
                        (command.Simple
                          words: [{<cat>} {<privkey.pem>} {<cert.pem>}]
                          redirects: [
                            (redir.Redir
                              op: <Id.Redir_Great '>'>
                              fd: -1
                              arg_word: {<combined.pem>}
                            )
                          ]
                        )
                        (command.Simple
                          words: [{<cat>}]
                          redirects: [
                            (redir.HereDoc
                              op: <Id.Redir_DLess '<<'>
                              fd: -1
                              here_begin: {<_EOF_>}
                              here_end_span_id: 987
                              stdin_parts: [
                                (word_part.EscapedLiteral
                                  token: <Id.Lit_EscapedChar '\\$'>
                                )
                                <'SERVER['>
                                <Id.Right_DoubleQuote '"'>
                                <socket>
                                <Id.Right_DoubleQuote '"'>
                                <'] == '>
                                <Id.Right_DoubleQuote '"'>
                                <':443'>
                                <Id.Right_DoubleQuote '"'>
                                <' {\n'>
                                <'\t\tssl.engine = '>
                                <Id.Right_DoubleQuote '"'>
                                <enable>
                                <Id.Right_DoubleQuote '"'>
                                <'\n'>
                                <'\t\tssl.pemfile = '>
                                <Id.Right_DoubleQuote '"'>
                                </etc/letsencrypt/live/>
                                ($ Id.VSub_DollarName '$LETSENCRYPT_DOMAIN')
                                </combined.pem>
                                <Id.Right_DoubleQuote '"'>
                                <'\n'>
                                <'\t\tssl.ca-file =  '>
                                <Id.Right_DoubleQuote '"'>
                                </etc/letsencrypt/live/>
                                ($ Id.VSub_DollarName '$LETSENCRYPT_DOMAIN')
                                </fullchain.pem>
                                <Id.Right_DoubleQuote '"'>
                                <'\n'>
                                <'\t\t#ssl.cipher-list = '>
                                <Id.Right_DoubleQuote '"'>
                                <
'ECDHE-RSA-AES256-SHA384:AES256-SHA256:HIGH:!MD5:!aNULL:!EDH:!AESGCM'
                                >
                                <Id.Right_DoubleQuote '"'>
                                <'\n'>
                                <'\t\tssl.cipher-list = '>
                                <Id.Right_DoubleQuote '"'>
                                <
'ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:RSA+AESGCM:RSA+AES:!aNULL:!MD5:!DSS'
                                >
                                <Id.Right_DoubleQuote '"'>
                                <'\n'>
                                <'\t\tssl.honor-cipher-order = '>
                                <Id.Right_DoubleQuote '"'>
                                <enable>
                                <Id.Right_DoubleQuote '"'>
                                <'\n'>
                                <'\t\tssl.use-sslv2 = '>
                                <Id.Right_DoubleQuote '"'>
                                <disable>
                                <Id.Right_DoubleQuote '"'>
                                <'\n'>
                                <'\t\tssl.use-sslv3 = '>
                                <Id.Right_DoubleQuote '"'>
                                <disable>
                                <Id.Right_DoubleQuote '"'>
                                <'\n'>
                                <'}\n'>
                              ]
                            )
                            (redir.Redir
                              op: <Id.Redir_Great '>'>
                              fd: -1
                              arg_word: {</etc/lighttpd/conf-enabled/letsencrypt.conf>}
                            )
                          ]
                        )
                        (C {<rm>} {</etc/lighttpd/conf-enabled/redirect.conf>})
                        (command.If
                          arms: [
                            (if_arm
                              cond: [
                                (command.Sentence
                                  child: 
                                    (command.DParen
                                      child: 
                                        (arith_expr.ArithWord
                                          w: {($ Id.VSub_DollarName '$LETSENCRYPT_REDIRECT')}
                                        )
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                              action: [
                                (command.Simple
                                  words: [{<cat>}]
                                  redirects: [
                                    (redir.HereDoc
                                      op: <Id.Redir_DLess '<<'>
                                      fd: -1
                                      here_begin: {<_EOF_>}
                                      here_end_span_id: 1060
                                      stdin_parts: [
                                        (word_part.EscapedLiteral
                                          token: <Id.Lit_EscapedChar '\\$'>
                                        )
                                        <'HTTP['>
                                        <Id.Right_DoubleQuote '"'>
                                        <scheme>
                                        <Id.Right_DoubleQuote '"'>
                                        <'] == '>
                                        <Id.Right_DoubleQuote '"'>
                                        <http>
                                        <Id.Right_DoubleQuote '"'>
                                        <' {\n'>
                                        <
'\t# capture vhost name with regex conditiona -> %0 in redirect pattern\n'
                                        >
                                        <'\t# must be the most inner block to the redirect rule\n'>
                                        <'\t'>
                                        (word_part.EscapedLiteral
                                          token: <Id.Lit_EscapedChar '\\$'>
                                        )
                                        <'HTTP['>
                                        <Id.Right_DoubleQuote '"'>
                                        <host>
                                        <Id.Right_DoubleQuote '"'>
                                        <'] =~ '>
                                        <Id.Right_DoubleQuote '"'>
                                        <'.*'>
                                        <Id.Right_DoubleQuote '"'>
                                        <' {\n'>
                                        <'\t\turl.redirect = ('>
                                        <Id.Right_DoubleQuote '"'>
                                        <'.*'>
                                        <Id.Right_DoubleQuote '"'>
                                        <' => '>
                                        <Id.Right_DoubleQuote '"'>
                                        <'https://%0'>
                                        (word_part.EscapedLiteral
                                          token: <Id.Lit_EscapedChar '\\$'>
                                        )
                                        <0>
                                        <Id.Right_DoubleQuote '"'>
                                        <')\n'>
                                        <'\t}\n'>
                                        <'}\n'>
                                      ]
                                    )
                                    (redir.Redir
                                      op: <Id.Redir_Great '>'>
                                      fd: -1
                                      arg_word: {</etc/lighttpd/conf-enabled/redirect.conf>}
                                    )
                                  ]
                                )
                              ]
                              spids: [999 1009]
                            )
                          ]
                        )
                        (C {</etc/init.d/lighttpd>} {<force-reload>})
                      ]
                      spids: [843 857]
                    )
                    (if_arm
                      cond: [
                        (command.Sentence
                          child: 
                            (command.DParen
                              child: 
                                (arith_expr.Binary
                                  op_id: Id.Arith_DEqual
                                  left: 
                                    (arith_expr.ArithWord
                                      w: {($ Id.VSub_DollarName '$DP_WEBSERVER_INDEX')}
                                    )
                                  right: (arith_expr.ArithWord w:{<Id.Lit_Digits 2>})
                                )
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                      action: [
                        (C {<local>} 
                          {<Id.Lit_VarLike 'nginx_defaultsite='> 
                            (DQ </etc/nginx/sites-available/default>)
                          }
                        )
                        (C {<sed>} {<-i>} 
                          {
                            (DQ </server_name/c> <Id.Lit_Other '\\'> <'        server_name '> 
                              ($ Id.VSub_DollarName '$LETSENCRYPT_DOMAIN') <';'>
                            )
                          } {(DQ ($ Id.VSub_DollarName '$nginx_defaultsite'))}
                        )
                        (C {<systemctl>} {<restart>} {<nginx>})
                        (C {<local>} {<Id.Lit_VarLike 'cli_redirect='> (DQ <--no-redirect>)})
                        (command.If
                          arms: [
                            (if_arm
                              cond: [
                                (command.Sentence
                                  child: 
                                    (command.DParen
                                      child: 
                                        (arith_expr.ArithWord
                                          w: {($ Id.VSub_DollarName '$LETSENCRYPT_REDIRECT')}
                                        )
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                              action: [
                                (command.ShAssignment
                                  pairs: [
                                    (assign_pair
                                      lhs: (sh_lhs_expr.Name name:cli_redirect)
                                      op: assign_op.Equal
                                      rhs: {(DQ <--redirect>)}
                                      spids: [1167]
                                    )
                                  ]
                                )
                              ]
                              spids: [1153 1163]
                            )
                          ]
                        )
                        (C {($ Id.VSub_DollarName '$DP_LETSENCRYPT_BINARY')} {<--duplicate>} 
                          {<--agree-tos>} {($ Id.VSub_DollarName '$cli_redirect')} {<--rsa-key-size>} 
                          {($ Id.VSub_DollarName '$LETSENCRYPT_KEYSIZE')} {<--email>} {($ Id.VSub_DollarName '$LETSENCRYPT_EMAIL')} {<-d>} 
                          {($ Id.VSub_DollarName '$LETSENCRYPT_DOMAIN')}
                        )
                      ]
                      spids: [1083 1097]
                    )
                    (if_arm
                      cond: [
                        (command.Sentence
                          child: 
                            (command.DParen
                              child: 
                                (arith_expr.Binary
                                  op_id: Id.Arith_DEqual
                                  left: 
                                    (arith_expr.ArithWord
                                      w: {($ Id.VSub_DollarName '$DP_WEBSERVER_INDEX')}
                                    )
                                  right: (arith_expr.ArithWord w:{<Id.Lit_Digits 3>})
                                )
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                      action: [
                        (C {</DietPi/dietpi/dietpi-services>} {<stop>})
                        (C {($ Id.VSub_DollarName '$DP_LETSENCRYPT_BINARY')} {<certonly>} 
                          {<--standalone>} {<--preferred-challenges>} {<tls-sni>} {<--staple-ocsp>} {<--agree-tos>} 
                          {($ Id.VSub_DollarName '$cli_redirect')} {<--rsa-key-size>} {($ Id.VSub_DollarName '$LETSENCRYPT_KEYSIZE')} {<--email>} 
                          {($ Id.VSub_DollarName '$LETSENCRYPT_EMAIL')} {<-d>} {($ Id.VSub_DollarName '$LETSENCRYPT_DOMAIN')}
                        )
                        (C {<cp>} 
                          {</etc/letsencrypt/live/> ($ Id.VSub_DollarName '$LETSENCRYPT_DOMAIN') 
                            </fullchain.pem>
                          } {</home/minio-user/.minio/certs/public.crt>}
                        )
                        (C {<cp>} 
                          {</etc/letsencrypt/live/> ($ Id.VSub_DollarName '$LETSENCRYPT_DOMAIN') 
                            </privkey.pem>
                          } {</home/minio-user/.minio/certs/private.key>}
                        )
                        (C {<chown>} {<minio-user> <Id.Lit_Other ':'> <minio-user>} 
                          {</home/minio-user/.minio/certs/public.crt>}
                        )
                        (C {<chown>} {<minio-user> <Id.Lit_Other ':'> <minio-user>} 
                          {</home/minio-user/.minio/certs/private.key>}
                        )
                        (command.Simple
                          words: [{<grep>} {<-v>} {(DQ <MINIO_OPTS>)} {</etc/default/minio>}]
                          redirects: [
                            (redir.Redir
                              op: <Id.Redir_Great '>'>
                              fd: -1
                              arg_word: {</etc/default/minio.temp1>}
                            )
                          ]
                        )
                        (command.Simple
                          words: [{<grep>} {<-v>} {(DQ <port>)} {</etc/default/minio.temp1>}]
                          redirects: [
                            (redir.Redir
                              op: <Id.Redir_Great '>'>
                              fd: -1
                              arg_word: {</etc/default/minio.temp2>}
                            )
                          ]
                        )
                        (C {<rm>} {</etc/default/minio.temp1>})
                        (C {<mv>} {</etc/default/minio.temp2>} {</etc/default/minio>})
                        (command.Simple
                          words: [{<cat>}]
                          redirects: [
                            (redir.HereDoc
                              op: <Id.Redir_DLess '<<'>
                              fd: -1
                              here_begin: {<_EOF_>}
                              here_end_span_id: 1379
                              stdin_parts: [
                                <'# Use if you want to run Minio on a custom port.\n'>
                                <'MINIO_OPTS='>
                                <Id.Right_DoubleQuote '"'>
                                <'--address :443'>
                                <Id.Right_DoubleQuote '"'>
                                <'\n'>
                              ]
                            )
                            (redir.Redir
                              op: <Id.Redir_DGreat '>>'>
                              fd: -1
                              arg_word: {</etc/default/minio>}
                            )
                          ]
                        )
                        (C {<setcap>} 
                          {<Id.Lit_VarLike 'CAP_NET_BIND_SERVICE='> <Id.Lit_Other '+'> <eip>} {</usr/local/bin/minio>}
                        )
                        (command.Simple
                          words: [{<cat>}]
                          redirects: [
                            (redir.HereDoc
                              op: <Id.Redir_DLess '<<'>
                              fd: -1
                              here_begin: {<_EOF_>}
                              here_end_span_id: 1427
                              stdin_parts: [
                                <
'# Minio only works with copied and owned certs. Upon renewal the new certs needs to be copied and re-owned\n'
                                >
                                <'systemctl stop minio.service\n'>
                                <'\n'>
                                <'# Copy to correct Location\n'>
                                <'cp /etc/letsencrypt/live/'>
                                ($ Id.VSub_DollarName '$LETSENCRYPT_DOMAIN')
                                <'/fullchain.pem /home/minio-user/.minio/certs/public.crt\n'>
                                <'cp /etc/letsencrypt/live/'>
                                ($ Id.VSub_DollarName '$LETSENCRYPT_DOMAIN')
                                <'/privkey.pem /home/minio-user/.minio/certs/private.key\n'>
                                <'\n'>
                                <'# Re-Own those certs!\n'>
                                <
'chown minio-user:minio-user /home/minio-user/.minio/certs/public.crt\n'
                                >
                                <
'chown minio-user:minio-user /home/minio-user/.minio/certs/private.key\n'
                                >
                                <'\n'>
                                <'systemctl start minio.service\n'>
                              ]
                            )
                            (redir.Redir
                              op: <Id.Redir_Great '>'>
                              fd: -1
                              arg_word: {</home/minio-user/.minio/dietpi-cert-renewl.sh>}
                            )
                          ]
                        )
                        (C {<chmod>} {<Id.Lit_Other '+'> <x>} 
                          {</home/minio-user/.minio/dietpi-cert-renewl.sh>}
                        )
                      ]
                      spids: [1213 1227]
                    )
                  ]
                )
                (command.If
                  arms: [
                    (if_arm
                      cond: [
                        (command.Sentence
                          child: 
                            (command.DParen
                              child: 
                                (arith_expr.Binary
                                  op_id: Id.Arith_DAmp
                                  left: 
                                    (arith_expr.ArithWord
                                      w: {($ Id.VSub_DollarName '$LETSENCRYPT_AUTORENEW')}
                                    )
                                  right: 
                                    (arith_expr.Binary
                                      op_id: Id.Arith_Less
                                      left: 
                                        (arith_expr.ArithWord
                                          w: {($ Id.VSub_DollarName '$G_DISTRO')}
                                        )
                                      right: (arith_expr.ArithWord w:{<Id.Lit_Digits 4>})
                                    )
                                )
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                      action: [
                        (command.Simple
                          words: [{<cat>}]
                          redirects: [
                            (redir.HereDoc
                              op: <Id.Redir_DLess '<<'>
                              fd: -1
                              here_begin: {<_EOF_>}
                              here_end_span_id: 1538
                              stdin_parts: [
                                <'#!/bin/bash\n'>
                                <'{\n'>
                                <'\t#////////////////////////////////////\n'>
                                <'\t# DietPi-LetsEncrypt Autorenew script\n'>
                                <'\t#\n'>
                                <'\t#////////////////////////////////////\n'>
                                <'\t#\n'>
                                <'\t# Info:\n'>
                                <'\t# - Location '>
                                ($ Id.VSub_DollarName '$DP_MONTHLY_CRON')
                                <'\n'>
                                <'\t#\n'>
                                <'\t#////////////////////////////////////\n'>
                                <'\n'>
                                <
'\t#----------------------------------------------------------------\n'
                                >
                                <'\t# Main Loop\n'>
                                <
'\t#----------------------------------------------------------------\n'
                                >
                                <'\t/DietPi/dietpi/dietpi-letsencrypt 1 &>> '>
                                ($ Id.VSub_DollarName '$DP_LOGFILE')
                                <'\n'>
                                <'\n'>
                                <'\t# Minio specific applications\n'>
                                <'\tif (( '>
                                (command_sub
                                  left_token: <Id.Left_DollarParen '$('>
                                  command_list: 
                                    (command.CommandList
                                      children: [
                                        (command.Pipeline
                                          children: [
                                            (C {<ps>} {<aux>})
                                            (C {<grep>} {<-ci>} {<-m1>} {(SQ <'[m]inio'>)})
                                          ]
                                          negated: F
                                        )
                                      ]
                                    )
                                )
                                <' )); then\n'>
                                <'\t\t/home/minio-user/.minio/dietpi-cert-renewl.sh\n'>
                                <'\tfi\n'>
                                <'\n'>
                                <
'\t#----------------------------------------------------------------\n'
                                >
                                <'\texit\n'>
                                <
'\t#----------------------------------------------------------------\n'
                                >
                                <'}\n'>
                              ]
                            )
                            (redir.Redir
                              op: <Id.Redir_Great '>'>
                              fd: -1
                              arg_word: {(DQ ($ Id.VSub_DollarName '$DP_MONTHLY_CRON'))}
                            )
                          ]
                        )
                        (C {<chmod>} {<Id.Lit_Other '+'> <x>} 
                          {(DQ ($ Id.VSub_DollarName '$DP_MONTHLY_CRON'))}
                        )
                      ]
                      spids: [1455 1473]
                    )
                  ]
                )
                (command.If
                  arms: [
                    (if_arm
                      cond: [
                        (command.Sentence
                          child: 
                            (command.DParen
                              child: 
                                (arith_expr.Binary
                                  op_id: Id.Arith_DEqual
                                  left: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$INPUT')})
                                  right: (arith_expr.ArithWord w:{<Id.Lit_Digits 0>})
                                )
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                      action: [
                        (C {<echo>} {<-e>} {(DQ )})
                        (C {<read>} {<-p>} {(DQ <'Press any key to continue...'>)})
                        (C {<echo>} {<-e>} {(DQ )})
                      ]
                      spids: [1555 1569]
                    )
                  ]
                )
                (C {</DietPi/dietpi/dietpi-services>} {<restart>})
              ]
            )
          ]
        )
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:DP_SETTINGS)
          op: assign_op.Equal
          rhs: {(DQ </DietPi/dietpi/.dietpi-letsencrypt>)}
          spids: [1633]
        )
      ]
    )
    (command.ShFunction
      name: Read_Settings_File
      body: 
        (command.BraceGroup
          children: [
            (C {<local>} {<Id.Lit_VarLike 'sed_index='> <1>})
            (command.Sentence
              child: 
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:LETSENCRYPT_DOMAIN)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (command_sub
                            left_token: <Id.Left_DollarParen '$('>
                            command_list: 
                              (command.CommandList
                                children: [
                                  (C {<sed>} {<-n>} {(DQ ($ Id.VSub_DollarName '$sed_index')) <p>} 
                                    {($ Id.VSub_DollarName '$DP_SETTINGS')}
                                  )
                                ]
                              )
                          )
                        }
                      spids: [1654]
                    )
                  ]
                )
              terminator: <Id.Op_Semi _>
            )
            (command.DParen
              child: 
                (arith_expr.UnaryAssign
                  op_id: Id.Node_PostDPlus
                  child: (sh_lhs_expr.Name name:sed_index)
                )
            )
            (command.Sentence
              child: 
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:LETSENCRYPT_EMAIL)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (command_sub
                            left_token: <Id.Left_DollarParen '$('>
                            command_list: 
                              (command.CommandList
                                children: [
                                  (C {<sed>} {<-n>} {(DQ ($ Id.VSub_DollarName '$sed_index')) <p>} 
                                    {($ Id.VSub_DollarName '$DP_SETTINGS')}
                                  )
                                ]
                              )
                          )
                        }
                      spids: [1675]
                    )
                  ]
                )
              terminator: <Id.Op_Semi _>
            )
            (command.DParen
              child: 
                (arith_expr.UnaryAssign
                  op_id: Id.Node_PostDPlus
                  child: (sh_lhs_expr.Name name:sed_index)
                )
            )
            (command.Sentence
              child: 
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:LETSENCRYPT_REDIRECT)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (command_sub
                            left_token: <Id.Left_DollarParen '$('>
                            command_list: 
                              (command.CommandList
                                children: [
                                  (C {<sed>} {<-n>} {(DQ ($ Id.VSub_DollarName '$sed_index')) <p>} 
                                    {($ Id.VSub_DollarName '$DP_SETTINGS')}
                                  )
                                ]
                              )
                          )
                        }
                      spids: [1696]
                    )
                  ]
                )
              terminator: <Id.Op_Semi _>
            )
            (command.DParen
              child: 
                (arith_expr.UnaryAssign
                  op_id: Id.Node_PostDPlus
                  child: (sh_lhs_expr.Name name:sed_index)
                )
            )
            (command.Sentence
              child: 
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:LETSENCRYPT_AUTORENEW)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (command_sub
                            left_token: <Id.Left_DollarParen '$('>
                            command_list: 
                              (command.CommandList
                                children: [
                                  (C {<sed>} {<-n>} {(DQ ($ Id.VSub_DollarName '$sed_index')) <p>} 
                                    {($ Id.VSub_DollarName '$DP_SETTINGS')}
                                  )
                                ]
                              )
                          )
                        }
                      spids: [1717]
                    )
                  ]
                )
              terminator: <Id.Op_Semi _>
            )
            (command.DParen
              child: 
                (arith_expr.UnaryAssign
                  op_id: Id.Node_PostDPlus
                  child: (sh_lhs_expr.Name name:sed_index)
                )
            )
            (command.Sentence
              child: 
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:LETSENCRYPT_KEYSIZE)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (command_sub
                            left_token: <Id.Left_DollarParen '$('>
                            command_list: 
                              (command.CommandList
                                children: [
                                  (C {<sed>} {<-n>} {(DQ ($ Id.VSub_DollarName '$sed_index')) <p>} 
                                    {($ Id.VSub_DollarName '$DP_SETTINGS')}
                                  )
                                ]
                              )
                          )
                        }
                      spids: [1738]
                    )
                  ]
                )
              terminator: <Id.Op_Semi _>
            )
            (command.DParen
              child: 
                (arith_expr.UnaryAssign
                  op_id: Id.Node_PostDPlus
                  child: (sh_lhs_expr.Name name:sed_index)
                )
            )
          ]
        )
    )
    (command.ShFunction
      name: Write_Settings_File
      body: 
        (command.BraceGroup
          children: [
            (command.Simple
              words: [{<cat>}]
              redirects: [
                (redir.HereDoc
                  op: <Id.Redir_DLess '<<'>
                  fd: -1
                  here_begin: {<_EOF_>}
                  here_end_span_id: 1794
                  stdin_parts: [
                    ($ Id.VSub_DollarName '$LETSENCRYPT_DOMAIN')
                    <'\n'>
                    ($ Id.VSub_DollarName '$LETSENCRYPT_EMAIL')
                    <'\n'>
                    ($ Id.VSub_DollarName '$LETSENCRYPT_REDIRECT')
                    <'\n'>
                    ($ Id.VSub_DollarName '$LETSENCRYPT_AUTORENEW')
                    <'\n'>
                    ($ Id.VSub_DollarName '$LETSENCRYPT_KEYSIZE')
                    <'\n'>
                  ]
                )
                (redir.Redir
                  op: <Id.Redir_Great '>'>
                  fd: -1
                  arg_word: {(DQ ($ Id.VSub_DollarName '$DP_SETTINGS'))}
                )
              ]
            )
          ]
        )
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:PROGRAM_NAME)
          op: assign_op.Equal
          rhs: {(DQ <DietPi-LetsEncrypt>)}
          spids: [1813]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:CHOICE)
          op: assign_op.Equal
          rhs: {<0>}
          spids: [1820]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:OPTION)
          op: assign_op.Equal
          rhs: {<0>}
          spids: [1824]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:TARGETMENUID)
          op: assign_op.Equal
          rhs: {<0>}
          spids: [1828]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:PREVIOUS_MENU_SELECTION)
          op: assign_op.Equal
          rhs: {(DQ )}
          spids: [1832]
        )
      ]
    )
    (command.ShFunction
      name: Menu_Exit
      body: 
        (command.BraceGroup
          children: [
            (C {<whiptail>} {<--title>} {(DQ <'Exit '> ($ Id.VSub_DollarName '$PROGRAM_NAME') <'?'>)} 
              {<--yesno>} {(DQ <'Exit '> ($ Id.VSub_DollarName '$PROGRAM_NAME') <'?'>)} {<--backtitle>} 
              {(DQ ($ Id.VSub_DollarName '$PROGRAM_NAME'))} {<--yes-button>} {(DQ <Ok>)} {<--no-button>} {(DQ <Back>)} {<--defaultno>} {<9>} {<55>}
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:CHOICE)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_QMark '$?')}
                  spids: [1888]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DParen
                          child: 
                            (arith_expr.Binary
                              op_id: Id.Arith_DEqual
                              left: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$CHOICE')})
                              right: (arith_expr.ArithWord w:{<Id.Lit_Digits 0>})
                            )
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:TARGETMENUID)
                          op: assign_op.Equal
                          rhs: {<-1>}
                          spids: [1913]
                        )
                      ]
                    )
                  ]
                  spids: [1892 1906]
                )
              ]
              else_action: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:TARGETMENUID)
                      op: assign_op.Equal
                      rhs: {<0>}
                      spids: [1924]
                    )
                  ]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: Menu_Main
      body: 
        (command.BraceGroup
          children: [
            (C {<local>} 
              {<Id.Lit_VarLike 'auto_renew_text='> (DQ <'Disabled | Manual renewal every 90 days'>)}
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DParen
                          child: 
                            (arith_expr.ArithWord
                              w: {($ Id.VSub_DollarName '$LETSENCRYPT_AUTORENEW')}
                            )
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:auto_renew_text)
                          op: assign_op.Equal
                          rhs: {(DQ <'Enabled | Automatic cron.monthly renewals'>)}
                          spids: [1967]
                        )
                      ]
                    )
                  ]
                  spids: [1954 1964]
                )
              ]
            )
            (C {<local>} 
              {<Id.Lit_VarLike 'redirect_text='> (DQ <'Disabled | Allows http and https usage'>)}
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DParen
                          child: 
                            (arith_expr.ArithWord
                              w: {($ Id.VSub_DollarName '$LETSENCRYPT_REDIRECT')}
                            )
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:redirect_text)
                          op: assign_op.Equal
                          rhs: {(DQ <'Enabled | Forces http redirects to https'>)}
                          spids: [1998]
                        )
                      ]
                    )
                  ]
                  spids: [1985 1995]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:OPTION)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        command_list: 
                          (command.CommandList
                            children: [
                              (command.Simple
                                words: [
                                  {<whiptail>}
                                  {<--title>}
                                  {(DQ ($ Id.VSub_DollarName '$PROGRAM_NAME'))}
                                  {<--menu>}
                                  {(DQ <'Please select a option.'>)}
                                  {<--cancel-button>}
                                  {(DQ <Exit>)}
                                  {<--default-item>}
                                  {(DQ ($ Id.VSub_DollarName '$PREVIOUS_MENU_SELECTION'))}
                                  {<--backtitle>}
                                  {(DQ ($ Id.VSub_DollarName '$PROGRAM_NAME'))}
                                  {<14>}
                                  {<70>}
                                  {<6>}
                                  {(DQ <Domain>)}
                                  {(DQ <': '> ($ Id.VSub_DollarName '$LETSENCRYPT_DOMAIN'))}
                                  {(DQ <Email>)}
                                  {(DQ <': '> ($ Id.VSub_DollarName '$LETSENCRYPT_EMAIL'))}
                                  {(DQ <Redirect>)}
                                  {(DQ <': '> ($ Id.VSub_DollarName '$redirect_text'))}
                                  {(DQ <'Auto Renew'>)}
                                  {(DQ <': '> ($ Id.VSub_DollarName '$auto_renew_text'))}
                                  {(DQ <'Key Size'>)}
                                  {(DQ <': '> ($ Id.VSub_DollarName '$LETSENCRYPT_KEYSIZE'))}
                                  {(DQ <Apply>)}
                                  {(DQ <'Runs Lets Encrypt with your chosen options.'>)}
                                ]
                                redirects: [
                                  (redir.Redir
                                    op: <Id.Redir_GreatAnd '3>&'>
                                    fd: 3
                                    arg_word: {<1>}
                                  )
                                  (redir.Redir
                                    op: <Id.Redir_GreatAnd '1>&'>
                                    fd: 1
                                    arg_word: {<2>}
                                  )
                                  (redir.Redir
                                    op: <Id.Redir_GreatAnd '2>&'>
                                    fd: 2
                                    arg_word: {<3>}
                                  )
                                ]
                              )
                            ]
                          )
                      )
                    }
                  spids: [2008]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:CHOICE)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_QMark '$?')}
                  spids: [2125]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DParen
                          child: 
                            (arith_expr.Binary
                              op_id: Id.Arith_DEqual
                              left: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$CHOICE')})
                              right: (arith_expr.ArithWord w:{<Id.Lit_Digits 0>})
                            )
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:PREVIOUS_MENU_SELECTION)
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_DollarName '$OPTION')}
                          spids: [2147]
                        )
                      ]
                    )
                    (command.Case
                      to_match: {(DQ ($ Id.VSub_DollarName '$OPTION'))}
                      arms: [
                        (case_arm
                          pat_list: [{<Domain>}]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:LETSENCRYPT_DOMAIN)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (DQ 
                                        (command_sub
                                          left_token: <Id.Left_DollarParen '$('>
                                          command_list: 
                                            (command.CommandList
                                              children: [
                                                (C {<Input_Box>} 
                                                  {($ Id.VSub_DollarName '$LETSENCRYPT_DOMAIN')} {<Website-Domain>}
                                                )
                                              ]
                                            )
                                        )
                                      )
                                    }
                                  spids: [2165]
                                )
                              ]
                            )
                          ]
                          spids: [2161 2162 2177 -1]
                        )
                        (case_arm
                          pat_list: [{<Email>}]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:LETSENCRYPT_EMAIL)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (DQ 
                                        (command_sub
                                          left_token: <Id.Left_DollarParen '$('>
                                          command_list: 
                                            (command.CommandList
                                              children: [
                                                (C {<Input_Box>} 
                                                  {($ Id.VSub_DollarName '$LETSENCRYPT_EMAIL')} {<Email-Address>}
                                                )
                                              ]
                                            )
                                        )
                                      )
                                    }
                                  spids: [2184]
                                )
                              ]
                            )
                          ]
                          spids: [2180 2181 2196 -1]
                        )
                        (case_arm
                          pat_list: [{(DQ <'Key Size'>)}]
                          action: [
                            (command.If
                              arms: [
                                (if_arm
                                  cond: [
                                    (command.Sentence
                                      child: 
                                        (command.DParen
                                          child: 
                                            (arith_expr.Binary
                                              op_id: Id.Arith_DEqual
                                              left: 
                                                (arith_expr.ArithWord
                                                  w: {($ Id.VSub_DollarName '$LETSENCRYPT_KEYSIZE')}
                                                )
                                              right: (arith_expr.ArithWord w:{<Id.Lit_Digits 2048>})
                                            )
                                        )
                                      terminator: <Id.Op_Semi _>
                                    )
                                  ]
                                  action: [
                                    (command.ShAssignment
                                      pairs: [
                                        (assign_pair
                                          lhs: (sh_lhs_expr.Name name:LETSENCRYPT_KEYSIZE)
                                          op: assign_op.Equal
                                          rhs: {<4096>}
                                          spids: [2222]
                                        )
                                      ]
                                    )
                                  ]
                                  spids: [2205 2219]
                                )
                              ]
                              else_action: [
                                (command.ShAssignment
                                  pairs: [
                                    (assign_pair
                                      lhs: (sh_lhs_expr.Name name:LETSENCRYPT_KEYSIZE)
                                      op: assign_op.Equal
                                      rhs: {<2048>}
                                      spids: [2229]
                                    )
                                  ]
                                )
                              ]
                            )
                          ]
                          spids: [2199 2202 2236 -1]
                        )
                        (case_arm
                          pat_list: [{(DQ <'Auto Renew'>)}]
                          action: [
                            (command.DParen
                              child: 
                                (arith_expr.UnaryAssign
                                  op_id: Id.Node_PostDPlus
                                  child: (sh_lhs_expr.Name name:LETSENCRYPT_AUTORENEW)
                                )
                            )
                            (command.If
                              arms: [
                                (if_arm
                                  cond: [
                                    (command.Sentence
                                      child: 
                                        (command.DParen
                                          child: 
                                            (arith_expr.Binary
                                              op_id: Id.Arith_Great
                                              left: 
                                                (arith_expr.ArithWord
                                                  w: {($ Id.VSub_DollarName '$LETSENCRYPT_AUTORENEW')}
                                                )
                                              right: (arith_expr.ArithWord w:{<Id.Lit_Digits 1>})
                                            )
                                        )
                                      terminator: <Id.Op_Semi _>
                                    )
                                  ]
                                  action: [
                                    (command.ShAssignment
                                      pairs: [
                                        (assign_pair
                                          lhs: (sh_lhs_expr.Name name:LETSENCRYPT_AUTORENEW)
                                          op: assign_op.Equal
                                          rhs: {<0>}
                                          spids: [2269]
                                        )
                                      ]
                                    )
                                  ]
                                  spids: [2252 2266]
                                )
                              ]
                            )
                          ]
                          spids: [2239 2242 2276 -1]
                        )
                        (case_arm
                          pat_list: [{<Redirect>}]
                          action: [
                            (command.DParen
                              child: 
                                (arith_expr.UnaryAssign
                                  op_id: Id.Node_PostDPlus
                                  child: (sh_lhs_expr.Name name:LETSENCRYPT_REDIRECT)
                                )
                            )
                            (command.If
                              arms: [
                                (if_arm
                                  cond: [
                                    (command.Sentence
                                      child: 
                                        (command.DParen
                                          child: 
                                            (arith_expr.Binary
                                              op_id: Id.Arith_Great
                                              left: 
                                                (arith_expr.ArithWord
                                                  w: {($ Id.VSub_DollarName '$LETSENCRYPT_REDIRECT')}
                                                )
                                              right: (arith_expr.ArithWord w:{<Id.Lit_Digits 1>})
                                            )
                                        )
                                      terminator: <Id.Op_Semi _>
                                    )
                                  ]
                                  action: [
                                    (command.ShAssignment
                                      pairs: [
                                        (assign_pair
                                          lhs: (sh_lhs_expr.Name name:LETSENCRYPT_REDIRECT)
                                          op: assign_op.Equal
                                          rhs: {<0>}
                                          spids: [2307]
                                        )
                                      ]
                                    )
                                  ]
                                  spids: [2290 2304]
                                )
                              ]
                            )
                          ]
                          spids: [2279 2280 2314 -1]
                        )
                        (case_arm
                          pat_list: [{<Apply>}]
                          action: [
                            (C {<whiptail>} {<--title>} {(DQ <'Run Lets Encrypt?'>)} {<--yesno>} 
                              {
                                (DQ <'LetsEncrypt will now be run. This will:'> <Id.Lit_Other '\\'> 
                                  <'n- Create your free SSL cert.'> <Id.Lit_Other '\\'> <'n- Automatically apply and enable your SSL cert'> <Id.Lit_Other '\\'> 
                                  <'n- NB: This process can take a long time, please be patient.'> <Id.Lit_Other '\\'> <n> <Id.Lit_Other '\\'> <'nWould you like to continue?'>
                                )
                              } {<--backtitle>} {(DQ ($ Id.VSub_DollarName '$PROGRAM_NAME'))} {<--yes-button>} {(DQ <Ok>)} {<--no-button>} 
                              {(DQ <Back>)} {<--defaultno>} {<13>} {<65>}
                            )
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:CHOICE)
                                  op: assign_op.Equal
                                  rhs: {($ Id.VSub_QMark '$?')}
                                  spids: [2370]
                                )
                              ]
                            )
                            (command.If
                              arms: [
                                (if_arm
                                  cond: [
                                    (command.Sentence
                                      child: 
                                        (command.DParen
                                          child: 
                                            (arith_expr.Binary
                                              op_id: Id.Arith_DEqual
                                              left: 
                                                (arith_expr.ArithWord
                                                  w: {($ Id.VSub_DollarName '$CHOICE')}
                                                )
                                              right: (arith_expr.ArithWord w:{<Id.Lit_Digits 0>})
                                            )
                                        )
                                      terminator: <Id.Op_Semi _>
                                    )
                                  ]
                                  action: [(C {<Write_Settings_File>}) (C {<Run_Lets_Encrypt>})]
                                  spids: [2374 2388]
                                )
                              ]
                            )
                          ]
                          spids: [2317 2318 2400 -1]
                        )
                      ]
                    )
                  ]
                  spids: [2129 2143]
                )
              ]
              else_action: [(C {<Menu_Exit>})]
            )
          ]
        )
    )
    (command.ShFunction
      name: Input_Box
      body: 
        (command.BraceGroup
          children: [
            (C {<local>} {<Id.Lit_VarLike 'input_value='> ($ Id.VSub_Number '$1')})
            (C {<local>} {<Id.Lit_VarLike 'input_desc='> ($ Id.VSub_Number '$2')})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:OPTION)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        command_list: 
                          (command.CommandList
                            children: [
                              (command.Simple
                                words: [
                                  {<whiptail>}
                                  {<--inputbox>}
                                  {(DQ <'Please enter your '> ($ Id.VSub_DollarName '$input_desc'))}
                                  {<9>}
                                  {<50>}
                                  {(DQ ($ Id.VSub_DollarName '$input_value'))}
                                  {<--title>}
                                  {(DQ <'Input '> ($ Id.VSub_DollarName '$input_desc'))}
                                ]
                                redirects: [
                                  (redir.Redir
                                    op: <Id.Redir_GreatAnd '3>&'>
                                    fd: 3
                                    arg_word: {<1>}
                                  )
                                  (redir.Redir
                                    op: <Id.Redir_GreatAnd '1>&'>
                                    fd: 1
                                    arg_word: {<2>}
                                  )
                                  (redir.Redir
                                    op: <Id.Redir_GreatAnd '2>&'>
                                    fd: 2
                                    arg_word: {<3>}
                                  )
                                ]
                              )
                            ]
                          )
                      )
                    }
                  spids: [2445]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:CHOICE)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_QMark '$?')}
                  spids: [2482]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DParen
                          child: 
                            (arith_expr.Binary
                              op_id: Id.Arith_DEqual
                              left: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$CHOICE')})
                              right: (arith_expr.ArithWord w:{<Id.Lit_Digits 0>})
                            )
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:input_value)
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_DollarName '$OPTION')}
                          spids: [2503]
                        )
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {<Id.Lit_LBracket '['>} {<-z>} 
                                  {(DQ ($ Id.VSub_DollarName '$input_value'))} {<Id.Lit_RBracket ']'>}
                                )
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:input_value)
                                  op: assign_op.Equal
                                  rhs: {(SQ <NULL>)}
                                  spids: [2527]
                                )
                              ]
                            )
                          ]
                          spids: [2511 2524]
                        )
                      ]
                    )
                  ]
                  spids: [2486 2500]
                )
              ]
            )
            (C {<echo>} {<-e>} {(DQ ($ Id.VSub_DollarName '$input_value'))})
          ]
        )
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {<-f>} 
                  {(DQ ($ Id.VSub_DollarName '$DP_SETTINGS'))} {<Id.Lit_RBracket ']'>}
                )
              terminator: <Id.Op_Semi _>
            )
          ]
          action: [(C {<Write_Settings_File>})]
          spids: [2569 2584]
        )
      ]
      else_action: [(C {<Read_Settings_File>})]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.DParen
                  child: 
                    (arith_expr.Unary
                      op_id: Id.Arith_Bang
                      child: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$LETSENCRYPT_INSTALLED')})
                    )
                )
              terminator: <Id.Op_Semi _>
            )
          ]
          action: [
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DParen
                          child: 
                            (arith_expr.Binary
                              op_id: Id.Arith_DEqual
                              left: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$INPUT')})
                              right: (arith_expr.ArithWord w:{<Id.Lit_Digits 0>})
                            )
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (C {<G_DIETPI-NOTIFY>} {<1>} 
                      {
                        (DQ <'Certbot binary not found ( '> 
                          ($ Id.VSub_DollarName '$DP_LETSENCRYPT_BINARY') <' )'>
                        )
                      }
                    )
                    (C {<G_DIETPI-NOTIFY>} {<2>} 
                      {
                        (DQ 
                          <
'Please install Certbot with DietPi-Software before running this program.'
                          >
                        )
                      }
                    )
                    (C {<read>} {<-p>} {(DQ <'Press any key to continue.....'>)})
                  ]
                  spids: [2632 2646]
                )
              ]
              else_action: [
                (command.Simple
                  words: [
                    {<echo>}
                    {<-e>}
                    {
                      (DQ <'Error: Letsencrypt binary not installed ( '> 
                        ($ Id.VSub_DollarName '$DP_LETSENCRYPT_BINARY') <' ).'>
                      )
                    }
                  ]
                  redirects: [
                    (redir.Redir
                      op: <Id.Redir_DGreat '>>'>
                      fd: -1
                      arg_word: {(DQ ($ Id.VSub_DollarName '$DP_LOGFILE'))}
                    )
                  ]
                )
              ]
            )
          ]
          spids: [2612 2624]
        )
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.DParen
                  child: 
                    (arith_expr.Binary
                      op_id: Id.Arith_DEqual
                      left: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$INPUT')})
                      right: (arith_expr.ArithWord w:{<Id.Lit_Digits 0>})
                    )
                )
              terminator: <Id.Op_Semi _>
            )
          ]
          action: [
            (command.WhileUntil
              keyword: <Id.KW_While while>
              cond: [
                (command.Sentence
                  child: 
                    (command.DParen
                      child: 
                        (arith_expr.Binary
                          op_id: Id.Arith_Great
                          left: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$TARGETMENUID')})
                          right: 
                            (arith_expr.Unary
                              op_id: Id.Node_UnaryMinus
                              child: (arith_expr.ArithWord w:{<Id.Lit_Digits 1>})
                            )
                        )
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
              body: 
                (command.DoGroup
                  children: [
                    (C {<clear>})
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.DParen
                                  child: 
                                    (arith_expr.Binary
                                      op_id: Id.Arith_DEqual
                                      left: 
                                        (arith_expr.ArithWord
                                          w: {($ Id.VSub_DollarName '$TARGETMENUID')}
                                        )
                                      right: (arith_expr.ArithWord w:{<Id.Lit_Digits 0>})
                                    )
                                )
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                          action: [(C {<Menu_Main>})]
                          spids: [2759 2773]
                        )
                      ]
                    )
                  ]
                )
            )
          ]
          spids: [2714 2728]
        )
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.DParen
                  child: 
                    (arith_expr.Binary
                      op_id: Id.Arith_DEqual
                      left: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$INPUT')})
                      right: (arith_expr.ArithWord w:{<Id.Lit_Digits 1>})
                    )
                )
              terminator: <Id.Op_Semi _>
            )
          ]
          action: [(C {<Run_Lets_Encrypt>})]
          spids: [2797 2811]
        )
      ]
    )
    (command.ControlFlow token:<Id.ControlFlow_Exit exit>)
  ]
)