(command.BraceGroup
  children: [
    (command.ShAssignment
      pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:INPUT) op:assign_op.Equal rhs:{<0>} spids:[78])]
    )
    (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: [106]
                )
              ]
            )
          ]
          spids: [82 102]
        )
      ]
    )
    (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-Update>)})
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:GITBRANCH)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: <Id.Left_DollarParen '$('>
                command_list: 
                  (command.CommandList
                    children: [
                      (command.Pipeline
                        children: [
                          (C {<grep>} {<-m1>} {(SQ <'^DEV_GITBRANCH='>)} {</DietPi/dietpi.txt>})
                          (C {<sed>} {(SQ <'s/.*=//'>)})
                        ]
                        negated: F
                      )
                    ]
                  )
              )
            }
          spids: [155]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:GITFORKOWNER)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: <Id.Left_DollarParen '$('>
                command_list: 
                  (command.CommandList
                    children: [
                      (command.Pipeline
                        children: [
                          (C {<grep>} {<-m1>} {(SQ <'^DEV_GITOWNER='>)} {</DietPi/dietpi.txt>})
                          (C {<sed>} {(SQ <'s/.*=//'>)})
                        ]
                        negated: F
                      )
                    ]
                  )
              )
            }
          spids: [177]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:FP_LOG)
          op: assign_op.Equal
          rhs: {(SQ </var/tmp/dietpi/logs/dietpi-update.log>)}
          spids: [212]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:DIETPIUPDATE_COREVERSION_CURRENT)
          op: assign_op.Equal
          rhs: {<6>}
          spids: [218]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:FILEPATH_TEMP)
          op: assign_op.Equal
          rhs: {(DQ </tmp/dietpi-update>)}
          spids: [226]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:SERVER_ONLINE)
          op: assign_op.Equal
          rhs: {<0>}
          spids: [233]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:UPDATE_AVAILABLE)
          op: assign_op.Equal
          rhs: {<0>}
          spids: [237]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:UPDATE_REQUIRESNEWIMAGE)
          op: assign_op.Equal
          rhs: {<0>}
          spids: [241]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:RUN_UPDATE)
          op: assign_op.Equal
          rhs: {<0>}
          spids: [245]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:COREVERSION_CURRENT)
          op: assign_op.Equal
          rhs: {<0>}
          spids: [250]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:SUBVERSION_CURRENT)
          op: assign_op.Equal
          rhs: {<0>}
          spids: [254]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:COREVERSION_SERVER)
          op: assign_op.Equal
          rhs: {<0>}
          spids: [259]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:SUBVERSION_SERVER)
          op: assign_op.Equal
          rhs: {<0>}
          spids: [263]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:URL_MIRROR_INDEX)
          op: assign_op.Equal
          rhs: {<0>}
          spids: [268]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:URL_MIRROR_SERVERVERSION)
          op: assign_op.Equal
          rhs: 
            {
              (sh_array_literal
                left: <Id.Op_LParen _>
                words: [
                  {
                    (DQ <'http://dietpi.com/downloads/dietpi-update_mirror/'> 
                      ($ Id.VSub_DollarName '$GITBRANCH') </server_version-6>
                    )
                  }
                  {
                    (DQ <'https://raw.githubusercontent.com/'> 
                      (braced_var_sub
                        token: <Id.VSub_Name GITFORKOWNER>
                        suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:{<Fourdee>})
                      ) </DietPi/> ($ Id.VSub_DollarName '$GITBRANCH') </dietpi/server_version-6>
                    )
                  }
                ]
              )
            }
          spids: [272]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:URL_MIRROR_ZIP)
          op: assign_op.Equal
          rhs: 
            {
              (sh_array_literal
                left: <Id.Op_LParen _>
                words: [
                  {
                    (DQ <'http://dietpi.com/downloads/dietpi-update_mirror/'> 
                      ($ Id.VSub_DollarName '$GITBRANCH') </DietPi-> ($ Id.VSub_DollarName '$GITBRANCH') <.zip>
                    )
                  }
                  {
                    (DQ <'https://github.com/'> 
                      (braced_var_sub
                        token: <Id.VSub_Name GITFORKOWNER>
                        suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:{<Fourdee>})
                      ) </DietPi/archive/> ($ Id.VSub_DollarName '$GITBRANCH') <.zip>
                    )
                  }
                ]
              )
            }
          spids: [302]
        )
      ]
    )
    (command.ShFunction
      name: Get_Client_Version
      body: 
        (command.BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:COREVERSION_CURRENT)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        command_list: 
                          (command.CommandList
                            children: [(C {<sed>} {<-n>} {<1p>} {</DietPi/dietpi/.version>})]
                          )
                      )
                    }
                  spids: [341]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:SUBVERSION_CURRENT)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        command_list: 
                          (command.CommandList
                            children: [(C {<sed>} {<-n>} {<2p>} {</DietPi/dietpi/.version>})]
                          )
                      )
                    }
                  spids: [353]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: Get_Server_Version
      body: 
        (command.BraceGroup
          children: [
            (command.ForExpr
              init: 
                (arith_expr.BinaryAssign
                  op_id: Id.Arith_Equal
                  left: (sh_lhs_expr.Name name:i)
                  right: (arith_expr.ArithWord w:{<Id.Lit_Digits 0>})
                )
              cond: 
                (arith_expr.Binary
                  op_id: Id.Arith_Less
                  left: (arith_expr.VarRef token:<Id.Lit_ArithVarLike i>)
                  right: 
                    (arith_expr.ArithWord
                      w: 
                        {
                          (braced_var_sub
                            token: <Id.VSub_Name URL_MIRROR_SERVERVERSION>
                            prefix_op: (Id.VSub_Pound)
                            bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                          )
                        }
                    )
                )
              update: (arith_expr.UnaryAssign op_id:Id.Node_PostDPlus child:(sh_lhs_expr.Name name:i))
              body: 
                (command.DoGroup
                  children: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:URL_MIRROR_INDEX)
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_DollarName '$i')}
                          spids: [410]
                        )
                      ]
                    )
                    (C {<G_DIETPI-NOTIFY>} {<2>} 
                      {
                        (DQ <'Checking Mirror : '> 
                          (braced_var_sub
                            token: <Id.VSub_Name URL_MIRROR_SERVERVERSION>
                            bracket_op: 
                              (bracket_op.ArrayIndex
                                expr: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$i')})
                              )
                          )
                        )
                      }
                    )
                    (command.Simple
                      words: [
                        {<curl>}
                        {<-k>}
                        {<-L>}
                        {
                          (braced_var_sub
                            token: <Id.VSub_Name URL_MIRROR_SERVERVERSION>
                            bracket_op: 
                              (bracket_op.ArrayIndex
                                expr: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$i')})
                              )
                          )
                        }
                      ]
                      redirects: [
                        (redir.Redir
                          op: <Id.Redir_Great '>'>
                          fd: -1
                          arg_word: {(DQ ($ Id.VSub_DollarName '$FILEPATH_TEMP')) </server_version>}
                        )
                      ]
                    )
                    (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_QMark '$?')})
                                      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:COREVERSION_SERVER)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (command_sub
                                        left_token: <Id.Left_DollarParen '$('>
                                        command_list: 
                                          (command.CommandList
                                            children: [
                                              (C {<sed>} {<-n>} {<1p>} 
                                                {(DQ ($ Id.VSub_DollarName '$FILEPATH_TEMP')) 
                                                  </server_version>
                                                }
                                              )
                                            ]
                                          )
                                      )
                                    }
                                  spids: [473]
                                )
                              ]
                            )
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:SUBVERSION_SERVER)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (command_sub
                                        left_token: <Id.Left_DollarParen '$('>
                                        command_list: 
                                          (command.CommandList
                                            children: [
                                              (C {<sed>} {<-n>} {<2p>} 
                                                {(DQ ($ Id.VSub_DollarName '$FILEPATH_TEMP')) 
                                                  </server_version>
                                                }
                                              )
                                            ]
                                          )
                                      )
                                    }
                                  spids: [488]
                                )
                              ]
                            )
                            (command.If
                              arms: [
                                (if_arm
                                  cond: [
                                    (command.Sentence
                                      child: 
                                        (command.DBracket
                                          expr: 
                                            (bool_expr.Binary
                                              op_id: Id.BoolBinary_EqualTilde
                                              left: {($ Id.VSub_DollarName '$SUBVERSION_SERVER')}
                                              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:SERVER_ONLINE)
                                          op: assign_op.Equal
                                          rhs: {<1>}
                                          spids: [532]
                                        )
                                      ]
                                    )
                                    (C {<G_DIETPI-NOTIFY>} {<0>} 
                                      {
                                        (DQ <'Using update server: '> 
                                          (braced_var_sub
                                            token: <Id.VSub_Name URL_MIRROR_SERVERVERSION>
                                            bracket_op: 
                                              (bracket_op.ArrayIndex
                                                expr: 
                                                  (arith_expr.ArithWord
                                                    w: {($ Id.VSub_DollarName '$i')}
                                                  )
                                              )
                                          )
                                        )
                                      }
                                    )
                                    (command.ControlFlow
                                      token: <Id.ControlFlow_Break break>
                                    )
                                  ]
                                  spids: [508 528]
                                )
                              ]
                              else_action: [
                                (C {<G_DIETPI-NOTIFY>} {<2>} 
                                  {(DQ <'Invalid server version and/or update file unavailable'>)}
                                )
                              ]
                            )
                          ]
                          spids: [451 465]
                        )
                      ]
                      else_action: [
                        (C {<G_DIETPI-NOTIFY>} {<2>} 
                          {
                            (DQ <'No response from: '> 
                              (braced_var_sub
                                token: <Id.VSub_Name URL_MIRROR_SERVERVERSION>
                                bracket_op: 
                                  (bracket_op.ArrayIndex
                                    expr: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$i')})
                                  )
                              )
                            )
                          }
                        )
                      ]
                    )
                  ]
                )
            )
          ]
        )
    )
    (command.ShFunction
      name: Check_Update_Available
      body: 
        (command.BraceGroup
          children: [
            (command.Simple
              words: [{<rm>} {</DietPi/dietpi/.update_available>}]
              redirects: [(redir.Redir op:<Id.Redir_AndGreat '&>'> fd:-1 arg_word:{</dev/null>})]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DParen
                          child: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$SERVER_ONLINE')})
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (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 
'$DIETPIUPDATE_COREVERSION_CURRENT'
                                              )
                                            }
                                        )
                                      right: 
                                        (arith_expr.ArithWord
                                          w: {($ Id.VSub_DollarName '$COREVERSION_SERVER')}
                                        )
                                    )
                                )
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:UPDATE_REQUIRESNEWIMAGE)
                                  op: assign_op.Equal
                                  rhs: {<1>}
                                  spids: [667]
                                )
                              ]
                            )
                            (command.Simple
                              words: [{<echo>} {<-e>} {(DQ <-1>)}]
                              redirects: [
                                (redir.Redir
                                  op: <Id.Redir_Great '>'>
                                  fd: -1
                                  arg_word: {</DietPi/dietpi/.update_available>}
                                )
                              ]
                            )
                          ]
                          spids: [649 663]
                        )
                        (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 '$SUBVERSION_CURRENT')}
                                        )
                                      right: 
                                        (arith_expr.ArithWord
                                          w: {($ Id.VSub_DollarName '$SUBVERSION_SERVER')}
                                        )
                                    )
                                )
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:UPDATE_AVAILABLE)
                                  op: assign_op.Equal
                                  rhs: {<1>}
                                  spids: [707]
                                )
                              ]
                            )
                            (C {<echo>} {<-e>} {(DQ )})
                            (C {<G_DIETPI-NOTIFY>} {<0>} {(DQ <'Update available'>)})
                            (C {<G_DIETPI-NOTIFY>} {<2>} 
                              {
                                (DQ <'Current Version : '> 
                                  ($ Id.VSub_DollarName '$COREVERSION_CURRENT') <.> ($ Id.VSub_DollarName '$SUBVERSION_CURRENT')
                                )
                              }
                            )
                            (C {<G_DIETPI-NOTIFY>} {<2>} 
                              {
                                (DQ <'Server Version  : '> 
                                  ($ Id.VSub_DollarName '$COREVERSION_SERVER') <.> ($ Id.VSub_DollarName '$SUBVERSION_SERVER')
                                )
                              }
                            )
                            (command.Simple
                              words: [{<cat>}]
                              redirects: [
                                (redir.HereDoc
                                  op: <Id.Redir_DLess '<<'>
                                  fd: -1
                                  here_begin: {<_EOF_>}
                                  here_end_span_id: 772
                                  stdin_parts: [
                                    ($ Id.VSub_DollarName '$COREVERSION_SERVER')
                                    <.>
                                    ($ Id.VSub_DollarName '$SUBVERSION_SERVER')
                                    <'\n'>
                                  ]
                                )
                                (redir.Redir
                                  op: <Id.Redir_Great '>'>
                                  fd: -1
                                  arg_word: {</DietPi/dietpi/.update_available>}
                                )
                              ]
                            )
                          ]
                          spids: [689 703]
                        )
                      ]
                    )
                  ]
                  spids: [631 641]
                )
              ]
              else_action: [
                (C {<G_DIETPI-NOTIFY>} {<1>} 
                  {
                    (DQ 
                      <
'Unable to access update servers. Please check your connection, then run dietpi-update again.'
                      >
                    )
                  }
                )
                (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})
              ]
            )
          ]
        )
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:WHIP_BACKTITLE)
          op: assign_op.Equal
          rhs: {(SQ <DietPi-Update>)}
          spids: [818]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:WHIP_TITLE)
          op: assign_op.Equal
          rhs: {($ Id.VSub_DollarName '$WHIP_BACKTITLE')}
          spids: [824]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:CHOICE)
          op: assign_op.Equal
          rhs: {<0>}
          spids: [828]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:OPTION)
          op: assign_op.Equal
          rhs: {<0>}
          spids: [832]
        )
      ]
    )
    (command.ShFunction
      name: Menu_Update
      body: 
        (command.BraceGroup
          children: [
            (C {<whiptail>} {<--title>} {(DQ ($ Id.VSub_DollarName '$WHIP_TITLE'))} {<--yesno>} 
              {
                (DQ <'Update available   : https://goo.gl/G9ikqn\n'> <'Installed version  : '> 
                  ($ Id.VSub_DollarName '$COREVERSION_CURRENT') <.> ($ Id.VSub_DollarName '$SUBVERSION_CURRENT') <'\n'> <'Latest version     : '> 
                  ($ Id.VSub_DollarName '$COREVERSION_SERVER') <.> ($ Id.VSub_DollarName '$SUBVERSION_SERVER') <'\n'> <'\n'> 
                  <'---------------------------------Notice-------------------------------------\n'> 
                  <
"The benefit of DietPi is we use standard linux configurations and commands. The downside is we can't possibly accommodate or predict, every modifcation to Linux configurations files by the end user, during the update.\n"
                  > <'\n'> 
                  <
'Although we test the updates thoroughly, if you have made custom changes to Linux configuration files, outside of the DietPi programs, we highly recommend you create a backup of your system, before updating.\n'
                  > <'\n'> <'You can create a system backup, by running:\n'> <' - dietpi-backup\n'> 
                  <'----------------------------------------------------------------------------\n'> <'\n'> <'Do you wish to continue and update DietPi to v'> ($ Id.VSub_DollarName '$COREVERSION_SERVER') 
                  <.> ($ Id.VSub_DollarName '$SUBVERSION_SERVER') <'?'>
                )
              } {<--yes-button>} {(DQ <Ok>)} {<--no-button>} {(DQ <Exit>)} {<--defaultno>} {<--backtitle>} 
              {(DQ ($ Id.VSub_DollarName '$WHIP_BACKTITLE'))} {<24>} {<80>}
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:CHOICE)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_QMark '$?')}
                  spids: [908]
                )
              ]
            )
            (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:RUN_UPDATE)
                          op: assign_op.Equal
                          rhs: {<1>}
                          spids: [930]
                        )
                      ]
                    )
                  ]
                  spids: [912 926]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: Run_Update
      body: 
        (command.BraceGroup
          children: [
            (command.Simple
              words: [
                {<curl>}
                {<-k>}
                {<-L>}
                {
                  (braced_var_sub
                    token: <Id.VSub_Name URL_MIRROR_ZIP>
                    bracket_op: 
                      (bracket_op.ArrayIndex
                        expr: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$URL_MIRROR_INDEX')})
                      )
                  )
                }
              ]
              redirects: [
                (redir.Redir
                  op: <Id.Redir_Great '>'>
                  fd: -1
                  arg_word: {(DQ ($ Id.VSub_DollarName '$FILEPATH_TEMP')) </update.zip>}
                )
              ]
            )
            (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_QMark '$?')})
                              right: (arith_expr.ArithWord w:{<Id.Lit_Digits 0>})
                            )
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (C {<unzip>} {(DQ ($ Id.VSub_DollarName '$FILEPATH_TEMP')) </update.zip>} {<-d>} 
                      {(DQ ($ Id.VSub_DollarName '$FILEPATH_TEMP')) </>}
                    )
                    (command.Simple
                      words: [
                        {<rm>}
                        {(DQ ($ Id.VSub_DollarName '$FILEPATH_TEMP')) </DietPi-> 
                          (DQ ($ Id.VSub_DollarName '$GITBRANCH')) </dietpi/.> <Id.Lit_Star '*'>
                        }
                      ]
                      redirects: [
                        (redir.Redir
                          op: <Id.Redir_AndGreat '&>'>
                          fd: -1
                          arg_word: {</dev/null>}
                        )
                      ]
                    )
                    (C {<cp>} {<-Rf>} 
                      {(DQ ($ Id.VSub_DollarName '$FILEPATH_TEMP')) </DietPi-> 
                        (DQ ($ Id.VSub_DollarName '$GITBRANCH')) </dietpi>
                      } {</DietPi/>}
                    )
                    (C {<chmod>} {<-R>} {<Id.Lit_Other '+'> <x>} {</DietPi>})
                    (C {</DietPi/dietpi/func/dietpi-set_software>} {<verify_dietpi.txt>})
                    (command.WhileUntil
                      keyword: <Id.KW_While while>
                      cond: [
                        (command.Sentence
                          child: 
                            (command.DParen
                              child: 
                                (arith_expr.Binary
                                  op_id: Id.Arith_Less
                                  left: 
                                    (arith_expr.ArithWord
                                      w: {($ Id.VSub_DollarName '$SUBVERSION_CURRENT')}
                                    )
                                  right: 
                                    (arith_expr.ArithWord
                                      w: {($ Id.VSub_DollarName '$SUBVERSION_SERVER')}
                                    )
                                )
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                      body: 
                        (command.DoGroup
                          children: [
                            (C {<G_DIETPI-NOTIFY>} {<3>} {(SQ <'DietPi-Update Updating DietPi'>)})
                            (C {<G_DIETPI-NOTIFY>} {<2>} 
                              {
                                (DQ <'Current Version : '> 
                                  ($ Id.VSub_DollarName '$COREVERSION_CURRENT') <.> ($ Id.VSub_DollarName '$SUBVERSION_CURRENT')
                                )
                              }
                            )
                            (C {<G_DIETPI-NOTIFY>} {<2>} 
                              {
                                (DQ <'Server Version  : '> 
                                  ($ Id.VSub_DollarName '$COREVERSION_SERVER') <.> ($ Id.VSub_DollarName '$SUBVERSION_SERVER') <Id.Lit_Other '\\'> <n>
                                )
                              }
                            )
                            (C {<G_DIETPI-NOTIFY>} {<2>} 
                              {
                                (DQ <'Patching '> ($ Id.VSub_DollarName '$COREVERSION_CURRENT') <.> 
                                  ($ Id.VSub_DollarName '$SUBVERSION_CURRENT') <' to '> ($ Id.VSub_DollarName '$COREVERSION_CURRENT') <.> 
                                  (word_part.ArithSub
                                    anode: 
                                      (arith_expr.Binary
                                        op_id: Id.Arith_Plus
                                        left: 
                                          (arith_expr.ArithWord
                                            w: {($ Id.VSub_DollarName '$SUBVERSION_CURRENT')}
                                          )
                                        right: (arith_expr.ArithWord w:{<Id.Lit_Digits 1>})
                                      )
                                  )
                                )
                              }
                            )
                            (C {</DietPi/dietpi/patch_file>} 
                              {($ Id.VSub_DollarName '$SUBVERSION_CURRENT')} {($ Id.VSub_DollarName '$SUBVERSION_SERVER')}
                            )
                            (command.DParen
                              child: 
                                (arith_expr.UnaryAssign
                                  op_id: Id.Node_PostDPlus
                                  child: (sh_lhs_expr.Name name:SUBVERSION_CURRENT)
                                )
                            )
                            (command.Simple
                              words: [{<cat>}]
                              redirects: [
                                (redir.HereDoc
                                  op: <Id.Redir_DLess '<<'>
                                  fd: -1
                                  here_begin: {<_EOF_>}
                                  here_end_span_id: 1228
                                  stdin_parts: [
                                    ($ Id.VSub_DollarName '$COREVERSION_CURRENT')
                                    <'\n'>
                                    ($ Id.VSub_DollarName '$SUBVERSION_CURRENT')
                                    <'\n'>
                                  ]
                                )
                                (redir.Redir
                                  op: <Id.Redir_Great '>'>
                                  fd: -1
                                  arg_word: {</DietPi/dietpi/.version>}
                                )
                              ]
                            )
                            (C {<G_DIETPI-NOTIFY>} {<0>} 
                              {
                                (DQ <'Patch '> ($ Id.VSub_DollarName '$COREVERSION_CURRENT') <.> 
                                  ($ Id.VSub_DollarName '$SUBVERSION_CURRENT') <' completed'> <Id.Lit_Other '\\'> <n>
                                )
                              }
                            )
                            (C {<Get_Client_Version>})
                          ]
                        )
                    )
                    (command.Simple
                      words: [{<rm>} {</DietPi/dietpi/patch_file>}]
                      redirects: [
                        (redir.Redir
                          op: <Id.Redir_AndGreat '&>'>
                          fd: -1
                          arg_word: {</dev/null>}
                        )
                      ]
                    )
                    (command.Simple
                      words: [{<rm>} {</DietPi/dietpi/server_version>}]
                      redirects: [
                        (redir.Redir
                          op: <Id.Redir_AndGreat '&>'>
                          fd: -1
                          arg_word: {</dev/null>}
                        )
                      ]
                    )
                    (command.Simple
                      words: [{<rm>} {<-R>} {(DQ ($ Id.VSub_DollarName '$FILEPATH_TEMP'))}]
                      redirects: [
                        (redir.Redir
                          op: <Id.Redir_AndGreat '&>'>
                          fd: -1
                          arg_word: {</dev/null>}
                        )
                      ]
                    )
                  ]
                  spids: [988 1002]
                )
              ]
              else_action: [
                (C {<G_DIETPI-NOTIFY>} {<1>} 
                  {
                    (DQ 
                      <
'Download failed, unable to run update. Please try running dietpi-update again.'
                      >
                    )
                  }
                )
                (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})
              ]
            )
          ]
        )
    )
    (C {<G_DIETPI-NOTIFY>} {<3>} {<DietPi-Update>} {(SQ <'Checking for DietPi updates'>)})
    (command.Simple
      words: [{<rm>} {<-R>} {(DQ ($ Id.VSub_DollarName '$FILEPATH_TEMP'))}]
      redirects: [(redir.Redir op:<Id.Redir_AndGreat '&>'> fd:-1 arg_word:{</dev/null>})]
    )
    (command.Simple
      words: [{<mkdir>} {<-p>} {(DQ ($ Id.VSub_DollarName '$FILEPATH_TEMP'))}]
      redirects: [(redir.Redir op:<Id.Redir_AndGreat '&>'> fd:-1 arg_word:{</dev/null>})]
    )
    (C {<Get_Client_Version>})
    (C {<Get_Server_Version>})
    (C {<Check_Update_Available>})
    (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 2>})
                    )
                )
              terminator: <Id.Op_Semi _>
            )
          ]
          action: [
            (command.Simple
              words: [
                {<echo>}
                {<-e>}
                {(DQ <'Do nothing, now contained within Check_Update_Available()'>)}
              ]
              redirects: [(redir.Redir op:<Id.Redir_AndGreat '&>'> fd:-1 arg_word:{</dev/null>})]
            )
          ]
          spids: [1425 1439]
        )
      ]
      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 '$SERVER_ONLINE')})
                          right: (arith_expr.ArithWord w:{<Id.Lit_Digits 0>})
                        )
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
              action: [
                (C {<whiptail>} {<--title>} {(DQ <'Error - Server Offline'>)} {<--msgbox>} 
                  {
                    (DQ <'http://github.com is either offline, or, unable to connect '> 
                      <Id.Lit_Other '\\'> <'n '> <Id.Lit_Other '\\'> <'n No updates applied.'>
                    )
                  } {<12>} {<60>}
                )
              ]
              spids: [1477 1491]
            )
            (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 '$UPDATE_REQUIRESNEWIMAGE')}
                            )
                          right: (arith_expr.ArithWord w:{<Id.Lit_Digits 1>})
                        )
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
              action: [
                (C {<whiptail>} {<--title>} {(DQ <'New image required'>)} {<--msgbox>} 
                  {
                    (DQ <' Your version of DietPi is now obsolete and cannot be updated. '> 
                      <Id.Lit_Other '\\'> <n> <Id.Lit_Other '\\'> <'n Please download the latest DietPi image:'> <Id.Lit_Other '\\'> 
                      <'n - http://dietpi.com/downloads/images '> <Id.Lit_Other '\\'> <n> <Id.Lit_Other '\\'> <'n - Current Version : '> 
                      ($ Id.VSub_DollarName '$SUBVERSION_CURRENT') <' '> <Id.Lit_Other '\\'> <'n - Server Version  : '> ($ Id.VSub_DollarName '$SUBVERSION_SERVER') <' '> 
                      <Id.Lit_Other '\\'> <'n '>
                    )
                  } {<13>} {<70>}
                )
                (C {<G_DIETPI-NOTIFY>} {<1>} 
                  {(DQ <'Your version of DietPi is now obsolete and cannot be updated.'>)}
                )
                (C {<echo>} {<-e>} 
                  {
                    (DQ <'Please download the latest DietPi image:'> <Id.Lit_Other '\\'> 
                      <'n - http://dietpi.com/download '> <Id.Lit_Other '\\'> <n> <Id.Lit_Other '\\'> <'n - Current Version : '> 
                      ($ Id.VSub_DollarName '$SUBVERSION_CURRENT') <' '> <Id.Lit_Other '\\'> <'n - Server Version  : '> ($ Id.VSub_DollarName '$SUBVERSION_SERVER') <' '> 
                      <Id.Lit_Other '\\'> <'n '>
                    )
                  }
                )
              ]
              spids: [1523 1537]
            )
            (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 '$UPDATE_AVAILABLE')})
                          right: (arith_expr.ArithWord w:{<Id.Lit_Digits 1>})
                        )
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
              action: [
                (C {</DietPi/dietpi/dietpi-drive_manager>} {<2>})
                (command.If
                  arms: [
                    (if_arm
                      cond: [
                        (command.Sentence
                          child: 
                            (command.DParen
                              child: 
                                (arith_expr.Binary
                                  op_id: Id.Arith_NEqual
                                  left: (arith_expr.ArithWord w:{($ Id.VSub_QMark '$?')})
                                  right: (arith_expr.ArithWord w:{<Id.Lit_Digits 0>})
                                )
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                      action: [
                        (command.Simple
                          words: [{<echo>} {<1>}]
                          redirects: [
                            (redir.Redir
                              op: <Id.Redir_AndGreat '&>'>
                              fd: -1
                              arg_word: {</dev/null>}
                            )
                          ]
                        )
                      ]
                      spids: [1647 1661]
                    )
                    (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 {<G_DIETPI-NOTIFY>} {<0>} 
                          {(DQ <'Updates have been found and are being applied, please wait...'>)}
                        )
                        (C {<G_DIETPI-NOTIFY>} {<2>} 
                          {
                            (DQ <'Current Version : '> ($ Id.VSub_DollarName '$COREVERSION_CURRENT') 
                              <.> ($ Id.VSub_DollarName '$SUBVERSION_CURRENT')
                            )
                          }
                        )
                        (C {<G_DIETPI-NOTIFY>} {<2>} 
                          {
                            (DQ <'Server Version  : '> ($ Id.VSub_DollarName '$COREVERSION_SERVER') <.> 
                              ($ Id.VSub_DollarName '$SUBVERSION_SERVER')
                            )
                          }
                        )
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:RUN_UPDATE)
                              op: assign_op.Equal
                              rhs: {<1>}
                              spids: [1734]
                            )
                          ]
                        )
                      ]
                      spids: [1682 1696]
                    )
                  ]
                  else_action: [(C {<Menu_Update>})]
                )
              ]
              spids: [1620 1634]
            )
          ]
          else_action: [
            (C {<echo>} {<-e>} {(DQ )})
            (C {<G_DIETPI-NOTIFY>} {<0>} 
              {
                (DQ <'No updates required, your DietPi installation is up to date.'> 
                  <Id.Lit_Other '\\'> <n>
                )
              }
            )
            (C {<G_DIETPI-NOTIFY>} {<2>} 
              {
                (DQ <'Current Version : '> ($ Id.VSub_DollarName '$COREVERSION_CURRENT') <.> 
                  ($ Id.VSub_DollarName '$SUBVERSION_CURRENT')
                )
              }
            )
            (C {<G_DIETPI-NOTIFY>} {<2>} 
              {
                (DQ <'Server Version  : '> ($ Id.VSub_DollarName '$COREVERSION_SERVER') <.> 
                  ($ Id.VSub_DollarName '$SUBVERSION_SERVER')
                )
              }
            )
            (C {<sleep>} {<2>})
          ]
        )
        (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 '$RUN_UPDATE')})
                          right: (arith_expr.ArithWord w:{<Id.Lit_Digits 1>})
                        )
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
              action: [
                (C {</DietPi/dietpi/dietpi-services>} {<stop>})
                (command.If
                  arms: [
                    (if_arm
                      cond: [
                        (command.Sentence
                          child: 
                            (command.AndOr
                              ops: [Id.Op_DAmp]
                              children: [
                                (C {<Id.Lit_LBracket '['>} {<-f>} {</DietPi/dietpi/.installed>} 
                                  {<Id.Lit_RBracket ']'>}
                                )
                                (command.DParen
                                  child: 
                                    (arith_expr.ArithWord
                                      w: 
                                        {
                                          (command_sub
                                            left_token: <Id.Left_DollarParen '$('>
                                            command_list: 
                                              (command.CommandList
                                                children: [
                                                  (command.Pipeline
                                                    children: [
                                                      (C {<cat>} {</DietPi/dietpi/.installed>})
                                                      (C {<grep>} {<-ci>} {<-m1>} 
                                                        {(SQ <'^aSOFTWARE_INSTALL_STATE\\[93\\]=2'>)}
                                                      )
                                                    ]
                                                    negated: F
                                                  )
                                                ]
                                              )
                                          )
                                        }
                                    )
                                )
                              ]
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                      action: [(C {<systemctl>} {<start>} {<dnsmasq>}) (C {<sleep>} {<2>})]
                      spids: [1856 1893]
                    )
                  ]
                )
                (command.Simple
                  words: [{<rm>} {(DQ ($ Id.VSub_DollarName '$FP_LOG'))}]
                  redirects: [(redir.Redir op:<Id.Redir_AndGreat '&>'> fd:-1 arg_word:{</dev/null>})]
                )
                (command.Pipeline
                  children: [
                    (C {<Run_Update>})
                    (C {<tee>} {<-a>} {(DQ ($ Id.VSub_DollarName '$FP_LOG'))})
                  ]
                  negated: F
                )
                (command.Simple
                  words: [{<echo>} {<0>}]
                  redirects: [
                    (redir.Redir
                      op: <Id.Redir_Great '>'>
                      fd: -1
                      arg_word: {</DietPi/dietpi/.update_stage>}
                    )
                  ]
                )
                (command.Simple
                  words: [{<rm>} {</DietPi/dietpi/.update_available>}]
                  redirects: [(redir.Redir op:<Id.Redir_AndGreat '&>'> fd:-1 arg_word:{</dev/null>})]
                )
                (C {<sync>})
                (C {<G_DIETPI-NOTIFY>} {<3>} {<DietPi-Update>} {(DQ <Completed>)})
                (C {<G_DIETPI-NOTIFY>} {<2>} 
                  {
                    (DQ <'Current Version : '> ($ Id.VSub_DollarName '$COREVERSION_CURRENT') <.> 
                      ($ Id.VSub_DollarName '$SUBVERSION_CURRENT')
                    )
                  }
                )
                (C {<G_DIETPI-NOTIFY>} {<2>} 
                  {
                    (DQ <'Server Version  : '> ($ Id.VSub_DollarName '$COREVERSION_SERVER') <.> 
                      ($ Id.VSub_DollarName '$SUBVERSION_SERVER')
                    )
                  }
                )
                (C {<G_DIETPI-NOTIFY>} {<0>} {(DQ <'Update completed'>)})
                (C {<echo>} {<-e>} {(DQ )})
                (C {<echo>} {<-e>} 
                  {
                    (DQ <'Please reboot your system now, using the command '> <Id.Lit_Other '\\'> 
                      <'e[31;49;1mreboot'> <Id.Lit_Other '\\'> <'e[0m'>
                    )
                  }
                )
              ]
              spids: [1824 1838]
            )
          ]
        )
        (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: 
                                {
                                  (command_sub
                                    left_token: <Id.Left_DollarParen '$('>
                                    command_list: 
                                      (command.CommandList
                                        children: [
                                          (command.Pipeline
                                            children: [
                                              (C {<ps>} {<aux>})
                                              (C {<grep>} {<-ci>} {<-m1>} {(SQ <'[l]xpanel'>)})
                                            ]
                                            negated: F
                                          )
                                        ]
                                      )
                                  )
                                }
                            )
                          right: (arith_expr.ArithWord w:{<Id.Lit_Digits 1>})
                        )
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
              action: [(C {<read>} {<-p>} {(DQ <'Press any key to exit DietPi-Update...'>)})]
              spids: [2062 2092]
            )
          ]
        )
      ]
    )
    (command.Simple
      words: [{<rm>} {<-R>} {(DQ ($ Id.VSub_DollarName '$FILEPATH_TEMP'))}]
      redirects: [(redir.Redir op:<Id.Redir_AndGreat '&>'> fd:-1 arg_word:{</dev/null>})]
    )
    (C {<unset>} {<URL_MIRROR_SERVERVERSION>})
    (C {<unset>} {<URL_MIRROR_ZIP>})
    (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<0>})
  ]
)