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