(CommandList
  children: [
    (BraceGroup
      children: [
        (Assignment
          keyword: Assign_None
          pairs: [(assign_pair lhs:(LhsName name:INPUT) op:Equal rhs:{(0)} spids:[78])]
          spids: [78]
        )
        (If
          arms: [
            (if_arm
              cond: [
                (Sentence
                  child: 
                    (DBracket
                      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: [
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:INPUT)
                      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>)})
        (Assignment
          keyword: Assign_None
          pairs: [
            (assign_pair
              lhs: (LhsName name:GITBRANCH)
              op: Equal
              rhs: 
                {
                  (CommandSubPart
                    command_list: 
                      (CommandList
                        children: [
                          (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]
        )
        (Assignment
          keyword: Assign_None
          pairs: [
            (assign_pair
              lhs: (LhsName name:GITFORKOWNER)
              op: Equal
              rhs: 
                {
                  (CommandSubPart
                    command_list: 
                      (CommandList
                        children: [
                          (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]
        )
        (Assignment
          keyword: Assign_None
          pairs: [
            (assign_pair
              lhs: (LhsName name:FP_LOG)
              op: Equal
              rhs: {(SQ </var/tmp/dietpi/logs/dietpi-update.log>)}
              spids: [212]
            )
          ]
          spids: [212]
        )
        (Assignment
          keyword: Assign_None
          pairs: [
            (assign_pair
              lhs: (LhsName name:DIETPIUPDATE_COREVERSION_CURRENT)
              op: Equal
              rhs: {(6)}
              spids: [218]
            )
          ]
          spids: [218]
        )
        (Assignment
          keyword: Assign_None
          pairs: [
            (assign_pair
              lhs: (LhsName name:FILEPATH_TEMP)
              op: Equal
              rhs: {(DQ (/tmp/dietpi-update))}
              spids: [226]
            )
          ]
          spids: [226]
        )
        (Assignment
          keyword: Assign_None
          pairs: [(assign_pair lhs:(LhsName name:SERVER_ONLINE) op:Equal rhs:{(0)} spids:[233])]
          spids: [233]
        )
        (Assignment
          keyword: Assign_None
          pairs: [(assign_pair lhs:(LhsName name:UPDATE_AVAILABLE) op:Equal rhs:{(0)} spids:[237])]
          spids: [237]
        )
        (Assignment
          keyword: Assign_None
          pairs: [
            (assign_pair
              lhs: (LhsName name:UPDATE_REQUIRESNEWIMAGE)
              op: Equal
              rhs: {(0)}
              spids: [241]
            )
          ]
          spids: [241]
        )
        (Assignment
          keyword: Assign_None
          pairs: [(assign_pair lhs:(LhsName name:RUN_UPDATE) op:Equal rhs:{(0)} spids:[245])]
          spids: [245]
        )
        (Assignment
          keyword: Assign_None
          pairs: [(assign_pair lhs:(LhsName name:COREVERSION_CURRENT) op:Equal rhs:{(0)} spids:[250])]
          spids: [250]
        )
        (Assignment
          keyword: Assign_None
          pairs: [(assign_pair lhs:(LhsName name:SUBVERSION_CURRENT) op:Equal rhs:{(0)} spids:[254])]
          spids: [254]
        )
        (Assignment
          keyword: Assign_None
          pairs: [(assign_pair lhs:(LhsName name:COREVERSION_SERVER) op:Equal rhs:{(0)} spids:[259])]
          spids: [259]
        )
        (Assignment
          keyword: Assign_None
          pairs: [(assign_pair lhs:(LhsName name:SUBVERSION_SERVER) op:Equal rhs:{(0)} spids:[263])]
          spids: [263]
        )
        (Assignment
          keyword: Assign_None
          pairs: [(assign_pair lhs:(LhsName name:URL_MIRROR_INDEX) op:Equal rhs:{(0)} spids:[268])]
          spids: [268]
        )
        (Assignment
          keyword: Assign_None
          pairs: [
            (assign_pair
              lhs: (LhsName name:URL_MIRROR_SERVERVERSION)
              op: Equal
              rhs: 
                {
                  (ArrayLiteralPart
                    words: [
                      {
                        (DQ ('http://dietpi.com/downloads/dietpi-update_mirror/') 
                          ($ VSub_Name '$GITBRANCH') (/server_version-6)
                        )
                      }
                      {
                        (DQ ('https://raw.githubusercontent.com/') 
                          (BracedVarSub
                            token: <VSub_Name GITFORKOWNER>
                            suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(Fourdee)})
                            spids: [286 290]
                          ) (/DietPi/) ($ VSub_Name '$GITBRANCH') (/dietpi/server_version-6)
                        )
                      }
                    ]
                  )
                }
              spids: [272]
            )
          ]
          spids: [272]
        )
        (Assignment
          keyword: Assign_None
          pairs: [
            (assign_pair
              lhs: (LhsName name:URL_MIRROR_ZIP)
              op: Equal
              rhs: 
                {
                  (ArrayLiteralPart
                    words: [
                      {
                        (DQ ('http://dietpi.com/downloads/dietpi-update_mirror/') 
                          ($ VSub_Name '$GITBRANCH') (/DietPi-) ($ VSub_Name '$GITBRANCH') (.zip)
                        )
                      }
                      {
                        (DQ ('https://github.com/') 
                          (BracedVarSub
                            token: <VSub_Name GITFORKOWNER>
                            suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(Fourdee)})
                            spids: [318 322]
                          ) (/DietPi/archive/) ($ VSub_Name '$GITBRANCH') (.zip)
                        )
                      }
                    ]
                  )
                }
              spids: [302]
            )
          ]
          spids: [302]
        )
        (FuncDef
          name: Get_Client_Version
          body: 
            (BraceGroup
              children: [
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:COREVERSION_CURRENT)
                      op: Equal
                      rhs: 
                        {
                          (CommandSubPart
                            command_list: 
                              (CommandList
                                children: [(C {(sed)} {(-n)} {(1p)} {(/DietPi/dietpi/.version)})]
                              )
                            left_token: <Left_CommandSub '$('>
                            spids: [342 350]
                          )
                        }
                      spids: [341]
                    )
                  ]
                  spids: [341]
                )
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:SUBVERSION_CURRENT)
                      op: Equal
                      rhs: 
                        {
                          (CommandSubPart
                            command_list: 
                              (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]
        )
        (FuncDef
          name: Get_Server_Version
          body: 
            (BraceGroup
              children: [
                (ForExpr
                  init: 
                    (BinaryAssign
                      op_id: Arith_Equal
                      left: (LhsName name:i)
                      right: (ArithWord w:{(Lit_Digits 0)})
                    )
                  cond: 
                    (ArithBinary
                      op_id: Arith_Less
                      left: (ArithVarRef name:i)
                      right: 
                        (ArithWord
                          w: 
                            {
                              (BracedVarSub
                                token: <VSub_Name URL_MIRROR_SERVERVERSION>
                                prefix_op: VSub_Pound
                                bracket_op: (WholeArray op_id:Lit_At)
                                spids: [391 397]
                              )
                            }
                        )
                    )
                  update: (UnaryAssign op_id:Node_PostDPlus child:(LhsName name:i))
                  body: 
                    (DoGroup
                      children: [
                        (Assignment
                          keyword: Assign_None
                          pairs: [
                            (assign_pair
                              lhs: (LhsName name:URL_MIRROR_INDEX)
                              op: Equal
                              rhs: {($ VSub_Name '$i')}
                              spids: [410]
                            )
                          ]
                          spids: [410]
                        )
                        (C {(G_DIETPI-NOTIFY)} {(2)} 
                          {
                            (DQ ('Checking Mirror : ') 
                              (BracedVarSub
                                token: <VSub_Name URL_MIRROR_SERVERVERSION>
                                bracket_op: (ArrayIndex expr:(ArithWord w:{($ VSub_Name '$i')}))
                                spids: [421 426]
                              )
                            )
                          }
                        )
                        (SimpleCommand
                          words: [
                            {(curl)}
                            {(-k)}
                            {(-L)}
                            {
                              (BracedVarSub
                                token: <VSub_Name URL_MIRROR_SERVERVERSION>
                                bracket_op: (ArrayIndex expr:(ArithWord w:{($ VSub_Name '$i')}))
                                spids: [436 441]
                              )
                            }
                          ]
                          redirects: [
                            (Redir
                              op_id: Redir_Great
                              fd: 16777215
                              arg_word: {(DQ ($ VSub_Name '$FILEPATH_TEMP')) (/server_version)}
                              spids: [443]
                            )
                          ]
                        )
                        (If
                          arms: [
                            (if_arm
                              cond: [
                                (Sentence
                                  child: 
                                    (DParen
                                      child: 
                                        (ArithBinary
                                          op_id: Arith_DEqual
                                          left: (ArithWord w:{($ VSub_QMark '$?')})
                                          right: (ArithWord w:{(Lit_Digits 0)})
                                        )
                                    )
                                  terminator: <Op_Semi ';'>
                                )
                              ]
                              action: [
                                (Assignment
                                  keyword: Assign_None
                                  pairs: [
                                    (assign_pair
                                      lhs: (LhsName name:COREVERSION_SERVER)
                                      op: Equal
                                      rhs: 
                                        {
                                          (CommandSubPart
                                            command_list: 
                                              (CommandList
                                                children: [
                                                  (C {(sed)} {(-n)} {(1p)} 
                                                    {(DQ ($ VSub_Name '$FILEPATH_TEMP')) 
                                                      (/server_version)
                                                    }
                                                  )
                                                ]
                                              )
                                            left_token: <Left_CommandSub '$('>
                                            spids: [474 485]
                                          )
                                        }
                                      spids: [473]
                                    )
                                  ]
                                  spids: [473]
                                )
                                (Assignment
                                  keyword: Assign_None
                                  pairs: [
                                    (assign_pair
                                      lhs: (LhsName name:SUBVERSION_SERVER)
                                      op: Equal
                                      rhs: 
                                        {
                                          (CommandSubPart
                                            command_list: 
                                              (CommandList
                                                children: [
                                                  (C {(sed)} {(-n)} {(2p)} 
                                                    {(DQ ($ VSub_Name '$FILEPATH_TEMP')) 
                                                      (/server_version)
                                                    }
                                                  )
                                                ]
                                              )
                                            left_token: <Left_CommandSub '$('>
                                            spids: [489 500]
                                          )
                                        }
                                      spids: [488]
                                    )
                                  ]
                                  spids: [488]
                                )
                                (If
                                  arms: [
                                    (if_arm
                                      cond: [
                                        (Sentence
                                          child: 
                                            (DBracket
                                              expr: 
                                                (BoolBinary
                                                  op_id: BoolBinary_EqualTilde
                                                  left: {($ VSub_Name '$SUBVERSION_SERVER')}
                                                  right: 
                                                    {(Lit_Other '^') (-) (Lit_Other '?') 
                                                      (Lit_Other '[') (0-9) (Lit_Other ']') (Lit_Other '+') (Lit_Other '$')
                                                    }
                                                )
                                            )
                                          terminator: <Op_Semi ';'>
                                        )
                                      ]
                                      action: [
                                        (Assignment
                                          keyword: Assign_None
                                          pairs: [
                                            (assign_pair
                                              lhs: (LhsName name:SERVER_ONLINE)
                                              op: Equal
                                              rhs: {(1)}
                                              spids: [532]
                                            )
                                          ]
                                          spids: [532]
                                        )
                                        (C {(G_DIETPI-NOTIFY)} {(0)} 
                                          {
                                            (DQ ('Using update server: ') 
                                              (BracedVarSub
                                                token: <VSub_Name URL_MIRROR_SERVERVERSION>
                                                bracket_op: 
                                                  (ArrayIndex
                                                    expr: (ArithWord w:{($ VSub_Name '$i')})
                                                  )
                                                spids: [542 547]
                                              )
                                            )
                                          }
                                        )
                                        (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: ') 
                                  (BracedVarSub
                                    token: <VSub_Name URL_MIRROR_SERVERVERSION>
                                    bracket_op: (ArrayIndex expr:(ArithWord w:{($ VSub_Name '$i')}))
                                    spids: [584 589]
                                  )
                                )
                              }
                            )
                          ]
                          spids: [574 594]
                        )
                      ]
                      spids: [406 598]
                    )
                )
              ]
              spids: [373]
            )
          spids: [370 373]
        )
        (FuncDef
          name: Check_Update_Available
          body: 
            (BraceGroup
              children: [
                (Sentence
                  child: (C {(rm)} {(/DietPi/dietpi/.update_available)})
                  terminator: <Op_Amp '&'>
                )
                (SimpleCommand
                  redirects: [
                    (Redir
                      op_id: Redir_Great
                      fd: 16777215
                      arg_word: {(/dev/null)}
                      spids: [622]
                    )
                  ]
                )
                (If
                  arms: [
                    (if_arm
                      cond: [
                        (Sentence
                          child: (DParen child:(ArithWord w:{($ VSub_Name '$SERVER_ONLINE')}))
                          terminator: <Op_Semi ';'>
                        )
                      ]
                      action: [
                        (If
                          arms: [
                            (if_arm
                              cond: [
                                (Sentence
                                  child: 
                                    (DParen
                                      child: 
                                        (ArithBinary
                                          op_id: Arith_Less
                                          left: 
                                            (ArithWord
                                              w: {($ VSub_Name '$DIETPIUPDATE_COREVERSION_CURRENT')}
                                            )
                                          right: (ArithWord w:{($ VSub_Name '$COREVERSION_SERVER')})
                                        )
                                    )
                                  terminator: <Op_Semi ';'>
                                )
                              ]
                              action: [
                                (Assignment
                                  keyword: Assign_None
                                  pairs: [
                                    (assign_pair
                                      lhs: (LhsName name:UPDATE_REQUIRESNEWIMAGE)
                                      op: Equal
                                      rhs: {(1)}
                                      spids: [668]
                                    )
                                  ]
                                  spids: [668]
                                )
                                (SimpleCommand
                                  words: [{(echo)} {(-e)} {(DQ (-1))}]
                                  redirects: [
                                    (Redir
                                      op_id: Redir_Great
                                      fd: 16777215
                                      arg_word: {(/DietPi/dietpi/.update_available)}
                                      spids: [680]
                                    )
                                  ]
                                )
                              ]
                              spids: [16777215 664]
                            )
                            (if_arm
                              cond: [
                                (Sentence
                                  child: 
                                    (DParen
                                      child: 
                                        (ArithBinary
                                          op_id: Arith_Less
                                          left: (ArithWord w:{($ VSub_Name '$SUBVERSION_CURRENT')})
                                          right: (ArithWord w:{($ VSub_Name '$SUBVERSION_SERVER')})
                                        )
                                    )
                                  terminator: <Op_Semi ';'>
                                )
                              ]
                              action: [
                                (Assignment
                                  keyword: Assign_None
                                  pairs: [
                                    (assign_pair
                                      lhs: (LhsName name:UPDATE_AVAILABLE)
                                      op: Equal
                                      rhs: {(1)}
                                      spids: [708]
                                    )
                                  ]
                                  spids: [708]
                                )
                                (C {(echo)} {(-e)} {(DQ )})
                                (C {(G_DIETPI-NOTIFY)} {(0)} {(DQ ('Update available'))})
                                (C {(G_DIETPI-NOTIFY)} {(2)} 
                                  {
                                    (DQ ('Current Version : ') ($ VSub_Name '$COREVERSION_CURRENT') (.) 
                                      ($ VSub_Name '$SUBVERSION_CURRENT')
                                    )
                                  }
                                )
                                (C {(G_DIETPI-NOTIFY)} {(2)} 
                                  {
                                    (DQ ('Server Version  : ') ($ VSub_Name '$COREVERSION_SERVER') (.) 
                                      ($ VSub_Name '$SUBVERSION_SERVER')
                                    )
                                  }
                                )
                                (SimpleCommand
                                  words: [{(cat)}]
                                  redirects: [
                                    (HereDoc
                                      op_id: Redir_DLess
                                      fd: 16777215
                                      body: 
                                        {
                                          (DQ ($ VSub_Name '$COREVERSION_SERVER') (.) 
                                            ($ VSub_Name '$SUBVERSION_SERVER') ('\n')
                                          )
                                        }
                                      do_expansion: True
                                      here_end: _EOF_
                                      was_filled: T
                                      spids: [760]
                                    )
                                    (Redir
                                      op_id: Redir_Great
                                      fd: 16777215
                                      arg_word: {(/DietPi/dietpi/.update_available)}
                                      spids: [764]
                                    )
                                  ]
                                )
                              ]
                              spids: [690 704]
                            )
                          ]
                          spids: [16777215 775]
                        )
                      ]
                      spids: [16777215 642]
                    )
                  ]
                  else_action: [
                    (C {(G_DIETPI-NOTIFY)} {(1)} 
                      {
                        (DQ 
                          (
'Unable to access update servers. Please check your connection, then run dietpi-update again.'
                          )
                        )
                      }
                    )
                    (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})
                  ]
                  spids: [779 798]
                )
              ]
              spids: [609]
            )
          spids: [606 609]
        )
        (Assignment
          keyword: Assign_None
          pairs: [
            (assign_pair
              lhs: (LhsName name:WHIP_BACKTITLE)
              op: Equal
              rhs: {(SQ <DietPi-Update>)}
              spids: [818]
            )
          ]
          spids: [818]
        )
        (Assignment
          keyword: Assign_None
          pairs: [
            (assign_pair
              lhs: (LhsName name:WHIP_TITLE)
              op: Equal
              rhs: {($ VSub_Name '$WHIP_BACKTITLE')}
              spids: [824]
            )
          ]
          spids: [824]
        )
        (Assignment
          keyword: Assign_None
          pairs: [(assign_pair lhs:(LhsName name:CHOICE) op:Equal rhs:{(0)} spids:[828])]
          spids: [828]
        )
        (Assignment
          keyword: Assign_None
          pairs: [(assign_pair lhs:(LhsName name:OPTION) op:Equal rhs:{(0)} spids:[832])]
          spids: [832]
        )
        (FuncDef
          name: Menu_Update
          body: 
            (BraceGroup
              children: [
                (C {(whiptail)} {(--title)} {(DQ ($ VSub_Name '$WHIP_TITLE'))} {(--yesno)} 
                  {
                    (DQ ('Update available   : https://goo.gl/G9ikqn\n') ('Installed version  : ') 
                      ($ VSub_Name '$COREVERSION_CURRENT') (.) ($ VSub_Name '$SUBVERSION_CURRENT') ('\n') ('Latest version     : ') 
                      ($ VSub_Name '$COREVERSION_SERVER') (.) ($ VSub_Name '$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_Name '$COREVERSION_SERVER') (.) 
                      ($ VSub_Name '$SUBVERSION_SERVER') ('?')
                    )
                  } {(--yes-button)} {(DQ (Ok))} {(--no-button)} {(DQ (Exit))} {(--defaultno)} {(--backtitle)} 
                  {(DQ ($ VSub_Name '$WHIP_BACKTITLE'))} {(24)} {(80)}
                )
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:CHOICE)
                      op: Equal
                      rhs: {($ VSub_QMark '$?')}
                      spids: [908]
                    )
                  ]
                  spids: [908]
                )
                (If
                  arms: [
                    (if_arm
                      cond: [
                        (Sentence
                          child: 
                            (DParen
                              child: 
                                (ArithBinary
                                  op_id: Arith_DEqual
                                  left: (ArithWord w:{($ VSub_Name '$CHOICE')})
                                  right: (ArithWord w:{(Lit_Digits 0)})
                                )
                            )
                          terminator: <Op_Semi ';'>
                        )
                      ]
                      action: [
                        (Assignment
                          keyword: Assign_None
                          pairs: [
                            (assign_pair
                              lhs: (LhsName name:RUN_UPDATE)
                              op: Equal
                              rhs: {(1)}
                              spids: [930]
                            )
                          ]
                          spids: [930]
                        )
                      ]
                      spids: [16777215 926]
                    )
                  ]
                  spids: [16777215 935]
                )
              ]
              spids: [840]
            )
          spids: [837 840]
        )
        (FuncDef
          name: Run_Update
          body: 
            (BraceGroup
              children: [
                (SimpleCommand
                  words: [
                    {(curl)}
                    {(-k)}
                    {(-L)}
                    {
                      (BracedVarSub
                        token: <VSub_Name URL_MIRROR_ZIP>
                        bracket_op: (ArrayIndex expr:(ArithWord w:{($ VSub_Name '$URL_MIRROR_INDEX')}))
                        spids: [973 978]
                      )
                    }
                  ]
                  redirects: [
                    (Redir
                      op_id: Redir_Great
                      fd: 16777215
                      arg_word: {(DQ ($ VSub_Name '$FILEPATH_TEMP')) (/update.zip)}
                      spids: [980]
                    )
                  ]
                )
                (If
                  arms: [
                    (if_arm
                      cond: [
                        (Sentence
                          child: 
                            (DParen
                              child: 
                                (ArithBinary
                                  op_id: Arith_DEqual
                                  left: (ArithWord w:{($ VSub_QMark '$?')})
                                  right: (ArithWord w:{(Lit_Digits 0)})
                                )
                            )
                          terminator: <Op_Semi ';'>
                        )
                      ]
                      action: [
                        (C {(unzip)} {(DQ ($ VSub_Name '$FILEPATH_TEMP')) (/update.zip)} {(-d)} 
                          {(DQ ($ VSub_Name '$FILEPATH_TEMP')) (/)}
                        )
                        (Sentence
                          child: 
                            (C {(rm)} 
                              {(DQ ($ VSub_Name '$FILEPATH_TEMP')) (/DietPi-) 
                                (DQ ($ VSub_Name '$GITBRANCH')) (/dietpi/.) (Lit_Other '*')
                              }
                            )
                          terminator: <Op_Amp '&'>
                        )
                        (SimpleCommand
                          redirects: [
                            (Redir
                              op_id: Redir_Great
                              fd: 16777215
                              arg_word: {(/dev/null)}
                              spids: [1039]
                            )
                          ]
                        )
                        (C {(cp)} {(-Rf)} 
                          {(DQ ($ VSub_Name '$FILEPATH_TEMP')) (/DietPi-) 
                            (DQ ($ VSub_Name '$GITBRANCH')) (/dietpi)
                          } {(/DietPi/)}
                        )
                        (C {(chmod)} {(-R)} {(Lit_Other '+') (x)} {(/DietPi)})
                        (C {(/DietPi/dietpi/func/dietpi-set_software)} {(verify_dietpi.txt)})
                        (While
                          cond: [
                            (Sentence
                              child: 
                                (DParen
                                  child: 
                                    (ArithBinary
                                      op_id: Arith_Less
                                      left: (ArithWord w:{($ VSub_Name '$SUBVERSION_CURRENT')})
                                      right: (ArithWord w:{($ VSub_Name '$SUBVERSION_SERVER')})
                                    )
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          body: 
                            (DoGroup
                              children: [
                                (C {(G_DIETPI-NOTIFY)} {(3)} {(SQ <'DietPi-Update Updating DietPi'>)})
                                (C {(G_DIETPI-NOTIFY)} {(2)} 
                                  {
                                    (DQ ('Current Version : ') ($ VSub_Name '$COREVERSION_CURRENT') (.) 
                                      ($ VSub_Name '$SUBVERSION_CURRENT')
                                    )
                                  }
                                )
                                (C {(G_DIETPI-NOTIFY)} {(2)} 
                                  {
                                    (DQ ('Server Version  : ') ($ VSub_Name '$COREVERSION_SERVER') (.) 
                                      ($ VSub_Name '$SUBVERSION_SERVER') (Lit_Other '\\') (n)
                                    )
                                  }
                                )
                                (C {(G_DIETPI-NOTIFY)} {(2)} 
                                  {
                                    (DQ ('Patching ') ($ VSub_Name '$COREVERSION_CURRENT') (.) 
                                      ($ VSub_Name '$SUBVERSION_CURRENT') (' to ') ($ VSub_Name '$COREVERSION_CURRENT') (.) 
                                      (ArithSubPart
                                        anode: 
                                          (ArithBinary
                                            op_id: Arith_Plus
                                            left: (ArithWord w:{($ VSub_Name '$SUBVERSION_CURRENT')})
                                            right: (ArithWord w:{(Lit_Digits 1)})
                                          )
                                        spids: [1182 1191]
                                      )
                                    )
                                  }
                                )
                                (C {(/DietPi/dietpi/patch_file)} {($ VSub_Name '$SUBVERSION_CURRENT')} 
                                  {($ VSub_Name '$SUBVERSION_SERVER')}
                                )
                                (DParen
                                  child: 
                                    (UnaryAssign
                                      op_id: Node_PostDPlus
                                      child: (LhsName name:SUBVERSION_CURRENT)
                                    )
                                )
                                (SimpleCommand
                                  words: [{(cat)}]
                                  redirects: [
                                    (HereDoc
                                      op_id: Redir_DLess
                                      fd: 16777215
                                      body: 
                                        {
                                          (DQ ($ VSub_Name '$COREVERSION_CURRENT') ('\n') 
                                            ($ VSub_Name '$SUBVERSION_CURRENT') ('\n')
                                          )
                                        }
                                      do_expansion: True
                                      here_end: _EOF_
                                      was_filled: T
                                      spids: [1216]
                                    )
                                    (Redir
                                      op_id: Redir_Great
                                      fd: 16777215
                                      arg_word: {(/DietPi/dietpi/.version)}
                                      spids: [1220]
                                    )
                                  ]
                                )
                                (C {(G_DIETPI-NOTIFY)} {(0)} 
                                  {
                                    (DQ ('Patch ') ($ VSub_Name '$COREVERSION_CURRENT') (.) 
                                      ($ VSub_Name '$SUBVERSION_CURRENT') (' completed') (Lit_Other '\\') (n)
                                    )
                                  }
                                )
                                (C {(Get_Client_Version)})
                              ]
                              spids: [1126 1251]
                            )
                        )
                        (Sentence
                          child: (C {(rm)} {(/DietPi/dietpi/patch_file)})
                          terminator: <Op_Amp '&'>
                        )
                        (SimpleCommand
                          redirects: [
                            (Redir
                              op_id: Redir_Great
                              fd: 16777215
                              arg_word: {(/dev/null)}
                              spids: [1264]
                            )
                          ]
                        )
                        (Sentence
                          child: (C {(rm)} {(/DietPi/dietpi/server_version)})
                          terminator: <Op_Amp '&'>
                        )
                        (SimpleCommand
                          redirects: [
                            (Redir
                              op_id: Redir_Great
                              fd: 16777215
                              arg_word: {(/dev/null)}
                              spids: [1274]
                            )
                          ]
                        )
                        (Sentence
                          child: (C {(rm)} {(-R)} {(DQ ($ VSub_Name '$FILEPATH_TEMP'))})
                          terminator: <Op_Amp '&'>
                        )
                        (SimpleCommand
                          redirects: [
                            (Redir
                              op_id: Redir_Great
                              fd: 16777215
                              arg_word: {(/dev/null)}
                              spids: [1293]
                            )
                          ]
                        )
                      ]
                      spids: [16777215 1002]
                    )
                  ]
                  else_action: [
                    (C {(G_DIETPI-NOTIFY)} {(1)} 
                      {
                        (DQ 
                          (
'Download failed, unable to run update. Please try running dietpi-update again.'
                          )
                        )
                      }
                    )
                    (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})
                  ]
                  spids: [1303 1322]
                )
              ]
              spids: [959]
            )
          spids: [956 959]
        )
        (C {(G_DIETPI-NOTIFY)} {(3)} {(DietPi-Update)} {(SQ <'Checking for DietPi updates'>)})
        (Sentence
          child: (C {(rm)} {(-R)} {(DQ ($ VSub_Name '$FILEPATH_TEMP'))})
          terminator: <Op_Amp '&'>
        )
        (SimpleCommand
          redirects: [(Redir op_id:Redir_Great fd:16777215 arg_word:{(/dev/null)} spids:[1378])]
        )
        (Sentence
          child: (C {(mkdir)} {(-p)} {(DQ ($ VSub_Name '$FILEPATH_TEMP'))})
          terminator: <Op_Amp '&'>
        )
        (SimpleCommand
          redirects: [(Redir op_id:Redir_Great fd:16777215 arg_word:{(/dev/null)} spids:[1392])]
        )
        (C {(Get_Client_Version)})
        (C {(Get_Server_Version)})
        (C {(Check_Update_Available)})
        (If
          arms: [
            (if_arm
              cond: [
                (Sentence
                  child: 
                    (DParen
                      child: 
                        (ArithBinary
                          op_id: Arith_DEqual
                          left: (ArithWord w:{($ VSub_Name '$INPUT')})
                          right: (ArithWord w:{(Lit_Digits 2)})
                        )
                    )
                  terminator: <Op_Semi ';'>
                )
              ]
              action: [
                (Sentence
                  child: 
                    (C {(echo)} {(-e)} 
                      {(DQ ('Do nothing, now contained within Check_Update_Available()'))}
                    )
                  terminator: <Op_Amp '&'>
                )
                (SimpleCommand
                  redirects: [
                    (Redir
                      op_id: Redir_Great
                      fd: 16777215
                      arg_word: {(/dev/null)}
                      spids: [1457]
                    )
                  ]
                )
              ]
              spids: [16777215 1444]
            )
          ]
          else_action: [
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DParen
                          child: 
                            (ArithBinary
                              op_id: Arith_DEqual
                              left: (ArithWord w:{($ VSub_Name '$SERVER_ONLINE')})
                              right: (ArithWord w:{(Lit_Digits 0)})
                            )
                        )
                      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 1497]
                )
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DParen
                          child: 
                            (ArithBinary
                              op_id: Arith_DEqual
                              left: (ArithWord w:{($ VSub_Name '$UPDATE_REQUIRESNEWIMAGE')})
                              right: (ArithWord w:{(Lit_Digits 1)})
                            )
                        )
                      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_Name '$SUBVERSION_CURRENT') (' ') 
                          (Lit_Other '\\') ('n - Server Version  : ') ($ VSub_Name '$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_Name '$SUBVERSION_CURRENT') (' ') 
                          (Lit_Other '\\') ('n - Server Version  : ') ($ VSub_Name '$SUBVERSION_SERVER') (' ') (Lit_Other '\\') ('n ')
                        )
                      }
                    )
                  ]
                  spids: [1529 1543]
                )
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DParen
                          child: 
                            (ArithBinary
                              op_id: Arith_DEqual
                              left: (ArithWord w:{($ VSub_Name '$UPDATE_AVAILABLE')})
                              right: (ArithWord w:{(Lit_Digits 1)})
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(/DietPi/dietpi/dietpi-drive_manager)} {(2)})
                    (If
                      arms: [
                        (if_arm
                          cond: [
                            (Sentence
                              child: 
                                (DParen
                                  child: 
                                    (ArithBinary
                                      op_id: Arith_NEqual
                                      left: (ArithWord w:{($ VSub_QMark '$?')})
                                      right: (ArithWord w:{(Lit_Digits 0)})
                                    )
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (Sentence
                              child: (C {(echo)} {(1)})
                              terminator: <Op_Amp '&'>
                            )
                            (SimpleCommand
                              redirects: [
                                (Redir
                                  op_id: Redir_Great
                                  fd: 16777215
                                  arg_word: {(/dev/null)}
                                  spids: [1676]
                                )
                              ]
                            )
                          ]
                          spids: [16777215 1667]
                        )
                        (if_arm
                          cond: [
                            (Sentence
                              child: 
                                (DParen
                                  child: 
                                    (ArithBinary
                                      op_id: Arith_DEqual
                                      left: (ArithWord w:{($ VSub_Name '$INPUT')})
                                      right: (ArithWord w:{(Lit_Digits 1)})
                                    )
                                )
                              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_Name '$COREVERSION_CURRENT') (.) 
                                  ($ VSub_Name '$SUBVERSION_CURRENT')
                                )
                              }
                            )
                            (C {(G_DIETPI-NOTIFY)} {(2)} 
                              {
                                (DQ ('Server Version  : ') ($ VSub_Name '$COREVERSION_SERVER') (.) 
                                  ($ VSub_Name '$SUBVERSION_SERVER')
                                )
                              }
                            )
                            (Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:RUN_UPDATE)
                                  op: Equal
                                  rhs: {(1)}
                                  spids: [1741]
                                )
                              ]
                              spids: [1741]
                            )
                          ]
                          spids: [1689 1703]
                        )
                      ]
                      else_action: [(C {(Menu_Update)})]
                      spids: [1750 1758]
                    )
                  ]
                  spids: [1626 1640]
                )
              ]
              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_Name '$COREVERSION_CURRENT') (.) 
                      ($ VSub_Name '$SUBVERSION_CURRENT')
                    )
                  }
                )
                (C {(G_DIETPI-NOTIFY)} {(2)} 
                  {
                    (DQ ('Server Version  : ') ($ VSub_Name '$COREVERSION_SERVER') (.) 
                      ($ VSub_Name '$SUBVERSION_SERVER')
                    )
                  }
                )
                (C {(sleep)} {(2)})
              ]
              spids: [1766 1819]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DParen
                          child: 
                            (ArithBinary
                              op_id: Arith_DEqual
                              left: (ArithWord w:{($ VSub_Name '$RUN_UPDATE')})
                              right: (ArithWord w:{(Lit_Digits 1)})
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(/DietPi/dietpi/dietpi-services)} {(stop)})
                    (If
                      arms: [
                        (if_arm
                          cond: [
                            (Sentence
                              child: 
                                (AndOr
                                  ops: [Op_DAmp]
                                  children: [
                                    (C {(Lit_Other '[')} {(-f)} {(/DietPi/dietpi/.installed)} 
                                      {(Lit_Other ']')}
                                    )
                                    (DParen
                                      child: 
                                        (ArithWord
                                          w: 
                                            {
                                              (CommandSubPart
                                                command_list: 
                                                  (CommandList
                                                    children: [
                                                      (Pipeline
                                                        children: [
                                                          (C {(cat)} {(/DietPi/dietpi/.installed)})
                                                          (C {(grep)} {(-ci)} {(-m1)} 
                                                            {
                                                              (SQ 
                                                                <
'^aSOFTWARE_INSTALL_STATE\\[93\\]=2'
                                                                >
                                                              )
                                                            }
                                                          )
                                                        ]
                                                        negated: F
                                                      )
                                                    ]
                                                  )
                                                left_token: <Left_CommandSub '$('>
                                                spids: [1878 1894]
                                              )
                                            }
                                        )
                                    )
                                  ]
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [(C {(systemctl)} {(start)} {(dnsmasq)}) (C {(sleep)} {(2)})]
                          spids: [16777215 1900]
                        )
                      ]
                      spids: [16777215 1917]
                    )
                    (Sentence
                      child: (C {(rm)} {(DQ ($ VSub_Name '$FP_LOG'))})
                      terminator: <Op_Amp '&'>
                    )
                    (SimpleCommand
                      redirects: [
                        (Redir
                          op_id: Redir_Great
                          fd: 16777215
                          arg_word: {(/dev/null)}
                          spids: [1932]
                        )
                      ]
                    )
                    (Pipeline
                      children: [(C {(Run_Update)}) (C {(tee)} {(-a)} {(DQ ($ VSub_Name '$FP_LOG'))})]
                      negated: F
                    )
                    (SimpleCommand
                      words: [{(echo)} {(0)}]
                      redirects: [
                        (Redir
                          op_id: Redir_Great
                          fd: 16777215
                          arg_word: {(/DietPi/dietpi/.update_stage)}
                          spids: [1960]
                        )
                      ]
                    )
                    (Sentence
                      child: (C {(rm)} {(/DietPi/dietpi/.update_available)})
                      terminator: <Op_Amp '&'>
                    )
                    (SimpleCommand
                      redirects: [
                        (Redir
                          op_id: Redir_Great
                          fd: 16777215
                          arg_word: {(/dev/null)}
                          spids: [1975]
                        )
                      ]
                    )
                    (C {(sync)})
                    (C {(G_DIETPI-NOTIFY)} {(3)} {(DietPi-Update)} {(DQ (Completed))})
                    (C {(G_DIETPI-NOTIFY)} {(2)} 
                      {
                        (DQ ('Current Version : ') ($ VSub_Name '$COREVERSION_CURRENT') (.) 
                          ($ VSub_Name '$SUBVERSION_CURRENT')
                        )
                      }
                    )
                    (C {(G_DIETPI-NOTIFY)} {(2)} 
                      {
                        (DQ ('Server Version  : ') ($ VSub_Name '$COREVERSION_SERVER') (.) 
                          ($ VSub_Name '$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 1845]
                )
              ]
              spids: [16777215 2059]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DParen
                          child: 
                            (ArithBinary
                              op_id: Arith_DEqual
                              left: 
                                (ArithWord
                                  w: 
                                    {
                                      (CommandSubPart
                                        command_list: 
                                          (CommandList
                                            children: [
                                              (Pipeline
                                                children: [
                                                  (C {(ps)} {(aux)})
                                                  (C {(grep)} {(-ci)} {(-m1)} {(SQ <'[l]xpanel'>)})
                                                ]
                                                negated: F
                                              )
                                            ]
                                          )
                                        left_token: <Left_CommandSub '$('>
                                        spids: [2075 2091]
                                      )
                                    }
                                )
                              right: (ArithWord w:{(Lit_Digits 1)})
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [(C {(read)} {(-p)} {(DQ ('Press any key to exit DietPi-Update...'))})]
                  spids: [16777215 2101]
                )
              ]
              spids: [16777215 2115]
            )
          ]
          spids: [1471 2119]
        )
        (Sentence
          child: (C {(rm)} {(-R)} {(DQ ($ VSub_Name '$FILEPATH_TEMP'))})
          terminator: <Op_Amp '&'>
        )
        (SimpleCommand
          redirects: [(Redir op_id:Redir_Great fd:16777215 arg_word:{(/dev/null)} spids:[2140])]
        )
        (C {(unset)} {(URL_MIRROR_SERVERVERSION)})
        (C {(unset)} {(URL_MIRROR_ZIP)})
        (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)})
      ]
      spids: [6]
    )
  ]
)