(CommandList
  children: [
    (Sentence child:(C {(set)} {(-eo)} {(pipefail)}) terminator:<Op_Semi ';'>)
    (AndOr
      ops: [Op_DAmp]
      children: [(DBracket expr:(WordTest w:{($ VSub_Name '$TRACE')})) (C {(set)} {(-x)})]
    )
    (FuncDef
      name: ensure-environment
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              pairs: [(assign_pair lhs:(LhsName name:FREE_MEMORY) op:Equal spids:[58])]
              spids: [56]
            )
            (C {(echo)} 
              {
                (DQ ('Preparing to install ') ($ VSub_Name '$DOKKU_TAG') (' from ') 
                  ($ VSub_Name '$DOKKU_REPO') (...)
                )
              }
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (Pipeline
                          children: [
                            (SimpleCommand
                              words: [{(command)} {(-v)} {(apt-get)}]
                              redirects: [
                                (Redir
                                  op_id: Redir_AndGreat
                                  fd: 16777215
                                  arg_word: {(/dev/null)}
                                  spids: [82]
                                )
                              ]
                            )
                          ]
                          negated: T
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(echo)} 
                      {
                        (DQ 
                          (
'This installation script requires apt-get. For manual installation instructions, consult http://dokku.viewdocs.io/dokku/advanced-installation/'
                          )
                        )
                      }
                    )
                    (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})
                  ]
                  spids: [16777215 86]
                )
              ]
              spids: [16777215 101]
            )
            (AndOr
              ops: [Op_DPipe]
              children: [
                (SimpleCommand
                  words: [{(hostname)} {(-f)}]
                  redirects: [
                    (Redir
                      op_id: Redir_Great
                      fd: 16777215
                      arg_word: {(/dev/null)}
                      spids: [109]
                    )
                    (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[113])
                  ]
                )
                (BraceGroup
                  children: [
                    (C {(echo)} 
                      {
                        (DQ 
                          (
'This installation script requires that you have a hostname set for the instance. Please set a hostname for 127.0.0.1 in your /etc/hosts'
                          )
                        )
                      }
                    )
                    (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})
                  ]
                  spids: [118]
                )
              ]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:FREE_MEMORY)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [
                              (Pipeline
                                children: [
                                  (C {(grep)} {(MemTotal)} {(/proc/meminfo)})
                                  (C {(awk)} {(SQ <'{print $2}'>)})
                                ]
                                negated: F
                              )
                            ]
                          )
                        left_token: <Left_CommandSub '$('>
                        spids: [138 152]
                      )
                    }
                  spids: [137]
                )
              ]
              spids: [137]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (BoolBinary
                              op_id: BoolBinary_lt
                              left: {(DQ ($ VSub_Name '$FREE_MEMORY'))}
                              right: {(1003600)}
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(echo)} 
                      {
                        (DQ 
                          (
'For dokku to build containers, it is strongly suggested that you have 1024 megabytes or more of free memory'
                          )
                        )
                      }
                    )
                    (C {(echo)} 
                      {
                        (DQ 
                          (
'If necessary, please consult this document to setup swap: http://dokku.viewdocs.io/dokku/advanced-installation/#vms-with-less-than-1gb-of-memory'
                          )
                        )
                      }
                    )
                  ]
                  spids: [16777215 170]
                )
              ]
              spids: [16777215 187]
            )
          ]
          spids: [53]
        )
      spids: [49 52]
    )
    (FuncDef
      name: install-requirements
      body: 
        (BraceGroup
          children: [
            (C {(echo)} {(DQ ('--> Ensuring we have the proper dependencies'))})
            (SimpleCommand
              words: [{(apt-get)} {(update)} {(-qq)}]
              redirects: [(Redir op_id:Redir_Great fd:16777215 arg_word:{(/dev/null)} spids:[212])]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (BoolBinary
                              op_id: BoolBinary_GlobDEqual
                              left: 
                                {
                                  (CommandSubPart
                                    command_list: 
                                      (CommandList
                                        children: [(C {(lsb_release)} {(-sr)})]
                                      )
                                    left_token: <Left_CommandSub '$('>
                                    spids: [221 225]
                                  )
                                }
                              right: {(DQ (12.04))}
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [(C {(apt-get)} {(-qq)} {(-y)} {(install)} {(python-software-properties)})]
                  spids: [16777215 236]
                )
              ]
              spids: [16777215 250]
            )
          ]
          spids: [196]
        )
      spids: [192 195]
    )
    (FuncDef
      name: install-dokku
      body: 
        (BraceGroup
          children: [
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: (BoolUnary op_id:BoolUnary_n child:{($ VSub_Name '$DOKKU_BRANCH')})
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(install-dokku-from-source)} {(DQ (origin/) ($ VSub_Name '$DOKKU_BRANCH'))})
                  ]
                  spids: [16777215 273]
                )
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: (BoolUnary op_id:BoolUnary_n child:{($ VSub_Name '$DOKKU_TAG')})
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (Assignment
                      keyword: Assign_Local
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:DOKKU_SEMVER)
                          op: Equal
                          rhs: 
                            {
                              (DQ 
                                (BracedVarSub
                                  token: <VSub_Name DOKKU_TAG>
                                  suffix_op: (PatSub pat:{(v)} do_all:T do_prefix:F do_suffix:F)
                                  spids: [302 307]
                                )
                              )
                            }
                          spids: [300]
                        )
                      ]
                      spids: [298]
                    )
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:major)
                          op: Equal
                          rhs: 
                            {
                              (CommandSubPart
                                command_list: 
                                  (CommandList
                                    children: [
                                      (Pipeline
                                        children: [
                                          (C {(echo)} {(DQ ($ VSub_Name '$DOKKU_SEMVER'))})
                                          (C {(awk)} {(SQ <'{split($0,a,"."); print a[1]}'>)})
                                        ]
                                        negated: F
                                      )
                                    ]
                                  )
                                left_token: <Left_CommandSub '$('>
                                spids: [312 326]
                              )
                            }
                          spids: [311]
                        )
                      ]
                      spids: [311]
                    )
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:minor)
                          op: Equal
                          rhs: 
                            {
                              (CommandSubPart
                                command_list: 
                                  (CommandList
                                    children: [
                                      (Pipeline
                                        children: [
                                          (C {(echo)} {(DQ ($ VSub_Name '$DOKKU_SEMVER'))})
                                          (C {(awk)} {(SQ <'{split($0,a,"."); print a[2]}'>)})
                                        ]
                                        negated: F
                                      )
                                    ]
                                  )
                                left_token: <Left_CommandSub '$('>
                                spids: [330 344]
                              )
                            }
                          spids: [329]
                        )
                      ]
                      spids: [329]
                    )
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:patch)
                          op: Equal
                          rhs: 
                            {
                              (CommandSubPart
                                command_list: 
                                  (CommandList
                                    children: [
                                      (Pipeline
                                        children: [
                                          (C {(echo)} {(DQ ($ VSub_Name '$DOKKU_SEMVER'))})
                                          (C {(awk)} {(SQ <'{split($0,a,"."); print a[3]}'>)})
                                        ]
                                        negated: F
                                      )
                                    ]
                                  )
                                left_token: <Left_CommandSub '$('>
                                spids: [348 362]
                              )
                            }
                          spids: [347]
                        )
                      ]
                      spids: [347]
                    )
                    (If
                      arms: [
                        (if_arm
                          cond: [
                            (Sentence
                              child: 
                                (AndOr
                                  ops: [Op_DAmp Op_DAmp]
                                  children: [
                                    (DBracket
                                      expr: 
                                        (BoolBinary
                                          op_id: BoolBinary_eq
                                          left: {(DQ ($ VSub_Name '$major'))}
                                          right: {(DQ (0))}
                                        )
                                    )
                                    (DBracket
                                      expr: 
                                        (BoolBinary
                                          op_id: BoolBinary_eq
                                          left: {(DQ ($ VSub_Name '$minor'))}
                                          right: {(DQ (3))}
                                        )
                                    )
                                    (DBracket
                                      expr: 
                                        (BoolBinary
                                          op_id: BoolBinary_ge
                                          left: {(DQ ($ VSub_Name '$patch'))}
                                          right: {(DQ (13))}
                                        )
                                    )
                                  ]
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (C {(install-dokku-from-package)} {(DQ ($ VSub_Name '$DOKKU_SEMVER'))})
                            (C {(echo)} {(DQ ('--> Running post-install dependency installation'))})
                            (C {(dokku)} {(plugins-install-dependencies)})
                          ]
                          spids: [16777215 419]
                        )
                        (if_arm
                          cond: [
                            (Sentence
                              child: 
                                (AndOr
                                  ops: [Op_DAmp Op_DAmp]
                                  children: [
                                    (DBracket
                                      expr: 
                                        (BoolBinary
                                          op_id: BoolBinary_eq
                                          left: {(DQ ($ VSub_Name '$major'))}
                                          right: {(DQ (0))}
                                        )
                                    )
                                    (DBracket
                                      expr: 
                                        (BoolBinary
                                          op_id: BoolBinary_ge
                                          left: {(DQ ($ VSub_Name '$minor'))}
                                          right: {(DQ (4))}
                                        )
                                    )
                                    (DBracket
                                      expr: 
                                        (BoolBinary
                                          op_id: BoolBinary_ge
                                          left: {(DQ ($ VSub_Name '$patch'))}
                                          right: {(DQ (0))}
                                        )
                                    )
                                  ]
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (C {(install-dokku-from-package)} {(DQ ($ VSub_Name '$DOKKU_SEMVER'))})
                            (C {(echo)} {(DQ ('--> Running post-install dependency installation'))})
                            (C {(sudo)} {(-E)} {(dokku)} 
                              {(plugin) (Lit_Other ':') (install-dependencies)} {(--core)}
                            )
                          ]
                          spids: [445 494]
                        )
                      ]
                      else_action: [(C {(install-dokku-from-source)} {(DQ ($ VSub_Name '$DOKKU_TAG'))})]
                      spids: [524 534]
                    )
                  ]
                  spids: [284 295]
                )
              ]
              else_action: [
                (C {(install-dokku-from-package)})
                (C {(echo)} {(DQ ('--> Running post-install dependency installation'))})
                (C {(sudo)} {(-E)} {(dokku)} {(plugin) (Lit_Other ':') (install-dependencies)} {(--core)})
              ]
              spids: [537 563]
            )
          ]
          spids: [259]
        )
      spids: [255 258]
    )
    (FuncDef
      name: install-dokku-from-source
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:DOKKU_CHECKOUT)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number '$1'))}
                  spids: [578]
                )
              ]
              spids: [576]
            )
            (C {(apt-get)} {(-qq)} {(-y)} {(install)} {(git)} {(make)} {(software-properties-common)})
            (C {(cd)} {(/root)})
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: (LogicalNot child:(BoolUnary op_id:BoolUnary_d child:{(/root/dokku)}))
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [(C {(git)} {(clone)} {(DQ ($ VSub_Name '$DOKKU_REPO'))} {(/root/dokku)})]
                  spids: [16777215 617]
                )
              ]
              spids: [16777215 631]
            )
            (C {(cd)} {(/root/dokku)})
            (C {(git)} {(fetch)} {(origin)})
            (AndOr
              ops: [Op_DAmp]
              children: [
                (DBracket
                  expr: (BoolUnary op_id:BoolUnary_n child:{($ VSub_Name '$DOKKU_CHECKOUT')})
                )
                (C {(git)} {(checkout)} {(DQ ($ VSub_Name '$DOKKU_CHECKOUT'))})
              ]
            )
            (C {(make)} {(install)})
          ]
          spids: [573]
        )
      spids: [569 572]
    )
    (FuncDef
      name: install-dokku-from-package
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:DOKKU_CHECKOUT)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number '$1'))}
                  spids: [682]
                )
              ]
              spids: [680]
            )
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:NO_INSTALL_RECOMMENDS)
                  op: Equal
                  rhs: 
                    {
                      (BracedVarSub
                        token: <VSub_Name DOKKU_NO_INSTALL_RECOMMENDS>
                        suffix_op: (StringUnary op_id:VTest_ColonEquals arg_word:{(DQ )})
                        spids: [691 696]
                      )
                    }
                  spids: [690]
                )
              ]
              spids: [688]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: (BoolUnary op_id:BoolUnary_n child:{($ VSub_Name '$DOKKU_DOCKERFILE')})
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:NO_INSTALL_RECOMMENDS)
                          op: Equal
                          rhs: {(DQ (' --no-install-recommends '))}
                          spids: [714]
                        )
                      ]
                      spids: [714]
                    )
                  ]
                  spids: [16777215 711]
                )
              ]
              spids: [16777215 720]
            )
            (C {(echo)} {(DQ ('--> Initial apt-get update'))})
            (SimpleCommand
              words: [{(apt-get)} {(update)} {(-qq)}]
              redirects: [(Redir op_id:Redir_Great fd:16777215 arg_word:{(/dev/null)} spids:[737])]
            )
            (C {(apt-get)} {(-qq)} {(-y)} {(install)} {(apt-transport-https)})
            (C {(echo)} {(DQ ('--> Installing docker'))})
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (Pipeline
                          children: [(C {(uname)} {(-r)}) (C {(grep)} {(-q)} {(linode)})]
                          negated: F
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(echo)} 
                      {
                        (DQ 
                          (
'--> NOTE: Using Linode? Docker might complain about missing AUFS support.'
                          )
                        )
                      }
                    )
                    (C {(echo)} 
                      {
                        (DQ 
                          (
'    See http://dokku.viewdocs.io/dokku/getting-started/install/linode/'
                          )
                        )
                      }
                    )
                    (C {(echo)} {(DQ ('    Installation will continue in 10 seconds.'))})
                    (C {(sleep)} {(10)})
                  ]
                  spids: [16777215 776]
                )
              ]
              spids: [16777215 805]
            )
            (Pipeline
              children: [
                (C {(wget)} {(-nv)} {(-O)} {(-)} {(https) (Lit_Other ':') (//get.docker.com/)})
                (C {(sh)})
              ]
              negated: F
            )
            (C {(echo)} {(DQ ('--> Installing dokku'))})
            (Pipeline
              children: [
                (C {(wget)} {(-nv)} {(-O)} {(-)} {(https) (Lit_Other ':') (//packagecloud.io/gpg.key)})
                (C {(apt-key)} {(add)} {(-)})
              ]
              negated: F
            )
            (Pipeline
              children: [
                (C {(echo)} {(DQ ('deb https://packagecloud.io/dokku/dokku/ubuntu/ trusty main'))})
                (C {(tee)} {(/etc/apt/sources.list.d/dokku.list)})
              ]
              negated: F
            )
            (SimpleCommand
              words: [{(apt-get)} {(update)} {(-qq)}]
              redirects: [(Redir op_id:Redir_Great fd:16777215 arg_word:{(/dev/null)} spids:[873])]
            )
            (AndOr
              ops: [Op_DAmp]
              children: [
                (DBracket
                  expr: (BoolUnary op_id:BoolUnary_n child:{($ VSub_Name '$DOKKU_VHOST_ENABLE')})
                )
                (Pipeline
                  children: [
                    (C {(echo)} 
                      {
                        (DQ ('dokku dokku/vhost_enable boolean ') ($ VSub_Name '$DOKKU_VHOST_ENABLE'))
                      }
                    )
                    (C {(sudo)} {(debconf-set-selections)})
                  ]
                  negated: F
                )
              ]
            )
            (AndOr
              ops: [Op_DAmp]
              children: [
                (DBracket
                  expr: (BoolUnary op_id:BoolUnary_n child:{($ VSub_Name '$DOKKU_WEB_CONFIG')})
                )
                (Pipeline
                  children: [
                    (C {(echo)} 
                      {(DQ ('dokku dokku/web_config boolean ') ($ VSub_Name '$DOKKU_WEB_CONFIG'))}
                    )
                    (C {(sudo)} {(debconf-set-selections)})
                  ]
                  negated: F
                )
              ]
            )
            (AndOr
              ops: [Op_DAmp]
              children: [
                (DBracket
                  expr: (BoolUnary op_id:BoolUnary_n child:{($ VSub_Name '$DOKKU_HOSTNAME')})
                )
                (Pipeline
                  children: [
                    (C {(echo)} {(DQ ('dokku dokku/hostname string ') ($ VSub_Name '$DOKKU_HOSTNAME'))})
                    (C {(sudo)} {(debconf-set-selections)})
                  ]
                  negated: F
                )
              ]
            )
            (AndOr
              ops: [Op_DAmp]
              children: [
                (DBracket
                  expr: (BoolUnary op_id:BoolUnary_n child:{($ VSub_Name '$DOKKU_SKIP_KEY_FILE')})
                )
                (Pipeline
                  children: [
                    (C {(echo)} 
                      {
                        (DQ ('dokku dokku/skip_key_file boolean ') 
                          ($ VSub_Name '$DOKKU_SKIP_KEY_FILE')
                        )
                      }
                    )
                    (C {(sudo)} {(debconf-set-selections)})
                  ]
                  negated: F
                )
              ]
            )
            (AndOr
              ops: [Op_DAmp]
              children: [
                (DBracket
                  expr: (BoolUnary op_id:BoolUnary_n child:{($ VSub_Name '$DOKKU_KEY_FILE')})
                )
                (Pipeline
                  children: [
                    (C {(echo)} {(DQ ('dokku dokku/key_file string ') ($ VSub_Name '$DOKKU_KEY_FILE'))})
                    (C {(sudo)} {(debconf-set-selections)})
                  ]
                  negated: F
                )
              ]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: (BoolUnary op_id:BoolUnary_n child:{($ VSub_Name '$DOKKU_CHECKOUT')})
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(apt-get)} {(-qq)} {(-y)} {($ VSub_Name '$NO_INSTALL_RECOMMENDS')} {(install)} 
                      {(DQ ('dokku=') ($ VSub_Name '$DOKKU_CHECKOUT'))}
                    )
                  ]
                  spids: [16777215 1011]
                )
              ]
              else_action: [
                (C {(apt-get)} {(-qq)} {(-y)} {($ VSub_Name '$NO_INSTALL_RECOMMENDS')} {(install)} 
                  {(dokku)}
                )
              ]
              spids: [1034 1054]
            )
          ]
          spids: [677]
        )
      spids: [673 676]
    )
    (FuncDef
      name: main
      body: 
        (BraceGroup
          children: [
            (C {(export)} {(Lit_VarLike 'DEBIAN_FRONTEND=') (noninteractive)})
            (C {(export)} 
              {(Lit_VarLike 'DOKKU_REPO=') 
                (BracedVarSub
                  token: <VSub_Name DOKKU_REPO>
                  suffix_op: 
                    (StringUnary
                      op_id: VTest_ColonHyphen
                      arg_word: {(DQ ('https://github.com/dokku/dokku.git'))}
                    )
                  spids: [1075 1081]
                )
              }
            )
            (C {(ensure-environment)})
            (C {(install-requirements)})
            (C {(install-dokku)})
          ]
          spids: [1063]
        )
      spids: [1059 1062]
    )
    (C {(main)} {(DQ ($ VSub_At '$@'))})
  ]
)