(BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'INPUT='> name:INPUT) op: assign_op.Equal rhs: {<-1>} spids: [67] ) ] redirects: [] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_EqualTilde left: {($ Id.VSub_Number 1)} right: {<Id.Lit_Other '^'> <-> <Id.Lit_Other '?'> <Id.Lit_Other '['> <0-9> <Id.Lit_Other ']'> <Id.Lit_Other '+'> <Id.Lit_Other '$'> } ) redirects: [] ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'INPUT='> name:INPUT) op: assign_op.Equal rhs: {($ Id.VSub_Number 1)} spids: [95] ) ] redirects: [] ) ] spids: [71 91] ) ] else_action: [] redirects: [] ) (C {<.>} {<'/DietPi/dietpi/func/dietpi-globals'>}) (C {<G_CHECK_ROOT_USER>}) (C {<export>} {<Id.Lit_VarLike 'G_PROGRAM_NAME='> (SQ <DietPi-Logclear>)}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'TEMP_FILE='> name:TEMP_FILE) op: assign_op.Equal rhs: {(DQ <'/tmp/dietpi-logclear'>)} spids: [141] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'FILEPATH_LOGFOLDER='> name:FILEPATH_LOGFOLDER) op: assign_op.Equal rhs: {(DQ <'/var/log'>)} spids: [148] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left: <Id.Lit_VarLike 'FILEPATH_BACKUPFOLDER='> name: FILEPATH_BACKUPFOLDER ) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_DollarName HOME) <'/logfile_storage'>)} spids: [154] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'FILE_NAME='> name:FILE_NAME) op: assign_op.Equal rhs: {(DQ )} spids: [162] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'FILE_TYPE='> name:FILE_TYPE) op: assign_op.Equal rhs: {<0>} spids: [171] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'FILESIZE_BYTES='> name:FILESIZE_BYTES) op: assign_op.Equal rhs: {<0>} spids: [175] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'PROCESS_FILE='> name:PROCESS_FILE) op: assign_op.Equal rhs: {<0>} spids: [179] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left: <Id.Lit_VarLike 'FP_EXCLUDED_LOGFILES='> name: FP_EXCLUDED_LOGFILES ) op: assign_op.Equal rhs: {(DQ <'/DietPi/dietpi/.dietpi-logclear_exclude'>)} spids: [196] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left: <Id.Lit_VarLike 'INFO_EXCLUDED_LOGFILES='> name: INFO_EXCLUDED_LOGFILES ) op: assign_op.Equal rhs: {<0>} spids: [202] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'INFO_SIZE_CLEARED='> name:INFO_SIZE_CLEARED) op: assign_op.Equal rhs: {<0>} spids: [219] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left: <Id.Lit_VarLike 'INFO_FILES_PROCESSED='> name: INFO_FILES_PROCESSED ) op: assign_op.Equal rhs: {<0>} spids: [223] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'INFO_LOGS_DELETED='> name:INFO_LOGS_DELETED) op: assign_op.Equal rhs: {<0>} spids: [227] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'INFO_LOGS_CLEARED='> name:INFO_LOGS_CLEARED) op: assign_op.Equal rhs: {<0>} spids: [231] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left: <Id.Lit_VarLike 'INFO_LOGS_NOTSUPPORTED='> name: INFO_LOGS_NOTSUPPORTED ) op: assign_op.Equal rhs: {<0>} spids: [235] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'INFO_BACKUPS_MADE='> name:INFO_BACKUPS_MADE) op: assign_op.Equal rhs: {<0>} spids: [239] ) ] redirects: [] ) (command.ShFunction name: Process_Logfiles body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple words: [{<find>} {(DQ ($ Id.VSub_DollarName FILEPATH_LOGFOLDER))} {<-type>} {<f>}] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {(DQ ($ Id.VSub_DollarName TEMP_FILE))} ) ] more_env: [] do_fork: T ) (command.Simple words: [{<readarray>} {<-t>} {<ARRAY_LOG_FILEPATH>}] redirects: [ (redir op: <Id.Redir_Less '<'> loc: (redir_loc.Fd fd:0) arg: {(DQ ($ Id.VSub_DollarName TEMP_FILE))} ) ] more_env: [] do_fork: T ) (command.ForExpr init: (arith_expr.BinaryAssign op_id: Id.Arith_Equal left: ($ Id.Lit_ArithVarLike i) right: {<Id.Lit_Digits 0>} ) cond: (arith_expr.Binary op_id: Id.Arith_Less left: ($ Id.Lit_ArithVarLike i) right: { (braced_var_sub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name ARRAY_LOG_FILEPATH> var_name: ARRAY_LOG_FILEPATH prefix_op: <Id.VSub_Pound '#'> bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) right: <Id.Right_DollarBrace '}'> ) } ) update: (arith_expr.UnaryAssign op_id:Id.Node_PostDPlus child:($ Id.Lit_ArithVarLike i)) body: (command.DoGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'FILE_NAME='> name:FILE_NAME) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.Pipeline children: [ (C {<echo>} {<-e>} { (braced_var_sub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name ARRAY_LOG_FILEPATH> var_name: ARRAY_LOG_FILEPATH bracket_op: (bracket_op.ArrayIndex expr: {($ Id.VSub_DollarName i)} ) right: <Id.Right_DollarBrace '}'> ) } ) (C {<sed>} {(SQ <'s/\\/var\\/log\\///g'>)}) ] negated: F stderr_indices: [] ) right: <Id.Eof_RParen _> ) } spids: [348] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left: <Id.Lit_VarLike 'FILESIZE_BYTES='> name: FILESIZE_BYTES ) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<stat>} {<-c> <Id.Lit_Other '%'> <s>} { (DQ (braced_var_sub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name ARRAY_LOG_FILEPATH> var_name: ARRAY_LOG_FILEPATH bracket_op: (bracket_op.ArrayIndex expr: {($ Id.VSub_DollarName i)} ) right: <Id.Right_DollarBrace '}'> ) ) } ) right: <Id.Eof_RParen _> ) } spids: [371] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left: <Id.Lit_VarLike 'PROCESS_FILE='> name: PROCESS_FILE ) op: assign_op.Equal rhs: {<1>} spids: [390] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'FILE_TYPE='> name:FILE_TYPE) op: assign_op.Equal rhs: {<0>} spids: [394] ) ] redirects: [] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} { (DQ (braced_var_sub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name ARRAY_LOG_FILEPATH> var_name: ARRAY_LOG_FILEPATH bracket_op: (bracket_op.ArrayIndex expr: {($ Id.VSub_DollarName i)} ) right: <Id.Right_DollarBrace '}'> ) ) } {<Id.Lit_Equals '='>} {(DQ <'/var/log/pihole.log'>)} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left: <Id.Lit_VarLike 'FILE_TYPE='> name: FILE_TYPE ) op: assign_op.Equal rhs: {<2>} spids: [433] ) ] redirects: [] ) ] spids: [407 429] ) (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.AndOr ops: [Id.Op_DPipe] children: [ (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: { (braced_var_sub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name FILE_NAME> var_name: FILE_NAME suffix_op: (suffix_op.Slice begin: (arith_expr.Unary op_id: Id.Node_UnaryMinus child: {<Id.Lit_Digits 4>} ) ) right: <Id.Arith_RBrace _> ) } right: {(DQ <.zip>)} ) redirects: [] ) (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: { (braced_var_sub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name FILE_NAME> var_name: FILE_NAME suffix_op: (suffix_op.Slice begin: (arith_expr.Unary op_id: Id.Node_UnaryMinus child: {<Id.Lit_Digits 3>} ) ) right: <Id.Arith_RBrace _> ) } right: {(DQ <.gz>)} ) redirects: [] ) ] ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left: <Id.Lit_VarLike 'FILE_TYPE='> name: FILE_TYPE ) op: assign_op.Equal rhs: {<1>} spids: [488] ) ] redirects: [] ) ] spids: [442 484] ) (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_LessEqual left: {($ Id.VSub_DollarName FILESIZE_BYTES)} right: {<Id.Lit_Digits 10>} ) redirects: [] ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left: <Id.Lit_VarLike 'PROCESS_FILE='> name: PROCESS_FILE ) op: assign_op.Equal rhs: {<0>} spids: [515] ) ] redirects: [] ) ] spids: [497 511] ) ] else_action: [] redirects: [] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_DEqual left: {($ Id.VSub_DollarName PROCESS_FILE)} right: {<Id.Lit_Digits 1>} ) redirects: [] ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_DEqual left: {($ Id.VSub_DollarName FILE_TYPE)} right: {<Id.Lit_Digits 2>} ) redirects: [] ) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<local>} {<Id.Lit_VarLike 'pihole_restart_required='> <0>}) (C {<local>} {<Id.Lit_VarLike 'month_day_today='> (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.Simple words: [{<date>} {<Id.Lit_Other '+'> (SQ <'%b %e'>)}] redirects: [] more_env: [ (env_pair name: LC_ALL val: {<en_GB.UTF-8>} spids: [591] ) ] do_fork: T ) right: <Id.Eof_RParen _> ) } ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_DEqual left: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<grep>} {<-v>} {<-ci>} {<-m1>} { (DQ ($ Id.VSub_DollarName month_day_today ) ) } {<'/var/log/pihole.log'>} ) right: <Id.Eof_RParen _> ) } right: {<Id.Lit_Digits 1>} ) redirects: [] ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_DEqual left: {($ Id.VSub_DollarName INPUT)} right: {<Id.Lit_Digits 0>} ) redirects: [] ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.Pipeline children: [ (C {<cat>} { (DQ (braced_var_sub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name ARRAY_LOG_FILEPATH> var_name: ARRAY_LOG_FILEPATH bracket_op: (bracket_op.ArrayIndex expr: {($ Id.VSub_DollarName i)} ) right: <Id.Right_DollarBrace '}'> ) ) } ) (command.Simple words: [ {<sed>} {(SQ <'/'>) (DQ ($ Id.VSub_DollarName month_day_today) ) (SQ <'/d'>) } ] redirects: [ (redir op: <Id.Redir_DGreat '>>'> loc: (redir_loc.Fd fd:1) arg: { (DQ ($ Id.VSub_DollarName FILEPATH_BACKUPFOLDER ) ) <'/'> (DQ ($ Id.VSub_DollarName FILE_NAME)) } ) ] more_env: [] do_fork: T ) ] negated: F stderr_indices: [] ) (command.DParen child: (arith_expr.UnaryAssign op_id: Id.Node_PostDPlus child: ($ Id.Lit_ArithVarLike INFO_BACKUPS_MADE) ) redirects: [] ) ] spids: [644 658] ) ] else_action: [] redirects: [] ) (C {<G_DIETPI-NOTIFY>} {<2>} { (SQ < 'Clearing log entries for PiHole, that are not from today, please wait...' > ) } ) (C {<sed>} {<-i>} {(SQ <'/'>) (DQ ($ Id.VSub_DollarName month_day_today)) (SQ <'/!d'>) } {<'/var/log/pihole.log'>} ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left: <Id.Lit_VarLike 'pihole_restart_required='> name: pihole_restart_required ) op: assign_op.Equal rhs: {<1>} spids: [736] ) ] redirects: [] ) ] spids: [608 636] ) ] else_action: [] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left: <Id.Lit_VarLike 'FILESIZE_BYTES='> name: FILESIZE_BYTES ) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<stat>} {<-c> <Id.Lit_Other '%'> <s>} { (DQ (braced_var_sub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name ARRAY_LOG_FILEPATH> var_name: ARRAY_LOG_FILEPATH bracket_op: (bracket_op.ArrayIndex expr: {($ Id.VSub_DollarName i)} ) right: <Id.Right_DollarBrace '}'> ) ) } ) right: <Id.Eof_RParen _> ) } spids: [749] ) ] redirects: [] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_GreatEqual left: {($ Id.VSub_DollarName FILESIZE_BYTES)} right: {<Id.Lit_Digits 5242880>} ) redirects: [] ) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<G_DIETPI-NOTIFY>} {<2>} { (DQ (braced_var_sub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name ARRAY_LOG_FILEPATH> var_name: ARRAY_LOG_FILEPATH bracket_op: (bracket_op.ArrayIndex expr: {($ Id.VSub_DollarName i)} ) right: <Id.Right_DollarBrace '}'> ) <' has exceeded 5MB, clearing, please wait...'> ) } ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_DEqual left: {($ Id.VSub_DollarName INPUT)} right: {<Id.Lit_Digits 0>} ) redirects: [] ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.Simple words: [ {<cat>} { (DQ (braced_var_sub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name ARRAY_LOG_FILEPATH> var_name: ARRAY_LOG_FILEPATH bracket_op: (bracket_op.ArrayIndex expr: {($ Id.VSub_DollarName i)} ) right: <Id.Right_DollarBrace '}'> ) ) } ] redirects: [ (redir op: <Id.Redir_DGreat '>>'> loc: (redir_loc.Fd fd:1) arg: { (DQ ($ Id.VSub_DollarName FILEPATH_BACKUPFOLDER ) ) <'/'> (DQ ($ Id.VSub_DollarName FILE_NAME)) } ) ] more_env: [] do_fork: T ) (command.DParen child: (arith_expr.UnaryAssign op_id: Id.Node_PostDPlus child: ($ Id.Lit_ArithVarLike INFO_BACKUPS_MADE) ) redirects: [] ) ] spids: [815 829] ) ] else_action: [] redirects: [] ) (command.Simple words: [{<echo>} {<-e>} {(DQ )}] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: { (DQ (braced_var_sub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name ARRAY_LOG_FILEPATH> var_name: ARRAY_LOG_FILEPATH bracket_op: (bracket_op.ArrayIndex expr: {($ Id.VSub_DollarName i)} ) right: <Id.Right_DollarBrace '}'> ) ) } ) ] more_env: [] do_fork: T ) (command.DParen child: (arith_expr.UnaryAssign op_id: Id.Node_PostDPlus child: ($ Id.Lit_ArithVarLike INFO_LOGS_CLEARED) ) redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left: <Id.Lit_VarLike 'pihole_restart_required='> name: pihole_restart_required ) op: assign_op.Equal rhs: {<1>} spids: [894] ) ] redirects: [] ) ] spids: [777 791] ) ] else_action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left: <Id.Lit_VarLike 'FILESIZE_BYTES='> name: FILESIZE_BYTES ) op: assign_op.Equal rhs: {<0>} spids: [907] ) ] redirects: [] ) ] redirects: [] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.DParen child: { ($ Id.VSub_DollarName pihole_restart_required ) } redirects: [] ) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<G_DIETPI-NOTIFY>} {<2>} { (SQ < 'PiHole logs have been changed, restarting, please wait...' > ) } ) (C {<systemctl>} {<stop>} {<pihole-FTL>}) (C {<systemctl>} {<stop>} {<dnsmasq>}) (C {<sleep>} {<1>}) (C {<systemctl>} {<start>} {<dnsmasq>}) (C {<systemctl>} {<start>} {<pihole-FTL>}) (C {<'/DietPi/dietpi/dietpi-process_tool'>} {<1>}) ] spids: [920 930] ) ] else_action: [] redirects: [] ) ] spids: [550 564] ) (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_DEqual left: {($ Id.VSub_DollarName FILE_TYPE)} right: {<Id.Lit_Digits 1>} ) redirects: [] ) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<rm>} { (DQ (braced_var_sub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name ARRAY_LOG_FILEPATH> var_name: ARRAY_LOG_FILEPATH bracket_op: (bracket_op.ArrayIndex expr: {($ Id.VSub_DollarName i)} ) right: <Id.Right_DollarBrace '}'> ) ) } ) (command.DParen child: (arith_expr.UnaryAssign op_id: Id.Node_PostDPlus child: ($ Id.Lit_ArithVarLike INFO_LOGS_DELETED) ) redirects: [] ) (command.DParen child: (arith_expr.UnaryAssign op_id: Id.Node_PostDPlus child: ($ Id.Lit_ArithVarLike INFO_LOGS_NOTSUPPORTED) ) redirects: [] ) ] spids: [995 1009] ) (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_DEqual left: {($ Id.VSub_DollarName INPUT)} right: {<Id.Lit_Digits 0>} ) redirects: [] ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {<-f>} { (DQ ($ Id.VSub_DollarName FILEPATH_BACKUPFOLDER) <'/'> ($ Id.VSub_DollarName FILE_NAME) ) } {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<mkdir>} {<-p>} { (DQ ($ Id.VSub_DollarName FILEPATH_BACKUPFOLDER) <'/'> ($ Id.VSub_DollarName FILE_NAME) ) } ) (C {<rm>} {<-R>} { (DQ ($ Id.VSub_DollarName FILEPATH_BACKUPFOLDER) <'/'> ($ Id.VSub_DollarName FILE_NAME) ) } ) ] spids: [1066 1083] ) ] else_action: [] redirects: [] ) (command.Simple words: [ {<cat>} { (DQ (braced_var_sub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name ARRAY_LOG_FILEPATH> var_name: ARRAY_LOG_FILEPATH bracket_op: (bracket_op.ArrayIndex expr: {($ Id.VSub_DollarName i)} ) right: <Id.Right_DollarBrace '}'> ) ) } ] redirects: [ (redir op: <Id.Redir_DGreat '>>'> loc: (redir_loc.Fd fd:1) arg: {(DQ ($ Id.VSub_DollarName FILEPATH_BACKUPFOLDER)) <'/'> (DQ ($ Id.VSub_DollarName FILE_NAME)) } ) ] more_env: [] do_fork: T ) (command.DParen child: (arith_expr.UnaryAssign op_id: Id.Node_PostDPlus child: ($ Id.Lit_ArithVarLike INFO_BACKUPS_MADE) ) redirects: [] ) (command.Simple words: [{<echo>} {<-e>} {(DQ )}] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: { (DQ (braced_var_sub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name ARRAY_LOG_FILEPATH> var_name: ARRAY_LOG_FILEPATH bracket_op: (bracket_op.ArrayIndex expr: {($ Id.VSub_DollarName i)} ) right: <Id.Right_DollarBrace '}'> ) ) } ) ] more_env: [] do_fork: T ) (command.DParen child: (arith_expr.UnaryAssign op_id: Id.Node_PostDPlus child: ($ Id.Lit_ArithVarLike INFO_LOGS_CLEARED) ) redirects: [] ) ] spids: [1044 1058] ) (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_DEqual left: {($ Id.VSub_DollarName INPUT)} right: {<Id.Lit_Digits 1>} ) redirects: [] ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.Simple words: [{<echo>} {<-e>} {(DQ )}] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: { (DQ (braced_var_sub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name ARRAY_LOG_FILEPATH> var_name: ARRAY_LOG_FILEPATH bracket_op: (bracket_op.ArrayIndex expr: {($ Id.VSub_DollarName i)} ) right: <Id.Right_DollarBrace '}'> ) ) } ) ] more_env: [] do_fork: T ) (command.DParen child: (arith_expr.UnaryAssign op_id: Id.Node_PostDPlus child: ($ Id.Lit_ArithVarLike INFO_LOGS_CLEARED) ) redirects: [] ) ] spids: [1191 1205] ) (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_DEqual left: {($ Id.VSub_DollarName INPUT)} right: {<Id.Lit_Digits 2>} ) redirects: [] ) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<rm>} { (DQ (braced_var_sub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name ARRAY_LOG_FILEPATH> var_name: ARRAY_LOG_FILEPATH bracket_op: (bracket_op.ArrayIndex expr: {($ Id.VSub_DollarName i)} ) right: <Id.Right_DollarBrace '}'> ) ) } ) (command.DParen child: (arith_expr.UnaryAssign op_id: Id.Node_PostDPlus child: ($ Id.Lit_ArithVarLike INFO_LOGS_DELETED) ) redirects: [] ) ] spids: [1240 1254] ) ] else_action: [] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left: <Id.Lit_VarLike 'INFO_SIZE_CLEARED='> name: INFO_SIZE_CLEARED ) op: assign_op.Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Plus left: {($ Id.VSub_DollarName INFO_SIZE_CLEARED)} right: {($ Id.VSub_DollarName FILESIZE_BYTES)} ) ) } spids: [1286] ) ] redirects: [] ) ] spids: [528 542] ) ] else_action: [] redirects: [] ) (command.DParen child: (arith_expr.UnaryAssign op_id: Id.Node_PostDPlus child: ($ Id.Lit_ArithVarLike INFO_FILES_PROCESSED) ) redirects: [] ) ] ) redirects: [] ) (command.Simple words: [{<rm>} {(DQ ($ Id.VSub_DollarName TEMP_FILE))}] redirects: [ (redir op: <Id.Redir_AndGreat '&>'> loc: (redir_loc.Fd fd:1) arg: {<'/dev/null'>} ) ] more_env: [] do_fork: T ) (C {<unset>} {<ARRAY_LOG_FILEPATH>}) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (C {<G_DIETPI-NOTIFY>} {<3>} {<DietPi-Logclear>} {(DQ <Welcome>)}) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_DEqual left: {($ Id.VSub_DollarName INPUT)} right: (arith_expr.Unary op_id:Id.Node_UnaryMinus child:{<Id.Lit_Digits 1>}) ) redirects: [] ) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<G_DIETPI-NOTIFY>} {<2>} {(SQ <'Available commands:'>)}) (C {<echo>} {<-e>} {(DQ )}) (C {<echo>} {<-e>} { (DQ <Id.Lit_BadBackslash '\\'> <'e[1m dietpi-logclear 0'> <Id.Lit_BadBackslash '\\'> <'e[0m'> ) } ) (C {<echo>} {<-e>} { (DQ <Id.Lit_BadBackslash '\\'> <'e[38;5;244m Backup contents of all log files from '> ($ Id.VSub_DollarName FILEPATH_LOGFOLDER) <' to '> ($ Id.VSub_DollarName FILEPATH_BACKUPFOLDER) <'/*.'> <Id.Lit_BadBackslash '\\'> <'n Also clears the contents of all logs files in '> ($ Id.VSub_DollarName FILEPATH_LOGFOLDER) <.> <Id.Lit_BadBackslash '\\'> <'e[0m'> ) } ) (C {<echo>} {<-e>} {(DQ )}) (C {<echo>} {<-e>} { (DQ <Id.Lit_BadBackslash '\\'> <'e[1m dietpi-logclear 1'> <Id.Lit_BadBackslash '\\'> <'e[0m'> ) } ) (C {<echo>} {<-e>} { (DQ <Id.Lit_BadBackslash '\\'> <'e[38;5;244m Clear contents of all logs files in '> ($ Id.VSub_DollarName FILEPATH_LOGFOLDER) <.> <Id.Lit_BadBackslash '\\'> <'e[0m'> ) } ) (C {<echo>} {<-e>} {(DQ )}) (C {<echo>} {<-e>} { (DQ <Id.Lit_BadBackslash '\\'> <'e[1m dietpi-logclear 2'> <Id.Lit_BadBackslash '\\'> <'e[0m'> ) } ) (C {<echo>} {<-e>} { (DQ <Id.Lit_BadBackslash '\\'> <'e[38;5;244m Physically delete all files in '> ($ Id.VSub_DollarName FILEPATH_LOGFOLDER) <' and backups in '> ($ Id.VSub_DollarName FILEPATH_BACKUPFOLDER) <'/*.'> <Id.Lit_BadBackslash '\\'> <'n May prevent log files from being updated, restart services or reboot. '> <Id.Lit_BadBackslash '\\'> <'e[0m'> ) } ) (C {<echo>} {<-e>} {(DQ )}) ] spids: [1380 1395] ) (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_GreatEqual left: {($ Id.VSub_DollarName INPUT)} right: {<Id.Lit_Digits 0>} ) redirects: [] ) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<Process_Logfiles>}) (C {<chmod>} {<-R>} {<775>} {<'/var/log'>}) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_DEqual left: {($ Id.VSub_DollarName INPUT)} right: {<Id.Lit_Digits 2>} ) redirects: [] ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.Simple words: [{<rm>} {<-R>} {(DQ ($ Id.VSub_DollarName FILEPATH_BACKUPFOLDER))}] redirects: [ (redir op: <Id.Redir_AndGreat '&>'> loc: (redir_loc.Fd fd:1) arg: {<'/dev/null'>} ) ] more_env: [] do_fork: T ) ] spids: [1577 1591] ) ] else_action: [] redirects: [] ) (C {<G_DIETPI-NOTIFY>} {<2>}) (C {<echo>} {<-e>} { (DQ <' - Log file directory '> <Id.Lit_BadBackslash '\\'> <'e[90m|'> <Id.Lit_BadBackslash '\\'> <'e[0m '> ($ Id.VSub_DollarName FILEPATH_LOGFOLDER) ) } ) (C {<echo>} {<-e>} { (DQ <' - Processed files '> <Id.Lit_BadBackslash '\\'> <'e[90m|'> <Id.Lit_BadBackslash '\\'> <'e[0m '> ($ Id.VSub_DollarName INFO_FILES_PROCESSED) ) } ) (C {<echo>} {<-e>} { (DQ <' - Excluded files '> <Id.Lit_BadBackslash '\\'> <'e[90m|'> <Id.Lit_BadBackslash '\\'> <'e[0m '> ($ Id.VSub_DollarName INFO_EXCLUDED_LOGFILES) ) } ) (C {<echo>} {<-e>} { (DQ <' - Cleared log files '> <Id.Lit_BadBackslash '\\'> <'e[90m|'> <Id.Lit_BadBackslash '\\'> <'e[0m '> ($ Id.VSub_DollarName INFO_LOGS_CLEARED) ) } ) (C {<echo>} {<-e>} { (DQ <' - Unsupported files '> <Id.Lit_BadBackslash '\\'> <'e[90m|'> <Id.Lit_BadBackslash '\\'> <'e[0m '> ($ Id.VSub_DollarName INFO_LOGS_NOTSUPPORTED) ) } ) (C {<echo>} {<-e>} { (DQ <' - Deleted files '> <Id.Lit_BadBackslash '\\'> <'e[90m|'> <Id.Lit_BadBackslash '\\'> <'e[0m '> ($ Id.VSub_DollarName INFO_LOGS_DELETED) ) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left: <Id.Lit_VarLike 'INFO_SIZE_CLEARED='> name: INFO_SIZE_CLEARED ) op: assign_op.Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Slash left: {($ Id.VSub_DollarName INFO_SIZE_CLEARED)} right: {<Id.Lit_Digits 1024>} ) ) } spids: [1730] ) ] redirects: [] ) (C {<echo>} {<-e>} { (DQ <' - Space cleared '> <Id.Lit_BadBackslash '\\'> <'e[90m|'> <Id.Lit_BadBackslash '\\'> <'e[0m '> ($ Id.VSub_DollarName INFO_SIZE_CLEARED) <' KB'> ) } ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_DEqual left: {($ Id.VSub_DollarName INPUT)} right: {<Id.Lit_Digits 0>} ) redirects: [] ) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<echo>} {<-e>} {(DQ )}) (C {<echo>} {<-e>} { (DQ <' '> <Id.Lit_BadBackslash '\\'> <'e[38;5;244mBackup Info:'> <Id.Lit_BadBackslash '\\'> <'e[0m'> ) } ) (C {<echo>} {<-e>} { (DQ <' - Backup directory '> <Id.Lit_BadBackslash '\\'> <'e[90m|'> <Id.Lit_BadBackslash '\\'> <'e[0m '> ($ Id.VSub_DollarName FILEPATH_BACKUPFOLDER) ) } ) (C {<echo>} {<-e>} { (DQ <' - Updated log files '> <Id.Lit_BadBackslash '\\'> <'e[90m|'> <Id.Lit_BadBackslash '\\'> <'e[0m '> ($ Id.VSub_DollarName INFO_BACKUPS_MADE) ) } ) ] spids: [1761 1775] ) ] else_action: [] redirects: [] ) (C {<echo>} {<-e>} {(DQ )}) ] spids: [1537 1551] ) ] else_action: [] redirects: [] ) (command.ControlFlow token:<Id.ControlFlow_Exit exit>) ] redirects: [] right: <Id.Lit_RBrace '}'> )