(command.CommandList children: [ (C {<set>} {<-e>}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'DAEMON='> name:DAEMON) op: assign_op.Equal rhs: {<'/usr/bin/rsync'>} spids: [50] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'RSYNC_ENABLE='> name:RSYNC_ENABLE) op: assign_op.Equal rhs: {<false>} spids: [53] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'RSYNC_OPTS='> name:RSYNC_OPTS) op: assign_op.Equal rhs: {(SQ )} spids: [56] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left: <Id.Lit_VarLike 'RSYNC_DEFAULTS_FILE='> name: RSYNC_DEFAULTS_FILE ) op: assign_op.Equal rhs: {<'/etc/default/rsync'>} spids: [60] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'RSYNC_CONFIG_FILE='> name:RSYNC_CONFIG_FILE) op: assign_op.Equal rhs: {<'/etc/rsyncd.conf'>} spids: [63] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'RSYNC_PID_FILE='> name:RSYNC_PID_FILE) op: assign_op.Equal rhs: {<'/var/run/rsync.pid'>} spids: [66] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'RSYNC_NICE_PARM='> name:RSYNC_NICE_PARM) op: assign_op.Equal rhs: {(SQ )} spids: [69] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'RSYNC_IONICE_PARM='> name:RSYNC_IONICE_PARM) op: assign_op.Equal rhs: {(SQ )} spids: [73] ) ] redirects: [] ) (command.AndOr ops: [Id.Op_DPipe] children: [ (C {<test>} {<-x>} {($ Id.VSub_DollarName DAEMON)}) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<0>}) ] ) (C {<.>} {<'/lib/lsb/init-functions'>}) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<-s>} {($ Id.VSub_DollarName RSYNC_DEFAULTS_FILE)} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<.>} {($ Id.VSub_DollarName RSYNC_DEFAULTS_FILE)}) (command.Case to_match: {(DQ <x> ($ Id.VSub_DollarName RSYNC_ENABLE))} arms: [ (case_arm pat_list: [{<xtrue>} {<xfalse>}] action: [] spids: [125 128 130 -1] ) (case_arm pat_list: [{<xinetd>}] action: [(command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<0>})] spids: [133 134 141 -1] ) (case_arm pat_list: [{<Id.Lit_Star '*'>}] action: [ (C {<log_failure_msg>} { (DQ <'Value of RSYNC_ENABLE in '> ($ Id.VSub_DollarName RSYNC_DEFAULTS_FILE) <' must be either \'true\' or \'false\';'> ) } ) (C {<log_failure_msg>} {(DQ <'not starting rsync daemon.'>)}) (command.ControlFlow token: <Id.ControlFlow_Exit exit> arg_word: {<1>} ) ] spids: [144 145 168 -1] ) ] redirects: [] ) (command.Case to_match: {(DQ <x> ($ Id.VSub_DollarName RSYNC_NICE))} arms: [ (case_arm pat_list: [ {<Id.Lit_ArrayLhsOpen 'x['> <0-9> <Id.Lit_RBracket ']'>} {<Id.Lit_ArrayLhsOpen 'x1['> <0-9> <Id.Lit_RBracket ']'>} ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left: <Id.Lit_VarLike 'RSYNC_NICE_PARM='> name: RSYNC_NICE_PARM ) op: assign_op.Equal rhs: {(DQ <'--nicelevel '> ($ Id.VSub_DollarName RSYNC_NICE))} spids: [193] ) ] redirects: [] ) ] spids: [184 191 198 -1] ) (case_arm pat_list:[{<x>}] action:[] spids:[201 202 204 -1]) (case_arm pat_list: [{<Id.Lit_Star '*'>}] action: [ (C {<log_warning_msg>} { (DQ <'Value of RSYNC_NICE in '> ($ Id.VSub_DollarName RSYNC_DEFAULTS_FILE) <' must be a value between 0 and 19 (inclusive);'> ) } ) (C {<log_warning_msg>} {(DQ <'ignoring RSYNC_NICE now.'>)}) ] spids: [207 208 226 -1] ) ] redirects: [] ) (command.Case to_match: {(DQ <x> ($ Id.VSub_DollarName RSYNC_IONICE))} arms: [ (case_arm pat_list: [ {<x-c> <Id.Lit_LBracket '['> <123> <Id.Lit_RBracket ']'> <Id.Lit_Star '*'>} ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left: <Id.Lit_VarLike 'RSYNC_IONICE_PARM='> name: RSYNC_IONICE_PARM ) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_DollarName RSYNC_IONICE))} spids: [249] ) ] redirects: [] ) ] spids: [242 247 253 -1] ) (case_arm pat_list:[{<x>}] action:[] spids:[256 257 259 -1]) (case_arm pat_list: [{<Id.Lit_Star '*'>}] action: [ (C {<log_warning_msg>} { (DQ <'Value of RSYNC_IONICE in '> ($ Id.VSub_DollarName RSYNC_DEFAULTS_FILE) <' must be -c1, -c2 or -c3;'> ) } ) (C {<log_warning_msg>} {(DQ <'ignoring RSYNC_IONICE now.'>)}) ] spids: [262 263 281 -1] ) ] redirects: [] ) ] spids: [96 107] ) ] else_action: [] redirects: [] ) (C {<export>} {<Id.Lit_VarLike 'PATH='> (DQ (braced_var_sub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name PATH> var_name: PATH suffix_op: (suffix_op.Unary op: <Id.VTest_ColonPlus _> arg_word: {($ Id.VSub_DollarName PATH) <':'>} ) right: <Id.Right_DollarBrace '}'> ) <'/usr/sbin:/sbin'> ) } ) (command.ShFunction name: rsync_start body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {<-s>} {(DQ ($ Id.VSub_DollarName RSYNC_CONFIG_FILE))} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<log_failure_msg>} { (DQ <'missing or empty config file '> ($ Id.VSub_DollarName RSYNC_CONFIG_FILE)) } ) (C {<log_end_msg>} {<1>}) (command.ControlFlow token: <Id.ControlFlow_Exit exit> arg_word: {<0>} ) ] spids: [310 325] ) ] else_action: [] redirects: [] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.AndOr ops: [Id.Op_DAmp Id.Op_DAmp] children: [ (C {<Id.Lit_LBracket '['>} {<-n>} {(DQ ($ Id.VSub_DollarName RSYNC_IONICE_PARM))} {<Id.Lit_RBracket ']'>} ) (C {<Id.Lit_LBracket '['>} {<-x>} {<'/usr/bin/ionice'>} {<Id.Lit_RBracket ']'>} ) (command.Simple words: [ {<'/usr/bin/ionice'>} {(DQ ($ Id.VSub_DollarName RSYNC_IONICE_PARM))} {<true>} ] redirects: [ (redir op: <Id.Redir_Great '2>'> loc: (redir_loc.Fd fd:2) arg: {<'/dev/null'>} ) ] more_env: [] do_fork: T ) ] ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.Simple words: [ {<'/usr/bin/ionice'>} {(DQ ($ Id.VSub_DollarName RSYNC_IONICE_PARM))} {<-p> ($ Id.VSub_Dollar '$')} ] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {<'/dev/null'>} ) (redir op: <Id.Redir_GreatAnd '2>&'> loc: (redir_loc.Fd fd:2) arg: {<1>} ) ] more_env: [] do_fork: T ) ] spids: [353 390] ) ] else_action: [] redirects: [] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (C {<start-stop-daemon>} {<--start>} {<--quiet>} {<--background>} {<--pidfile>} {($ Id.VSub_DollarName RSYNC_PID_FILE)} {<--make-pidfile>} {($ Id.VSub_DollarName RSYNC_NICE_PARM)} {<--exec>} {($ Id.VSub_DollarName DAEMON)} {<-->} {<--no-detach>} {<--daemon>} {<--config>} {(DQ ($ Id.VSub_DollarName RSYNC_CONFIG_FILE))} {($ Id.VSub_DollarName RSYNC_OPTS)} ) ] ) action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'rc='> name:rc) op: assign_op.Equal rhs: {<0>} spids: [459] ) ] redirects: [] ) (C {<sleep>} {<1>}) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.Pipeline children: [ (command.Simple words: [ {<kill>} {<-0>} { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<cat>} {($ Id.VSub_DollarName RSYNC_PID_FILE)}) right: <Id.Eof_RParen _> ) } ] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {<'/dev/null'>} ) (redir op: <Id.Redir_GreatAnd '2>&'> loc: (redir_loc.Fd fd:2) arg: {<1>} ) ] more_env: [] do_fork: T ) ] negated: T stderr_indices: [] ) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<log_failure_msg>} {(DQ <'rsync daemon failed to start'>)}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'rc='> name:rc) op: assign_op.Equal rhs: {<1>} spids: [499] ) ] redirects: [] ) ] spids: [468 489] ) ] else_action: [] redirects: [] ) ] spids: [413 456] ) ] else_action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'rc='> name:rc) op: assign_op.Equal rhs: {<1>} spids: [509] ) ] redirects: [] ) ] redirects: [] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName rc)} {<-eq>} {<0>} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [(C {<log_end_msg>} {<0>})] spids: [516 529] ) ] else_action: [ (C {<log_end_msg>} {<1>}) (C {<rm>} {<-f>} {($ Id.VSub_DollarName RSYNC_PID_FILE)}) ] redirects: [] ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.Case to_match: {(DQ ($ Id.VSub_Number 1))} arms: [ (case_arm pat_list: [{<start>}] action: [ (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {(DQ ($ Id.VSub_DollarName RSYNC_ENABLE))}) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<log_daemon_msg>} {(DQ <'Starting rsync daemon'>)} {(DQ <rsync>)}) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<Id.Lit_LBracket '['>} {<-s>} {($ Id.VSub_DollarName RSYNC_PID_FILE)} {<Id.Lit_RBracket ']'>} ) (command.Simple words: [ {<kill>} {<-0>} { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<cat>} {($ Id.VSub_DollarName RSYNC_PID_FILE)}) right: <Id.Eof_RParen _> ) } ] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {<'/dev/null'>} ) (redir op: <Id.Redir_GreatAnd '2>&'> loc: (redir_loc.Fd fd:2) arg: {<1>} ) ] more_env: [] do_fork: T ) ] ) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<log_progress_msg>} {(DQ <'apparently already running'>)}) (C {<log_end_msg>} {<0>}) (command.ControlFlow token: <Id.ControlFlow_Exit exit> arg_word: {<0>} ) ] spids: [595 624] ) ] else_action: [] redirects: [] ) (C {<rsync_start>}) ] spids: [574 581] ) ] else_action: [ (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<-s>} {(DQ ($ Id.VSub_DollarName RSYNC_CONFIG_FILE))} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName VERBOSE))} {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {<no>} {<Id.Lit_RBracket ']'>} ) (C {<log_warning_msg>} { (DQ <'rsync daemon not enabled in '> ($ Id.VSub_DollarName RSYNC_DEFAULTS_FILE) <', not starting...'> ) } ) ] ) ] spids: [653 666] ) ] else_action: [] redirects: [] ) ] redirects: [] ) ] spids: [570 571 699 -1] ) (case_arm pat_list: [{<stop>}] action: [ (C {<log_daemon_msg>} {(DQ <'Stopping rsync daemon'>)} {(DQ <rsync>)}) (C {<start-stop-daemon>} {<--stop>} {<--quiet>} {<--oknodo>} {<--pidfile>} {($ Id.VSub_DollarName RSYNC_PID_FILE)} ) (C {<log_end_msg>} {($ Id.VSub_QMark '?')}) (C {<rm>} {<-f>} {($ Id.VSub_DollarName RSYNC_PID_FILE)}) ] spids: [702 703 742 -1] ) (case_arm pat_list: [{<reload>} {<force-reload>}] action: [ (C {<log_warning_msg>} {(DQ <'Reloading rsync daemon: not needed, as the daemon'>)}) (C {<log_warning_msg>} {(DQ <'re-reads the config file whenever a client connects.'>)}) ] spids: [746 749 766 -1] ) (case_arm pat_list: [{<restart>}] action: [ (C {<set>} {<Id.Lit_Other '+'> <e>}) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {($ Id.VSub_DollarName RSYNC_ENABLE)}) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<log_daemon_msg>} {(DQ <'Restarting rsync daemon'>)} {(DQ <rsync>)}) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<Id.Lit_LBracket '['>} {<-s>} {($ Id.VSub_DollarName RSYNC_PID_FILE)} {<Id.Lit_RBracket ']'>} ) (command.Simple words: [ {<kill>} {<-0>} { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<cat>} {($ Id.VSub_DollarName RSYNC_PID_FILE)}) right: <Id.Eof_RParen _> ) } ] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {<'/dev/null'>} ) (redir op: <Id.Redir_GreatAnd '2>&'> loc: (redir_loc.Fd fd:2) arg: {<1>} ) ] more_env: [] do_fork: T ) ] ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.AndOr ops: [Id.Op_DPipe] children: [ (C {<start-stop-daemon>} {<--stop>} {<--quiet>} {<--oknodo>} {<--pidfile>} {($ Id.VSub_DollarName RSYNC_PID_FILE)} ) (C {<true>}) ] ) (C {<sleep>} {<1>}) ] spids: [799 828] ) ] else_action: [ (C {<log_warning_msg>} {(DQ <'rsync daemon not running, attempting to start.'>)}) (C {<rm>} {<-f>} {($ Id.VSub_DollarName RSYNC_PID_FILE)}) ] redirects: [] ) (C {<rsync_start>}) ] spids: [780 785] ) ] else_action: [ (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<-s>} {(DQ ($ Id.VSub_DollarName RSYNC_CONFIG_FILE))} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName VERBOSE))} {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {<no>} {<Id.Lit_RBracket ']'>} ) (C {<log_warning_msg>} { (DQ <'rsync daemon not enabled in '> ($ Id.VSub_DollarName RSYNC_DEFAULTS_FILE) <', not starting...'> ) } ) ] ) ] spids: [879 892] ) ] else_action: [] redirects: [] ) ] redirects: [] ) ] spids: [770 771 925 -1] ) (case_arm pat_list: [{<status>}] action: [ (C {<status_of_proc>} {<-p>} {($ Id.VSub_DollarName RSYNC_PID_FILE)} {(DQ ($ Id.VSub_DollarName DAEMON))} {<rsync>} ) (command.ControlFlow token: <Id.ControlFlow_Exit exit> arg_word: {($ Id.VSub_QMark '?')} ) ] spids: [929 930 954 -1] ) (case_arm pat_list: [{<Id.Lit_Star '*'>}] action: [ (C {<echo>} {(DQ <'Usage: /etc/init.d/rsync {start|stop|reload|force-reload|restart|status}'>)} ) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>}) ] spids: [957 958 -1 972] ) ] redirects: [] ) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<0>}) ] )