(command.BraceGroup
  children: [
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:INPUT spids:[78])
          op: Equal
          rhs: {(0)}
          spids: [78]
        )
      ]
      spids: [78]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.DBracket
                  expr: 
                    (bool_expr.BoolBinary
                      op_id: BoolBinary_EqualTilde
                      left: {($ VSub_Number '$1')}
                      right: 
                        {(Lit_Other '^') (-) (Lit_Other '?') (Lit_Other '[') (0-9) (Lit_Other ']') 
                          (Lit_Other '+') (Lit_Other '$')
                        }
                    )
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:INPUT spids:[106])
                  op: Equal
                  rhs: {($ VSub_Number '$1')}
                  spids: [106]
                )
              ]
              spids: [106]
            )
          ]
          spids: [16777215 102]
        )
      ]
      spids: [16777215 111]
    )
    (C {(.)} {(/DietPi/dietpi/func/dietpi-globals)})
    (C {(G_CHECK_ROOT_USER)})
    (C {(G_CHECK_ROOTFS_RW)})
    (C {(export)} {(Lit_VarLike 'G_PROGRAM_NAME=') (SQ <DietPi-Update>)})
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:GITBRANCH spids:[155])
          op: Equal
          rhs: 
            {
              (word_part.CommandSubPart
                command_list: 
                  (command.CommandList
                    children: [
                      (command.Pipeline
                        children: [
                          (C {(grep)} {(-m1)} {(SQ <'^DEV_GITBRANCH='>)} {(/DietPi/dietpi.txt)})
                          (C {(sed)} {(SQ <'s/.*=//'>)})
                        ]
                        negated: F
                      )
                    ]
                  )
                left_token: <Left_CommandSub '$('>
                spids: [156 174]
              )
            }
          spids: [155]
        )
      ]
      spids: [155]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:GITFORKOWNER spids:[177])
          op: Equal
          rhs: 
            {
              (word_part.CommandSubPart
                command_list: 
                  (command.CommandList
                    children: [
                      (command.Pipeline
                        children: [
                          (C {(grep)} {(-m1)} {(SQ <'^DEV_GITOWNER='>)} {(/DietPi/dietpi.txt)})
                          (C {(sed)} {(SQ <'s/.*=//'>)})
                        ]
                        negated: F
                      )
                    ]
                  )
                left_token: <Left_CommandSub '$('>
                spids: [178 196]
              )
            }
          spids: [177]
        )
      ]
      spids: [177]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:FP_LOG spids:[212])
          op: Equal
          rhs: {(SQ </var/tmp/dietpi/logs/dietpi-update.log>)}
          spids: [212]
        )
      ]
      spids: [212]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:DIETPIUPDATE_COREVERSION_CURRENT spids:[218])
          op: Equal
          rhs: {(6)}
          spids: [218]
        )
      ]
      spids: [218]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:FILEPATH_TEMP spids:[226])
          op: Equal
          rhs: {(DQ (/tmp/dietpi-update))}
          spids: [226]
        )
      ]
      spids: [226]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:SERVER_ONLINE spids:[233])
          op: Equal
          rhs: {(0)}
          spids: [233]
        )
      ]
      spids: [233]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:UPDATE_AVAILABLE spids:[237])
          op: Equal
          rhs: {(0)}
          spids: [237]
        )
      ]
      spids: [237]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:UPDATE_REQUIRESNEWIMAGE spids:[241])
          op: Equal
          rhs: {(0)}
          spids: [241]
        )
      ]
      spids: [241]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:RUN_UPDATE spids:[245])
          op: Equal
          rhs: {(0)}
          spids: [245]
        )
      ]
      spids: [245]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:COREVERSION_CURRENT spids:[250])
          op: Equal
          rhs: {(0)}
          spids: [250]
        )
      ]
      spids: [250]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:SUBVERSION_CURRENT spids:[254])
          op: Equal
          rhs: {(0)}
          spids: [254]
        )
      ]
      spids: [254]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:COREVERSION_SERVER spids:[259])
          op: Equal
          rhs: {(0)}
          spids: [259]
        )
      ]
      spids: [259]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:SUBVERSION_SERVER spids:[263])
          op: Equal
          rhs: {(0)}
          spids: [263]
        )
      ]
      spids: [263]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:URL_MIRROR_INDEX spids:[268])
          op: Equal
          rhs: {(0)}
          spids: [268]
        )
      ]
      spids: [268]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:URL_MIRROR_SERVERVERSION spids:[272])
          op: Equal
          rhs: 
            {
              (word_part.ArrayLiteralPart
                words: [
                  {
                    (DQ ('http://dietpi.com/downloads/dietpi-update_mirror/') 
                      ($ VSub_DollarName '$GITBRANCH') (/server_version-6)
                    )
                  }
                  {
                    (DQ ('https://raw.githubusercontent.com/') 
                      (word_part.BracedVarSub
                        token: <VSub_Name GITFORKOWNER>
                        suffix_op: (suffix_op.StringUnary op_id:VTest_ColonHyphen arg_word:{(Fourdee)})
                        spids: [286 290]
                      ) (/DietPi/) ($ VSub_DollarName '$GITBRANCH') (/dietpi/server_version-6)
                    )
                  }
                ]
              )
            }
          spids: [272]
        )
      ]
      spids: [272]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:URL_MIRROR_ZIP spids:[302])
          op: Equal
          rhs: 
            {
              (word_part.ArrayLiteralPart
                words: [
                  {
                    (DQ ('http://dietpi.com/downloads/dietpi-update_mirror/') 
                      ($ VSub_DollarName '$GITBRANCH') (/DietPi-) ($ VSub_DollarName '$GITBRANCH') (.zip)
                    )
                  }
                  {
                    (DQ ('https://github.com/') 
                      (word_part.BracedVarSub
                        token: <VSub_Name GITFORKOWNER>
                        suffix_op: (suffix_op.StringUnary op_id:VTest_ColonHyphen arg_word:{(Fourdee)})
                        spids: [318 322]
                      ) (/DietPi/archive/) ($ VSub_DollarName '$GITBRANCH') (.zip)
                    )
                  }
                ]
              )
            }
          spids: [302]
        )
      ]
      spids: [302]
    )
    (command.FuncDef
      name: Get_Client_Version
      body: 
        (command.BraceGroup
          children: [
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:COREVERSION_CURRENT spids:[341])
                  op: Equal
                  rhs: 
                    {
                      (word_part.CommandSubPart
                        command_list: 
                          (command.CommandList
                            children: [(C {(sed)} {(-n)} {(1p)} {(/DietPi/dietpi/.version)})]
                          )
                        left_token: <Left_CommandSub '$('>
                        spids: [342 350]
                      )
                    }
                  spids: [341]
                )
              ]
              spids: [341]
            )
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:SUBVERSION_CURRENT spids:[353])
                  op: Equal
                  rhs: 
                    {
                      (word_part.CommandSubPart
                        command_list: 
                          (command.CommandList
                            children: [(C {(sed)} {(-n)} {(2p)} {(/DietPi/dietpi/.version)})]
                          )
                        left_token: <Left_CommandSub '$('>
                        spids: [354 362]
                      )
                    }
                  spids: [353]
                )
              ]
              spids: [353]
            )
          ]
          spids: [337]
        )
      spids: [334 337]
    )
    (command.FuncDef
      name: Get_Server_Version
      body: 
        (command.BraceGroup
          children: [
            (command.ForExpr
              init: 
                (arith_expr.BinaryAssign
                  op_id: Arith_Equal
                  left: (lhs_expr.LhsName name:i spids:[384])
                  right: (arith_expr.ArithWord w:{(Lit_Digits 0)})
                )
              cond: 
                (arith_expr.ArithBinary
                  op_id: Arith_Less
                  left: (arith_expr.ArithVarRef token:<Lit_ArithVarLike i>)
                  right: 
                    (arith_expr.ArithWord
                      w: 
                        {
                          (word_part.BracedVarSub
                            token: <VSub_Name URL_MIRROR_SERVERVERSION>
                            prefix_op: VSub_Pound
                            bracket_op: (bracket_op.WholeArray op_id:Lit_At)
                            spids: [391 397]
                          )
                        }
                    )
                )
              update: 
                (arith_expr.UnaryAssign
                  op_id: Node_PostDPlus
                  child: (lhs_expr.LhsName name:i spids:[400])
                )
              body: 
                (command.DoGroup
                  children: [
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:URL_MIRROR_INDEX spids:[410])
                          op: Equal
                          rhs: {($ VSub_DollarName '$i')}
                          spids: [410]
                        )
                      ]
                      spids: [410]
                    )
                    (C {(G_DIETPI-NOTIFY)} {(2)} 
                      {
                        (DQ ('Checking Mirror : ') 
                          (word_part.BracedVarSub
                            token: <VSub_Name URL_MIRROR_SERVERVERSION>
                            bracket_op: 
                              (bracket_op.ArrayIndex
                                expr: (arith_expr.ArithWord w:{($ VSub_DollarName '$i')})
                              )
                            spids: [421 426]
                          )
                        )
                      }
                    )
                    (command.SimpleCommand
                      words: [
                        {(curl)}
                        {(-k)}
                        {(-L)}
                        {
                          (word_part.BracedVarSub
                            token: <VSub_Name URL_MIRROR_SERVERVERSION>
                            bracket_op: 
                              (bracket_op.ArrayIndex
                                expr: (arith_expr.ArithWord w:{($ VSub_DollarName '$i')})
                              )
                            spids: [436 441]
                          )
                        }
                      ]
                      redirects: [
                        (redir.Redir
                          op: <Redir_Great '>'>
                          fd: 16777215
                          arg_word: {(DQ ($ VSub_DollarName '$FILEPATH_TEMP')) (/server_version)}
                        )
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.DParen
                                  child: 
                                    (arith_expr.ArithBinary
                                      op_id: Arith_DEqual
                                      left: (arith_expr.ArithWord w:{($ VSub_QMark '$?')})
                                      right: (arith_expr.ArithWord w:{(Lit_Digits 0)})
                                    )
                                  spids: [453 462]
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (command.Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (lhs_expr.LhsName name:COREVERSION_SERVER spids:[473])
                                  op: Equal
                                  rhs: 
                                    {
                                      (word_part.CommandSubPart
                                        command_list: 
                                          (command.CommandList
                                            children: [
                                              (C {(sed)} {(-n)} {(1p)} 
                                                {(DQ ($ VSub_DollarName '$FILEPATH_TEMP')) 
                                                  (/server_version)
                                                }
                                              )
                                            ]
                                          )
                                        left_token: <Left_CommandSub '$('>
                                        spids: [474 485]
                                      )
                                    }
                                  spids: [473]
                                )
                              ]
                              spids: [473]
                            )
                            (command.Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (lhs_expr.LhsName name:SUBVERSION_SERVER spids:[488])
                                  op: Equal
                                  rhs: 
                                    {
                                      (word_part.CommandSubPart
                                        command_list: 
                                          (command.CommandList
                                            children: [
                                              (C {(sed)} {(-n)} {(2p)} 
                                                {(DQ ($ VSub_DollarName '$FILEPATH_TEMP')) 
                                                  (/server_version)
                                                }
                                              )
                                            ]
                                          )
                                        left_token: <Left_CommandSub '$('>
                                        spids: [489 500]
                                      )
                                    }
                                  spids: [488]
                                )
                              ]
                              spids: [488]
                            )
                            (command.If
                              arms: [
                                (if_arm
                                  cond: [
                                    (command.Sentence
                                      child: 
                                        (command.DBracket
                                          expr: 
                                            (bool_expr.BoolBinary
                                              op_id: BoolBinary_EqualTilde
                                              left: {($ VSub_DollarName '$SUBVERSION_SERVER')}
                                              right: 
                                                {(Lit_Other '^') (-) (Lit_Other '?') (Lit_Other '[') 
                                                  (0-9) (Lit_Other ']') (Lit_Other '+') (Lit_Other '$')
                                                }
                                            )
                                        )
                                      terminator: <Op_Semi ';'>
                                    )
                                  ]
                                  action: [
                                    (command.Assignment
                                      keyword: Assign_None
                                      pairs: [
                                        (assign_pair
                                          lhs: (lhs_expr.LhsName name:SERVER_ONLINE spids:[532])
                                          op: Equal
                                          rhs: {(1)}
                                          spids: [532]
                                        )
                                      ]
                                      spids: [532]
                                    )
                                    (C {(G_DIETPI-NOTIFY)} {(0)} 
                                      {
                                        (DQ ('Using update server: ') 
                                          (word_part.BracedVarSub
                                            token: <VSub_Name URL_MIRROR_SERVERVERSION>
                                            bracket_op: 
                                              (bracket_op.ArrayIndex
                                                expr: 
                                                  (arith_expr.ArithWord
                                                    w: {($ VSub_DollarName '$i')}
                                                  )
                                              )
                                            spids: [542 547]
                                          )
                                        )
                                      }
                                    )
                                    (command.ControlFlow
                                      token: <ControlFlow_Break break>
                                    )
                                  ]
                                  spids: [16777215 528]
                                )
                              ]
                              else_action: [
                                (C {(G_DIETPI-NOTIFY)} {(2)} 
                                  {(DQ ('Invalid server version and/or update file unavailable'))}
                                )
                              ]
                              spids: [556 570]
                            )
                          ]
                          spids: [16777215 465]
                        )
                      ]
                      else_action: [
                        (C {(G_DIETPI-NOTIFY)} {(2)} 
                          {
                            (DQ ('No response from: ') 
                              (word_part.BracedVarSub
                                token: <VSub_Name URL_MIRROR_SERVERVERSION>
                                bracket_op: 
                                  (bracket_op.ArrayIndex
                                    expr: (arith_expr.ArithWord w:{($ VSub_DollarName '$i')})
                                  )
                                spids: [584 589]
                              )
                            )
                          }
                        )
                      ]
                      spids: [574 594]
                    )
                  ]
                  spids: [406 598]
                )
            )
          ]
          spids: [373]
        )
      spids: [370 373]
    )
    (command.FuncDef
      name: Check_Update_Available
      body: 
        (command.BraceGroup
          children: [
            (command.SimpleCommand
              words: [{(rm)} {(/DietPi/dietpi/.update_available)}]
              redirects: [(redir.Redir op:<Redir_AndGreat '&>'> fd:16777215 arg_word:{(/dev/null)})]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DParen
                          child: (arith_expr.ArithWord w:{($ VSub_DollarName '$SERVER_ONLINE')})
                          spids: [633 638]
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.DParen
                                  child: 
                                    (arith_expr.ArithBinary
                                      op_id: Arith_Less
                                      left: 
                                        (arith_expr.ArithWord
                                          w: {($ VSub_DollarName '$DIETPIUPDATE_COREVERSION_CURRENT')}
                                        )
                                      right: 
                                        (arith_expr.ArithWord
                                          w: {($ VSub_DollarName '$COREVERSION_SERVER')}
                                        )
                                    )
                                  spids: [651 660]
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (command.Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (lhs_expr.LhsName name:UPDATE_REQUIRESNEWIMAGE spids:[667])
                                  op: Equal
                                  rhs: {(1)}
                                  spids: [667]
                                )
                              ]
                              spids: [667]
                            )
                            (command.SimpleCommand
                              words: [{(echo)} {(-e)} {(DQ (-1))}]
                              redirects: [
                                (redir.Redir
                                  op: <Redir_Great '>'>
                                  fd: 16777215
                                  arg_word: {(/DietPi/dietpi/.update_available)}
                                )
                              ]
                            )
                          ]
                          spids: [16777215 663]
                        )
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.DParen
                                  child: 
                                    (arith_expr.ArithBinary
                                      op_id: Arith_Less
                                      left: 
                                        (arith_expr.ArithWord
                                          w: {($ VSub_DollarName '$SUBVERSION_CURRENT')}
                                        )
                                      right: 
                                        (arith_expr.ArithWord
                                          w: {($ VSub_DollarName '$SUBVERSION_SERVER')}
                                        )
                                    )
                                  spids: [691 700]
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (command.Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (lhs_expr.LhsName name:UPDATE_AVAILABLE spids:[707])
                                  op: Equal
                                  rhs: {(1)}
                                  spids: [707]
                                )
                              ]
                              spids: [707]
                            )
                            (C {(echo)} {(-e)} {(DQ )})
                            (C {(G_DIETPI-NOTIFY)} {(0)} {(DQ ('Update available'))})
                            (C {(G_DIETPI-NOTIFY)} {(2)} 
                              {
                                (DQ ('Current Version : ') ($ VSub_DollarName '$COREVERSION_CURRENT') 
                                  (.) ($ VSub_DollarName '$SUBVERSION_CURRENT')
                                )
                              }
                            )
                            (C {(G_DIETPI-NOTIFY)} {(2)} 
                              {
                                (DQ ('Server Version  : ') ($ VSub_DollarName '$COREVERSION_SERVER') 
                                  (.) ($ VSub_DollarName '$SUBVERSION_SERVER')
                                )
                              }
                            )
                            (command.SimpleCommand
                              words: [{(cat)}]
                              redirects: [
                                (redir.HereDoc
                                  op: <Redir_DLess '<<'>
                                  fd: 16777215
                                  here_begin: {(_EOF_)}
                                  here_end_span_id: 772
                                  stdin_parts: [
                                    ($ VSub_DollarName '$COREVERSION_SERVER')
                                    (.)
                                    ($ VSub_DollarName '$SUBVERSION_SERVER')
                                    ('\n')
                                  ]
                                )
                                (redir.Redir
                                  op: <Redir_Great '>'>
                                  fd: 16777215
                                  arg_word: {(/DietPi/dietpi/.update_available)}
                                )
                              ]
                            )
                          ]
                          spids: [689 703]
                        )
                      ]
                      spids: [16777215 775]
                    )
                  ]
                  spids: [16777215 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:<ControlFlow_Exit exit> arg_word:{(1)})
              ]
              spids: [779 798]
            )
          ]
          spids: [609]
        )
      spids: [606 609]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:WHIP_BACKTITLE spids:[818])
          op: Equal
          rhs: {(SQ <DietPi-Update>)}
          spids: [818]
        )
      ]
      spids: [818]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:WHIP_TITLE spids:[824])
          op: Equal
          rhs: {($ VSub_DollarName '$WHIP_BACKTITLE')}
          spids: [824]
        )
      ]
      spids: [824]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:CHOICE spids:[828])
          op: Equal
          rhs: {(0)}
          spids: [828]
        )
      ]
      spids: [828]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:OPTION spids:[832])
          op: Equal
          rhs: {(0)}
          spids: [832]
        )
      ]
      spids: [832]
    )
    (command.FuncDef
      name: Menu_Update
      body: 
        (command.BraceGroup
          children: [
            (C {(whiptail)} {(--title)} {(DQ ($ VSub_DollarName '$WHIP_TITLE'))} {(--yesno)} 
              {
                (DQ ('Update available   : https://goo.gl/G9ikqn\n') ('Installed version  : ') 
                  ($ VSub_DollarName '$COREVERSION_CURRENT') (.) ($ VSub_DollarName '$SUBVERSION_CURRENT') ('\n') ('Latest version     : ') 
                  ($ VSub_DollarName '$COREVERSION_SERVER') (.) ($ 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') ($ VSub_DollarName '$COREVERSION_SERVER') (.) 
                  ($ VSub_DollarName '$SUBVERSION_SERVER') ('?')
                )
              } {(--yes-button)} {(DQ (Ok))} {(--no-button)} {(DQ (Exit))} {(--defaultno)} {(--backtitle)} 
              {(DQ ($ VSub_DollarName '$WHIP_BACKTITLE'))} {(24)} {(80)}
            )
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:CHOICE spids:[908])
                  op: Equal
                  rhs: {($ VSub_QMark '$?')}
                  spids: [908]
                )
              ]
              spids: [908]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DParen
                          child: 
                            (arith_expr.ArithBinary
                              op_id: Arith_DEqual
                              left: (arith_expr.ArithWord w:{($ VSub_DollarName '$CHOICE')})
                              right: (arith_expr.ArithWord w:{(Lit_Digits 0)})
                            )
                          spids: [914 923]
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:RUN_UPDATE spids:[930])
                          op: Equal
                          rhs: {(1)}
                          spids: [930]
                        )
                      ]
                      spids: [930]
                    )
                  ]
                  spids: [16777215 926]
                )
              ]
              spids: [16777215 935]
            )
          ]
          spids: [840]
        )
      spids: [837 840]
    )
    (command.FuncDef
      name: Run_Update
      body: 
        (command.BraceGroup
          children: [
            (command.SimpleCommand
              words: [
                {(curl)}
                {(-k)}
                {(-L)}
                {
                  (word_part.BracedVarSub
                    token: <VSub_Name URL_MIRROR_ZIP>
                    bracket_op: 
                      (bracket_op.ArrayIndex
                        expr: (arith_expr.ArithWord w:{($ VSub_DollarName '$URL_MIRROR_INDEX')})
                      )
                    spids: [973 978]
                  )
                }
              ]
              redirects: [
                (redir.Redir
                  op: <Redir_Great '>'>
                  fd: 16777215
                  arg_word: {(DQ ($ VSub_DollarName '$FILEPATH_TEMP')) (/update.zip)}
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DParen
                          child: 
                            (arith_expr.ArithBinary
                              op_id: Arith_DEqual
                              left: (arith_expr.ArithWord w:{($ VSub_QMark '$?')})
                              right: (arith_expr.ArithWord w:{(Lit_Digits 0)})
                            )
                          spids: [990 999]
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(unzip)} {(DQ ($ VSub_DollarName '$FILEPATH_TEMP')) (/update.zip)} {(-d)} 
                      {(DQ ($ VSub_DollarName '$FILEPATH_TEMP')) (/)}
                    )
                    (command.SimpleCommand
                      words: [
                        {(rm)}
                        {(DQ ($ VSub_DollarName '$FILEPATH_TEMP')) (/DietPi-) 
                          (DQ ($ VSub_DollarName '$GITBRANCH')) (/dietpi/.) (Lit_Other '*')
                        }
                      ]
                      redirects: [
                        (redir.Redir
                          op: <Redir_AndGreat '&>'>
                          fd: 16777215
                          arg_word: {(/dev/null)}
                        )
                      ]
                    )
                    (C {(cp)} {(-Rf)} 
                      {(DQ ($ VSub_DollarName '$FILEPATH_TEMP')) (/DietPi-) 
                        (DQ ($ VSub_DollarName '$GITBRANCH')) (/dietpi)
                      } {(/DietPi/)}
                    )
                    (C {(chmod)} {(-R)} {(Lit_Other '+') (x)} {(/DietPi)})
                    (C {(/DietPi/dietpi/func/dietpi-set_software)} {(verify_dietpi.txt)})
                    (command.WhileUntil
                      keyword: <KW_While while>
                      cond: [
                        (command.Sentence
                          child: 
                            (command.DParen
                              child: 
                                (arith_expr.ArithBinary
                                  op_id: Arith_Less
                                  left: 
                                    (arith_expr.ArithWord
                                      w: {($ VSub_DollarName '$SUBVERSION_CURRENT')}
                                    )
                                  right: 
                                    (arith_expr.ArithWord
                                      w: {($ VSub_DollarName '$SUBVERSION_SERVER')}
                                    )
                                )
                              spids: [1113 1122]
                            )
                          terminator: <Op_Semi ';'>
                        )
                      ]
                      body: 
                        (command.DoGroup
                          children: [
                            (C {(G_DIETPI-NOTIFY)} {(3)} {(SQ <'DietPi-Update Updating DietPi'>)})
                            (C {(G_DIETPI-NOTIFY)} {(2)} 
                              {
                                (DQ ('Current Version : ') ($ VSub_DollarName '$COREVERSION_CURRENT') 
                                  (.) ($ VSub_DollarName '$SUBVERSION_CURRENT')
                                )
                              }
                            )
                            (C {(G_DIETPI-NOTIFY)} {(2)} 
                              {
                                (DQ ('Server Version  : ') ($ VSub_DollarName '$COREVERSION_SERVER') 
                                  (.) ($ VSub_DollarName '$SUBVERSION_SERVER') (Lit_Other '\\') (n)
                                )
                              }
                            )
                            (C {(G_DIETPI-NOTIFY)} {(2)} 
                              {
                                (DQ ('Patching ') ($ VSub_DollarName '$COREVERSION_CURRENT') (.) 
                                  ($ VSub_DollarName '$SUBVERSION_CURRENT') (' to ') ($ VSub_DollarName '$COREVERSION_CURRENT') (.) 
                                  (word_part.ArithSubPart
                                    anode: 
                                      (arith_expr.ArithBinary
                                        op_id: Arith_Plus
                                        left: 
                                          (arith_expr.ArithWord
                                            w: {($ VSub_DollarName '$SUBVERSION_CURRENT')}
                                          )
                                        right: (arith_expr.ArithWord w:{(Lit_Digits 1)})
                                      )
                                    spids: [1181 1190]
                                  )
                                )
                              }
                            )
                            (C {(/DietPi/dietpi/patch_file)} 
                              {($ VSub_DollarName '$SUBVERSION_CURRENT')} {($ VSub_DollarName '$SUBVERSION_SERVER')}
                            )
                            (command.DParen
                              child: 
                                (arith_expr.UnaryAssign
                                  op_id: Node_PostDPlus
                                  child: (lhs_expr.LhsName name:SUBVERSION_CURRENT spids:[1207])
                                )
                              spids: [1206 1210]
                            )
                            (command.SimpleCommand
                              words: [{(cat)}]
                              redirects: [
                                (redir.HereDoc
                                  op: <Redir_DLess '<<'>
                                  fd: 16777215
                                  here_begin: {(_EOF_)}
                                  here_end_span_id: 1228
                                  stdin_parts: [
                                    ($ VSub_DollarName '$COREVERSION_CURRENT')
                                    ('\n')
                                    ($ VSub_DollarName '$SUBVERSION_CURRENT')
                                    ('\n')
                                  ]
                                )
                                (redir.Redir
                                  op: <Redir_Great '>'>
                                  fd: 16777215
                                  arg_word: {(/DietPi/dietpi/.version)}
                                )
                              ]
                            )
                            (C {(G_DIETPI-NOTIFY)} {(0)} 
                              {
                                (DQ ('Patch ') ($ VSub_DollarName '$COREVERSION_CURRENT') (.) 
                                  ($ VSub_DollarName '$SUBVERSION_CURRENT') (' completed') (Lit_Other '\\') (n)
                                )
                              }
                            )
                            (C {(Get_Client_Version)})
                          ]
                          spids: [1125 1251]
                        )
                    )
                    (command.SimpleCommand
                      words: [{(rm)} {(/DietPi/dietpi/patch_file)}]
                      redirects: [
                        (redir.Redir
                          op: <Redir_AndGreat '&>'>
                          fd: 16777215
                          arg_word: {(/dev/null)}
                        )
                      ]
                    )
                    (command.SimpleCommand
                      words: [{(rm)} {(/DietPi/dietpi/server_version)}]
                      redirects: [
                        (redir.Redir
                          op: <Redir_AndGreat '&>'>
                          fd: 16777215
                          arg_word: {(/dev/null)}
                        )
                      ]
                    )
                    (command.SimpleCommand
                      words: [{(rm)} {(-R)} {(DQ ($ VSub_DollarName '$FILEPATH_TEMP'))}]
                      redirects: [
                        (redir.Redir
                          op: <Redir_AndGreat '&>'>
                          fd: 16777215
                          arg_word: {(/dev/null)}
                        )
                      ]
                    )
                  ]
                  spids: [16777215 1002]
                )
              ]
              else_action: [
                (C {(G_DIETPI-NOTIFY)} {(1)} 
                  {
                    (DQ 
                      (
'Download failed, unable to run update. Please try running dietpi-update again.'
                      )
                    )
                  }
                )
                (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})
              ]
              spids: [1300 1319]
            )
          ]
          spids: [959]
        )
      spids: [956 959]
    )
    (C {(G_DIETPI-NOTIFY)} {(3)} {(DietPi-Update)} {(SQ <'Checking for DietPi updates'>)})
    (command.SimpleCommand
      words: [{(rm)} {(-R)} {(DQ ($ VSub_DollarName '$FILEPATH_TEMP'))}]
      redirects: [(redir.Redir op:<Redir_AndGreat '&>'> fd:16777215 arg_word:{(/dev/null)})]
    )
    (command.SimpleCommand
      words: [{(mkdir)} {(-p)} {(DQ ($ VSub_DollarName '$FILEPATH_TEMP'))}]
      redirects: [(redir.Redir op:<Redir_AndGreat '&>'> fd:16777215 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.ArithBinary
                      op_id: Arith_DEqual
                      left: (arith_expr.ArithWord w:{($ VSub_DollarName '$INPUT')})
                      right: (arith_expr.ArithWord w:{(Lit_Digits 2)})
                    )
                  spids: [1427 1436]
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (command.SimpleCommand
              words: [
                {(echo)}
                {(-e)}
                {(DQ ('Do nothing, now contained within Check_Update_Available()'))}
              ]
              redirects: [(redir.Redir op:<Redir_AndGreat '&>'> fd:16777215 arg_word:{(/dev/null)})]
            )
          ]
          spids: [16777215 1439]
        )
      ]
      else_action: [
        (command.If
          arms: [
            (if_arm
              cond: [
                (command.Sentence
                  child: 
                    (command.DParen
                      child: 
                        (arith_expr.ArithBinary
                          op_id: Arith_DEqual
                          left: (arith_expr.ArithWord w:{($ VSub_DollarName '$SERVER_ONLINE')})
                          right: (arith_expr.ArithWord w:{(Lit_Digits 0)})
                        )
                      spids: [1479 1488]
                    )
                  terminator: <Op_Semi ';'>
                )
              ]
              action: [
                (C {(whiptail)} {(--title)} {(DQ ('Error - Server Offline'))} {(--msgbox)} 
                  {
                    (DQ ('http://github.com is either offline, or, unable to connect ') 
                      (Lit_Other '\\') ('n ') (Lit_Other '\\') ('n No updates applied.')
                    )
                  } {(12)} {(60)}
                )
              ]
              spids: [16777215 1491]
            )
            (if_arm
              cond: [
                (command.Sentence
                  child: 
                    (command.DParen
                      child: 
                        (arith_expr.ArithBinary
                          op_id: Arith_DEqual
                          left: 
                            (arith_expr.ArithWord
                              w: {($ VSub_DollarName '$UPDATE_REQUIRESNEWIMAGE')}
                            )
                          right: (arith_expr.ArithWord w:{(Lit_Digits 1)})
                        )
                      spids: [1525 1534]
                    )
                  terminator: <Op_Semi ';'>
                )
              ]
              action: [
                (C {(whiptail)} {(--title)} {(DQ ('New image required'))} {(--msgbox)} 
                  {
                    (DQ (' Your version of DietPi is now obsolete and cannot be updated. ') 
                      (Lit_Other '\\') (n) (Lit_Other '\\') ('n Please download the latest DietPi image:') (Lit_Other '\\') 
                      ('n - http://dietpi.com/downloads/images ') (Lit_Other '\\') (n) (Lit_Other '\\') ('n - Current Version : ') 
                      ($ VSub_DollarName '$SUBVERSION_CURRENT') (' ') (Lit_Other '\\') ('n - Server Version  : ') ($ VSub_DollarName '$SUBVERSION_SERVER') (' ') 
                      (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:') (Lit_Other '\\') 
                      ('n - http://dietpi.com/download ') (Lit_Other '\\') (n) (Lit_Other '\\') ('n - Current Version : ') 
                      ($ VSub_DollarName '$SUBVERSION_CURRENT') (' ') (Lit_Other '\\') ('n - Server Version  : ') ($ VSub_DollarName '$SUBVERSION_SERVER') (' ') 
                      (Lit_Other '\\') ('n ')
                    )
                  }
                )
              ]
              spids: [1523 1537]
            )
            (if_arm
              cond: [
                (command.Sentence
                  child: 
                    (command.DParen
                      child: 
                        (arith_expr.ArithBinary
                          op_id: Arith_DEqual
                          left: (arith_expr.ArithWord w:{($ VSub_DollarName '$UPDATE_AVAILABLE')})
                          right: (arith_expr.ArithWord w:{(Lit_Digits 1)})
                        )
                      spids: [1622 1631]
                    )
                  terminator: <Op_Semi ';'>
                )
              ]
              action: [
                (C {(/DietPi/dietpi/dietpi-drive_manager)} {(2)})
                (command.If
                  arms: [
                    (if_arm
                      cond: [
                        (command.Sentence
                          child: 
                            (command.DParen
                              child: 
                                (arith_expr.ArithBinary
                                  op_id: Arith_NEqual
                                  left: (arith_expr.ArithWord w:{($ VSub_QMark '$?')})
                                  right: (arith_expr.ArithWord w:{(Lit_Digits 0)})
                                )
                              spids: [1649 1658]
                            )
                          terminator: <Op_Semi ';'>
                        )
                      ]
                      action: [
                        (command.SimpleCommand
                          words: [{(echo)} {(1)}]
                          redirects: [
                            (redir.Redir
                              op: <Redir_AndGreat '&>'>
                              fd: 16777215
                              arg_word: {(/dev/null)}
                            )
                          ]
                        )
                      ]
                      spids: [16777215 1661]
                    )
                    (if_arm
                      cond: [
                        (command.Sentence
                          child: 
                            (command.DParen
                              child: 
                                (arith_expr.ArithBinary
                                  op_id: Arith_DEqual
                                  left: (arith_expr.ArithWord w:{($ VSub_DollarName '$INPUT')})
                                  right: (arith_expr.ArithWord w:{(Lit_Digits 1)})
                                )
                              spids: [1684 1693]
                            )
                          terminator: <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 : ') ($ VSub_DollarName '$COREVERSION_CURRENT') (.) 
                              ($ VSub_DollarName '$SUBVERSION_CURRENT')
                            )
                          }
                        )
                        (C {(G_DIETPI-NOTIFY)} {(2)} 
                          {
                            (DQ ('Server Version  : ') ($ VSub_DollarName '$COREVERSION_SERVER') (.) 
                              ($ VSub_DollarName '$SUBVERSION_SERVER')
                            )
                          }
                        )
                        (command.Assignment
                          keyword: Assign_None
                          pairs: [
                            (assign_pair
                              lhs: (lhs_expr.LhsName name:RUN_UPDATE spids:[1734])
                              op: Equal
                              rhs: {(1)}
                              spids: [1734]
                            )
                          ]
                          spids: [1734]
                        )
                      ]
                      spids: [1682 1696]
                    )
                  ]
                  else_action: [(C {(Menu_Update)})]
                  spids: [1743 1751]
                )
              ]
              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.') (Lit_Other '\\') 
                  (n)
                )
              }
            )
            (C {(G_DIETPI-NOTIFY)} {(2)} 
              {
                (DQ ('Current Version : ') ($ VSub_DollarName '$COREVERSION_CURRENT') (.) 
                  ($ VSub_DollarName '$SUBVERSION_CURRENT')
                )
              }
            )
            (C {(G_DIETPI-NOTIFY)} {(2)} 
              {
                (DQ ('Server Version  : ') ($ VSub_DollarName '$COREVERSION_SERVER') (.) 
                  ($ VSub_DollarName '$SUBVERSION_SERVER')
                )
              }
            )
            (C {(sleep)} {(2)})
          ]
          spids: [1759 1812]
        )
        (command.If
          arms: [
            (if_arm
              cond: [
                (command.Sentence
                  child: 
                    (command.DParen
                      child: 
                        (arith_expr.ArithBinary
                          op_id: Arith_DEqual
                          left: (arith_expr.ArithWord w:{($ VSub_DollarName '$RUN_UPDATE')})
                          right: (arith_expr.ArithWord w:{(Lit_Digits 1)})
                        )
                      spids: [1826 1835]
                    )
                  terminator: <Op_Semi ';'>
                )
              ]
              action: [
                (C {(/DietPi/dietpi/dietpi-services)} {(stop)})
                (command.If
                  arms: [
                    (if_arm
                      cond: [
                        (command.Sentence
                          child: 
                            (command.AndOr
                              ops: [Op_DAmp]
                              children: [
                                (C {(Lit_Other '[')} {(-f)} {(/DietPi/dietpi/.installed)} 
                                  {(Lit_Other ']')}
                                )
                                (command.DParen
                                  child: 
                                    (arith_expr.ArithWord
                                      w: 
                                        {
                                          (word_part.CommandSubPart
                                            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
                                                  )
                                                ]
                                              )
                                            left_token: <Left_CommandSub '$('>
                                            spids: [1871 1887]
                                          )
                                        }
                                    )
                                  spids: [1869 1890]
                                )
                              ]
                            )
                          terminator: <Op_Semi ';'>
                        )
                      ]
                      action: [(C {(systemctl)} {(start)} {(dnsmasq)}) (C {(sleep)} {(2)})]
                      spids: [16777215 1893]
                    )
                  ]
                  spids: [16777215 1910]
                )
                (command.SimpleCommand
                  words: [{(rm)} {(DQ ($ VSub_DollarName '$FP_LOG'))}]
                  redirects: [(redir.Redir op:<Redir_AndGreat '&>'> fd:16777215 arg_word:{(/dev/null)})]
                )
                (command.Pipeline
                  children: [(C {(Run_Update)}) (C {(tee)} {(-a)} {(DQ ($ VSub_DollarName '$FP_LOG'))})]
                  negated: F
                )
                (command.SimpleCommand
                  words: [{(echo)} {(0)}]
                  redirects: [
                    (redir.Redir
                      op: <Redir_Great '>'>
                      fd: 16777215
                      arg_word: {(/DietPi/dietpi/.update_stage)}
                    )
                  ]
                )
                (command.SimpleCommand
                  words: [{(rm)} {(/DietPi/dietpi/.update_available)}]
                  redirects: [(redir.Redir op:<Redir_AndGreat '&>'> fd:16777215 arg_word:{(/dev/null)})]
                )
                (C {(sync)})
                (C {(G_DIETPI-NOTIFY)} {(3)} {(DietPi-Update)} {(DQ (Completed))})
                (C {(G_DIETPI-NOTIFY)} {(2)} 
                  {
                    (DQ ('Current Version : ') ($ VSub_DollarName '$COREVERSION_CURRENT') (.) 
                      ($ VSub_DollarName '$SUBVERSION_CURRENT')
                    )
                  }
                )
                (C {(G_DIETPI-NOTIFY)} {(2)} 
                  {
                    (DQ ('Server Version  : ') ($ VSub_DollarName '$COREVERSION_SERVER') (.) 
                      ($ 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 ') (Lit_Other '\\') 
                      ('e[31;49;1mreboot') (Lit_Other '\\') ('e[0m')
                    )
                  }
                )
              ]
              spids: [16777215 1838]
            )
          ]
          spids: [16777215 2050]
        )
        (command.If
          arms: [
            (if_arm
              cond: [
                (command.Sentence
                  child: 
                    (command.DParen
                      child: 
                        (arith_expr.ArithBinary
                          op_id: Arith_DEqual
                          left: 
                            (arith_expr.ArithWord
                              w: 
                                {
                                  (word_part.CommandSubPart
                                    command_list: 
                                      (command.CommandList
                                        children: [
                                          (command.Pipeline
                                            children: [
                                              (C {(ps)} {(aux)})
                                              (C {(grep)} {(-ci)} {(-m1)} {(SQ <'[l]xpanel'>)})
                                            ]
                                            negated: F
                                          )
                                        ]
                                      )
                                    left_token: <Left_CommandSub '$('>
                                    spids: [2066 2082]
                                  )
                                }
                            )
                          right: (arith_expr.ArithWord w:{(Lit_Digits 1)})
                        )
                      spids: [2064 2089]
                    )
                  terminator: <Op_Semi ';'>
                )
              ]
              action: [(C {(read)} {(-p)} {(DQ ('Press any key to exit DietPi-Update...'))})]
              spids: [16777215 2092]
            )
          ]
          spids: [16777215 2106]
        )
      ]
      spids: [1465 2110]
    )
    (command.SimpleCommand
      words: [{(rm)} {(-R)} {(DQ ($ VSub_DollarName '$FILEPATH_TEMP'))}]
      redirects: [(redir.Redir op:<Redir_AndGreat '&>'> fd:16777215 arg_word:{(/dev/null)})]
    )
    (C {(unset)} {(URL_MIRROR_SERVERVERSION)})
    (C {(unset)} {(URL_MIRROR_ZIP)})
    (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)})
  ]
  spids: [6]
)