(command.BraceGroup
  children: [
    (C {(.)} {(/DietPi/dietpi/func/dietpi-globals)})
    (C {(export)} {(Lit_VarLike 'G_PROGRAM_NAME=') (SQ <DietPi-Survey>)})
    (C {(G_CHECK_ROOT_USER)})
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:SURVEY_VERSION spids:[116])
          op: Equal
          rhs: {(4)}
          spids: [116]
        )
      ]
      spids: [116]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:SURVEY_SENTCOUNT spids:[120])
          op: Equal
          rhs: {(1)}
          spids: [120]
        )
      ]
      spids: [120]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:OPTED_IN spids:[125])
          op: Equal
          rhs: {(1)}
          spids: [125]
        )
      ]
      spids: [125]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:DIETPI_VERSION spids:[130])
          op: Equal
          rhs: 
            {
              (DQ 
                (word_part.CommandSubPart
                  command_list: 
                    (command.CommandList
                      children: [(C {(sed)} {(-n)} {(1p)} {(/DietPi/dietpi/.version)})]
                    )
                  left_token: <Left_CommandSub '$('>
                  spids: [132 140]
                ) (.) 
                (word_part.CommandSubPart
                  command_list: 
                    (command.CommandList
                      children: [(C {(sed)} {(-n)} {(2p)} {(/DietPi/dietpi/.version)})]
                    )
                  left_token: <Left_CommandSub '$('>
                  spids: [142 150]
                )
              )
            }
          spids: [130]
        )
      ]
      spids: [130]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:G_HW_MODEL spids:[154])
          op: Equal
          rhs: 
            {
              (word_part.CommandSubPart
                command_list: 
                  (command.CommandList
                    children: [(C {(sed)} {(-n)} {(1p)} {(/DietPi/dietpi/.hw_model)})]
                  )
                left_token: <Left_CommandSub '$('>
                spids: [155 163]
              )
            }
          spids: [154]
        )
      ]
      spids: [154]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:UNIQUE_ID spids:[166])
          op: Equal
          rhs: 
            {
              (word_part.CommandSubPart
                command_list: 
                  (command.CommandList
                    children: [(C {(sed)} {(-n)} {(5p)} {(/DietPi/dietpi/.hw_model)})]
                  )
                left_token: <Left_CommandSub '$('>
                spids: [167 175]
              )
            }
          spids: [166]
        )
      ]
      spids: [166]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:FTP_ADDR spids:[179])
          op: Equal
          rhs: {(DQ (dietpi.com))}
          spids: [179]
        )
      ]
      spids: [179]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:FTP_USER spids:[185])
          op: Equal
          rhs: {(DQ (dietpi-survey))}
          spids: [185]
        )
      ]
      spids: [185]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:FTP_PASS spids:[191])
          op: Equal
          rhs: {(DQ (raspberry13))}
          spids: [191]
        )
      ]
      spids: [191]
    )
    (command.FuncDef
      name: Update_FileName_Format
      body: 
        (command.BraceGroup
          children: [
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:FILENAME_FORMAT spids:[204])
                  op: Equal
                  rhs: 
                    {
                      (DQ ($ VSub_DollarName '$SURVEY_VERSION') (-) ($ VSub_DollarName '$UNIQUE_ID') (-) 
                        ($ VSub_DollarName '$DIETPI_VERSION') (-) ($ VSub_DollarName '$G_HW_MODEL') (.txt)
                      )
                    }
                  spids: [204]
                )
              ]
              spids: [204]
            )
          ]
          spids: [201]
        )
      spids: [198 201]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:FP_SETTINGS spids:[221])
          op: Equal
          rhs: {(DQ (/DietPi/dietpi/.dietpi-survey))}
          spids: [221]
        )
      ]
      spids: [221]
    )
    (command.FuncDef
      name: Write_Settings
      body: 
        (command.BraceGroup
          children: [
            (command.SimpleCommand
              words: [{(cat)}]
              redirects: [
                (redir.HereDoc
                  op: <Redir_DLess '<<'>
                  fd: 16777215
                  here_begin: {(_EOF_)}
                  here_end_span_id: 251
                  stdin_parts: [
                    ($ VSub_DollarName '$OPTED_IN')
                    ('\n')
                    ($ VSub_DollarName '$SURVEY_SENTCOUNT')
                    ('\n')
                  ]
                )
                (redir.Redir
                  op: <Redir_Great '>'>
                  fd: 16777215
                  arg_word: {(DQ ($ VSub_DollarName '$FP_SETTINGS'))}
                )
              ]
            )
          ]
          spids: [230]
        )
      spids: [227 230]
    )
    (command.FuncDef
      name: Read_Settings
      body: 
        (command.BraceGroup
          children: [
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:OPTED_IN spids:[264])
                  op: Equal
                  rhs: 
                    {
                      (word_part.CommandSubPart
                        command_list: 
                          (command.CommandList
                            children: [
                              (C {(sed)} {(-n)} {(1p)} {(DQ ($ VSub_DollarName '$FP_SETTINGS'))})
                            ]
                          )
                        left_token: <Left_CommandSub '$('>
                        spids: [265 275]
                      )
                    }
                  spids: [264]
                )
              ]
              spids: [264]
            )
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:SURVEY_SENTCOUNT spids:[278])
                  op: Equal
                  rhs: 
                    {
                      (word_part.CommandSubPart
                        command_list: 
                          (command.CommandList
                            children: [
                              (C {(sed)} {(-n)} {(2p)} {(DQ ($ VSub_DollarName '$FP_SETTINGS'))})
                            ]
                          )
                        left_token: <Left_CommandSub '$('>
                        spids: [279 289]
                      )
                    }
                  spids: [278]
                )
              ]
              spids: [278]
            )
          ]
          spids: [260]
        )
      spids: [257 260]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (C {(Lit_Other '[')} {(-f)} {(DQ ($ VSub_DollarName '$FP_SETTINGS'))} {(Lit_Other ']')})
              terminator: <Op_Semi ';'>
            )
          ]
          action: [(C {(Read_Settings)})]
          spids: [16777215 326]
        )
      ]
      else_action: [(C {(Write_Settings)})]
      spids: [338 346]
    )
    (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 '$OPTED_IN')})
                      right: (arith_expr.ArithWord w:{(Lit_Digits 1)})
                    )
                  spids: [360 369]
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (C {(G_CHECK_URL)} {(DQ ($ VSub_DollarName '$FTP_ADDR'))})
            (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: [389 398]
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(/DietPi/dietpi/func/obtain_network_details)})
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:active_network_adapter spids:[412])
                          op: Equal
                          rhs: 
                            {
                              (word_part.CommandSubPart
                                command_list: 
                                  (command.CommandList
                                    children: [(C {(sed)} {(-n)} {(3p)} {(/DietPi/dietpi/.network)})]
                                  )
                                left_token: <Left_CommandSub '$('>
                                spids: [413 421]
                              )
                            }
                          spids: [412]
                        )
                      ]
                      spids: [412]
                    )
                    (C {(Update_FileName_Format)})
                    (C {(cd)} {(/tmp)})
                    (command.SimpleCommand
                      words: [{(cat)}]
                      redirects: [
                        (redir.HereDoc
                          op: <Redir_DLess '<<'>
                          fd: 16777215
                          here_begin: {(_EOF_)}
                          here_end_span_id: 582
                          stdin_parts: [
                            ('-------------------------\n')
                            ('DietPi-Survey v')
                            ($ VSub_DollarName '$SURVEY_VERSION')
                            ('\n')
                            ('-------------------------\n')
                            ('\n')
                            ('Upload Count   : ')
                            ($ VSub_DollarName '$SURVEY_SENTCOUNT')
                            ('\n')
                            ('DietPi Version : ')
                            ($ VSub_DollarName '$DIETPI_VERSION')
                            ('\n')
                            ('Mac Address    : ')
                            (word_part.CommandSubPart
                              command_list: 
                                (command.CommandList
                                  children: [
                                    (command.Pipeline
                                      children: [
                                        (C {(ifconfig)} {(-a)})
                                        (C {(grep)} {(-m1)} 
                                          {(DQ ($ VSub_DollarName '$active_network_adapter'))}
                                        )
                                        (C {(awk)} {(SQ <'{print $NF}'>)})
                                        (C {(sed)} {(SQ <'s/://g'>)})
                                      ]
                                      negated: F
                                    )
                                  ]
                                )
                              left_token: <Left_CommandSub '$('>
                              spids: [472 503]
                            )
                            ('\n')
                            ('Hardware Index : ')
                            ($ VSub_DollarName '$G_HW_MODEL')
                            ('\n')
                            ('Hardware Name  : ')
                            ($ VSub_DollarName '$G_HW_MODEL_DESCRIPTION')
                            ('\n')
                            ('Distro Index   : ')
                            ($ VSub_DollarName '$G_DISTRO')
                            ('\n')
                            ('Autoboot Index : ')
                            (word_part.CommandSubPart
                              command_list: 
                                (command.CommandList
                                  children: [(C {(cat)} {(/DietPi/dietpi/.dietpi-autostart_index)})]
                                )
                              left_token: <Left_CommandSub '$('>
                              spids: [515 519]
                            )
                            ('\n')
                            ('Country        : ')
                            (word_part.CommandSubPart
                              command_list: 
                                (command.CommandList
                                  children: [
                                    (command.Pipeline
                                      children: [
                                        (C {(curl)} {(--max-time)} {(4)} {(-s)} 
                                          {(http) (Lit_Other ':') (//whatismycountry.com/)}
                                        )
                                        (C {(sed)} {(-n)} {(SQ <'s|.*,\\(.*\\)</h3>|\\1|p'>)})
                                      ]
                                      negated: F
                                    )
                                  ]
                                )
                              left_token: <Left_CommandSub '$('>
                              spids: [522 544]
                            )
                            ('\n')
                            ('Hostname       : ')
                            (word_part.CommandSubPart
                              command_list: 
                                (command.CommandList
                                  children: [(C {(cat)} {(/etc/hostname)})]
                                )
                              left_token: <Left_CommandSub '$('>
                              spids: [547 551]
                            )
                            ('\n')
                            ('\n')
                            ('-------------------------\n')
                            ('DietPi-Software Installed\n')
                            ('-------------------------\n')
                            (word_part.CommandSubPart
                              command_list: 
                                (command.CommandList
                                  children: [
                                    (command.Pipeline
                                      children: [
                                        (C {(cat)} {(/DietPi/dietpi/.installed)})
                                        (C {(grep)} {(SQ <' =2 '>)})
                                      ]
                                      negated: F
                                    )
                                  ]
                                )
                              left_token: <Left_CommandSub '$('>
                              spids: [557 569]
                            )
                            ('\n')
                            ('\n')
                            ('-------------------------\n')
                            ('FileSystem\n')
                            ('-------------------------\n')
                            (word_part.CommandSubPart
                              command_list: (command.CommandList children:[(C {(df)} {(-h)})])
                              left_token: <Left_CommandSub '$('>
                              spids: [575 579]
                            )
                            ('\n')
                          ]
                        )
                        (redir.Redir
                          op: <Redir_Great '>'>
                          fd: 16777215
                          arg_word: {(DQ ($ VSub_DollarName '$FILENAME_FORMAT'))}
                        )
                      ]
                    )
                    (C {(wput)} {(--timeout) (Lit_Other '=') (10th-4)} {(--tries) (Lit_Other '=') (1)} 
                      {(--waitretry) (Lit_Other '=') (4)} {(-q)} {(-B)} {(-u)} {(DQ ($ VSub_DollarName '$FILENAME_FORMAT'))} 
                      {(ftp) (Lit_Other ':') (//) (DQ ($ VSub_DollarName '$FTP_USER')) (Lit_Other ':') 
                        (DQ ($ VSub_DollarName '$FTP_PASS')) (Lit_Other '@') (DQ ($ VSub_DollarName '$FTP_ADDR'))
                      }
                    )
                    (C {(rm)} {(DQ ($ VSub_DollarName '$FILENAME_FORMAT'))})
                    (command.DParen
                      child: 
                        (arith_expr.UnaryAssign
                          op_id: Node_PostDPlus
                          child: (lhs_expr.LhsName name:SURVEY_SENTCOUNT spids:[647])
                        )
                      spids: [646 650]
                    )
                    (C {(Write_Settings)})
                  ]
                  spids: [16777215 401]
                )
              ]
              spids: [16777215 657]
            )
          ]
          spids: [16777215 372]
        )
      ]
      spids: [16777215 660]
    )
    (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)})
  ]
  spids: [3]
)