(command.CommandList
  children: [
    (C {(set)} {(-e)})
    (command.Assignment
      pairs: [(assign_pair lhs:(lhs_expr.LhsName name:DAEMON) op:Equal rhs:{(/usr/bin/rsync)})]
    )
    (command.Assignment
      pairs: [(assign_pair lhs:(lhs_expr.LhsName name:RSYNC_ENABLE) op:Equal rhs:{(false)})]
    )
    (command.Assignment
      pairs: [(assign_pair lhs:(lhs_expr.LhsName name:RSYNC_OPTS) op:Equal rhs:{(SQ )})]
    )
    (command.Assignment
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:RSYNC_DEFAULTS_FILE)
          op: Equal
          rhs: {(/etc/default/rsync)}
        )
      ]
    )
    (command.Assignment
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:RSYNC_CONFIG_FILE)
          op: Equal
          rhs: {(/etc/rsyncd.conf)}
        )
      ]
    )
    (command.Assignment
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:RSYNC_PID_FILE)
          op: Equal
          rhs: {(/var/run/rsync.pid)}
        )
      ]
    )
    (command.Assignment
      pairs: [(assign_pair lhs:(lhs_expr.LhsName name:RSYNC_NICE_PARM) op:Equal rhs:{(SQ )})]
    )
    (command.Assignment
      pairs: [(assign_pair lhs:(lhs_expr.LhsName name:RSYNC_IONICE_PARM) op:Equal rhs:{(SQ )})]
    )
    (command.AndOr
      ops: [Op_DPipe]
      children: [
        (C {(test)} {(-x)} {($ VSub_DollarName '$DAEMON')})
        (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)})
      ]
    )
    (C {(.)} {(/lib/lsb/init-functions)})
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (C {(Lit_LBracket '[')} {(-s)} {($ VSub_DollarName '$RSYNC_DEFAULTS_FILE')} 
                  {(Lit_RBracket ']')}
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (C {(.)} {($ VSub_DollarName '$RSYNC_DEFAULTS_FILE')})
            (command.Case
              to_match: {(DQ (x) ($ VSub_DollarName '$RSYNC_ENABLE'))}
              arms: [
                (case_arm pat_list:[{(xtrue)} {(xfalse)}])
                (case_arm
                  pat_list: [{(xinetd)}]
                  action: [(command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)})]
                )
                (case_arm
                  pat_list: [{(Lit_Star '*')}]
                  action: [
                    (C {(log_failure_msg)} 
                      {
                        (DQ ('Value of RSYNC_ENABLE in ') ($ VSub_DollarName '$RSYNC_DEFAULTS_FILE') 
                          (" must be either 'true' or 'false';")
                        )
                      }
                    )
                    (C {(log_failure_msg)} {(DQ ('not starting rsync daemon.'))})
                    (command.ControlFlow
                      token: <ControlFlow_Exit exit>
                      arg_word: {(1)}
                    )
                  ]
                )
              ]
            )
            (command.Case
              to_match: {(DQ (x) ($ VSub_DollarName '$RSYNC_NICE'))}
              arms: [
                (case_arm
                  pat_list: [
                    {(Lit_ArrayLhsOpen 'x[') (0-9) (Lit_RBracket ']')}
                    {(Lit_ArrayLhsOpen 'x1[') (0-9) (Lit_RBracket ']')}
                  ]
                  action: [
                    (command.Assignment
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:RSYNC_NICE_PARM)
                          op: Equal
                          rhs: {(DQ ('--nicelevel ') ($ VSub_DollarName '$RSYNC_NICE'))}
                        )
                      ]
                    )
                  ]
                )
                (case_arm pat_list:[{(x)}])
                (case_arm
                  pat_list: [{(Lit_Star '*')}]
                  action: [
                    (C {(log_warning_msg)} 
                      {
                        (DQ ('Value of RSYNC_NICE in ') ($ VSub_DollarName '$RSYNC_DEFAULTS_FILE') 
                          (' must be a value between 0 and 19 (inclusive);')
                        )
                      }
                    )
                    (C {(log_warning_msg)} {(DQ ('ignoring RSYNC_NICE now.'))})
                  ]
                )
              ]
            )
            (command.Case
              to_match: {(DQ (x) ($ VSub_DollarName '$RSYNC_IONICE'))}
              arms: [
                (case_arm
                  pat_list: [{(x-c) (Lit_LBracket '[') (123) (Lit_RBracket ']') (Lit_Star '*')}]
                  action: [
                    (command.Assignment
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:RSYNC_IONICE_PARM)
                          op: Equal
                          rhs: {(DQ ($ VSub_DollarName '$RSYNC_IONICE'))}
                        )
                      ]
                    )
                  ]
                )
                (case_arm pat_list:[{(x)}])
                (case_arm
                  pat_list: [{(Lit_Star '*')}]
                  action: [
                    (C {(log_warning_msg)} 
                      {
                        (DQ ('Value of RSYNC_IONICE in ') ($ VSub_DollarName '$RSYNC_DEFAULTS_FILE') 
                          (' must be -c1, -c2 or -c3;')
                        )
                      }
                    )
                    (C {(log_warning_msg)} {(DQ ('ignoring RSYNC_IONICE now.'))})
                  ]
                )
              ]
            )
          ]
        )
      ]
    )
    (C {(export)} 
      {(Lit_VarLike 'PATH=') 
        (DQ 
          (word_part.BracedVarSub
            token: <VSub_Name PATH>
            suffix_op: 
              (suffix_op.Unary
                op_id: VTest_ColonPlus
                arg_word: {($ VSub_DollarName '$PATH') (':')}
              )
          ) ('/usr/sbin:/sbin')
        )
      }
    )
    (command.FuncDef
      name: rsync_start
      body: 
        (command.BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Lit_LBracket '[')} {(KW_Bang '!')} {(-s)} 
                          {(DQ ($ VSub_DollarName '$RSYNC_CONFIG_FILE'))} {(Lit_RBracket ']')}
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(log_failure_msg)} 
                      {
                        (DQ ('missing or empty config file ') ($ VSub_DollarName '$RSYNC_CONFIG_FILE'))
                      }
                    )
                    (C {(log_end_msg)} {(1)})
                    (command.ControlFlow
                      token: <ControlFlow_Exit exit>
                      arg_word: {(0)}
                    )
                  ]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.AndOr
                          ops: [Op_DAmp Op_DAmp]
                          children: [
                            (C {(Lit_LBracket '[')} {(-n)} 
                              {(DQ ($ VSub_DollarName '$RSYNC_IONICE_PARM'))} {(Lit_RBracket ']')}
                            )
                            (C {(Lit_LBracket '[')} {(-x)} {(/usr/bin/ionice)} {(Lit_RBracket ']')})
                            (command.Simple
                              words: [
                                {(/usr/bin/ionice)}
                                {(DQ ($ VSub_DollarName '$RSYNC_IONICE_PARM'))}
                                {(true)}
                              ]
                              redirects: [
                                (redir.Redir
                                  op: <Redir_Great '2>'>
                                  fd: 2
                                  arg_word: {(/dev/null)}
                                )
                              ]
                            )
                          ]
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (command.Simple
                      words: [
                        {(/usr/bin/ionice)}
                        {(DQ ($ VSub_DollarName '$RSYNC_IONICE_PARM'))}
                        {(-p) ($ VSub_Dollar '$$')}
                      ]
                      redirects: [
                        (redir.Redir
                          op: <Redir_Great '>'>
                          fd: 16777215
                          arg_word: {(/dev/null)}
                        )
                        (redir.Redir
                          op: <Redir_GreatAnd '2>&'>
                          fd: 2
                          arg_word: {(1)}
                        )
                      ]
                    )
                  ]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (C {(start-stop-daemon)} {(--start)} {(--quiet)} {(--background)} {(--pidfile)} 
                      {($ VSub_DollarName '$RSYNC_PID_FILE')} {(--make-pidfile)} {($ VSub_DollarName '$RSYNC_NICE_PARM')} {(--exec)} {($ VSub_DollarName '$DAEMON')} 
                      {(--)} {(--no-detach)} {(--daemon)} {(--config)} {(DQ ($ VSub_DollarName '$RSYNC_CONFIG_FILE'))} 
                      {($ VSub_DollarName '$RSYNC_OPTS')}
                    )
                  ]
                  action: [
                    (command.Assignment
                      pairs: [(assign_pair lhs:(lhs_expr.LhsName name:rc) op:Equal rhs:{(0)})]
                    )
                    (C {(sleep)} {(1)})
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.Pipeline
                                  children: [
                                    (command.Simple
                                      words: [
                                        {(kill)}
                                        {(-0)}
                                        {
                                          (word_part.CommandSub
                                            left_token: <Left_DollarParen '$('>
                                            command_list: 
                                              (command.CommandList
                                                children: [
                                                  (C {(cat)} {($ VSub_DollarName '$RSYNC_PID_FILE')})
                                                ]
                                              )
                                          )
                                        }
                                      ]
                                      redirects: [
                                        (redir.Redir
                                          op: <Redir_Great '>'>
                                          fd: 16777215
                                          arg_word: {(/dev/null)}
                                        )
                                        (redir.Redir
                                          op: <Redir_GreatAnd '2>&'>
                                          fd: 2
                                          arg_word: {(1)}
                                        )
                                      ]
                                    )
                                  ]
                                  negated: T
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (C {(log_failure_msg)} {(DQ ('rsync daemon failed to start'))})
                            (command.Assignment
                              pairs: [(assign_pair lhs:(lhs_expr.LhsName name:rc) op:Equal rhs:{(1)})]
                            )
                          ]
                        )
                      ]
                    )
                  ]
                )
              ]
              else_action: [
                (command.Assignment
                  pairs: [(assign_pair lhs:(lhs_expr.LhsName name:rc) op:Equal rhs:{(1)})]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Lit_LBracket '[')} {($ VSub_DollarName '$rc')} {(-eq)} {(0)} 
                          {(Lit_RBracket ']')}
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [(C {(log_end_msg)} {(0)})]
                )
              ]
              else_action: [
                (C {(log_end_msg)} {(1)})
                (C {(rm)} {(-f)} {($ VSub_DollarName '$RSYNC_PID_FILE')})
              ]
            )
          ]
        )
    )
    (command.Case
      to_match: {(DQ ($ VSub_Number '$1'))}
      arms: [
        (case_arm
          pat_list: [{(start)}]
          action: [
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: (C {(DQ ($ VSub_DollarName '$RSYNC_ENABLE'))})
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(log_daemon_msg)} {(DQ ('Starting rsync daemon'))} {(DQ (rsync))})
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.AndOr
                                  ops: [Op_DAmp]
                                  children: [
                                    (C {(Lit_LBracket '[')} {(-s)} 
                                      {($ VSub_DollarName '$RSYNC_PID_FILE')} {(Lit_RBracket ']')}
                                    )
                                    (command.Simple
                                      words: [
                                        {(kill)}
                                        {(-0)}
                                        {
                                          (word_part.CommandSub
                                            left_token: <Left_DollarParen '$('>
                                            command_list: 
                                              (command.CommandList
                                                children: [
                                                  (C {(cat)} {($ VSub_DollarName '$RSYNC_PID_FILE')})
                                                ]
                                              )
                                          )
                                        }
                                      ]
                                      redirects: [
                                        (redir.Redir
                                          op: <Redir_Great '>'>
                                          fd: 16777215
                                          arg_word: {(/dev/null)}
                                        )
                                        (redir.Redir
                                          op: <Redir_GreatAnd '2>&'>
                                          fd: 2
                                          arg_word: {(1)}
                                        )
                                      ]
                                    )
                                  ]
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (C {(log_progress_msg)} {(DQ ('apparently already running'))})
                            (C {(log_end_msg)} {(0)})
                            (command.ControlFlow
                              token: <ControlFlow_Exit exit>
                              arg_word: {(0)}
                            )
                          ]
                        )
                      ]
                    )
                    (C {(rsync_start)})
                  ]
                )
              ]
              else_action: [
                (command.If
                  arms: [
                    (if_arm
                      cond: [
                        (command.Sentence
                          child: 
                            (C {(Lit_LBracket '[')} {(-s)} 
                              {(DQ ($ VSub_DollarName '$RSYNC_CONFIG_FILE'))} {(Lit_RBracket ']')}
                            )
                          terminator: <Op_Semi ';'>
                        )
                      ]
                      action: [
                        (command.AndOr
                          ops: [Op_DAmp]
                          children: [
                            (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$VERBOSE'))} 
                              {(KW_Bang '!') (Lit_Other '=')} {(no)} {(Lit_RBracket ']')}
                            )
                            (C {(log_warning_msg)} 
                              {
                                (DQ ('rsync daemon not enabled in ') 
                                  ($ VSub_DollarName '$RSYNC_DEFAULTS_FILE') (', not starting...')
                                )
                              }
                            )
                          ]
                        )
                      ]
                    )
                  ]
                )
              ]
            )
          ]
        )
        (case_arm
          pat_list: [{(stop)}]
          action: [
            (C {(log_daemon_msg)} {(DQ ('Stopping rsync daemon'))} {(DQ (rsync))})
            (C {(start-stop-daemon)} {(--stop)} {(--quiet)} {(--oknodo)} {(--pidfile)} 
              {($ VSub_DollarName '$RSYNC_PID_FILE')}
            )
            (C {(log_end_msg)} {($ VSub_QMark '$?')})
            (C {(rm)} {(-f)} {($ VSub_DollarName '$RSYNC_PID_FILE')})
          ]
        )
        (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.'))})
          ]
        )
        (case_arm
          pat_list: [{(restart)}]
          action: [
            (C {(set)} {(Lit_Other '+') (e)})
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: (C {($ VSub_DollarName '$RSYNC_ENABLE')})
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(log_daemon_msg)} {(DQ ('Restarting rsync daemon'))} {(DQ (rsync))})
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.AndOr
                                  ops: [Op_DAmp]
                                  children: [
                                    (C {(Lit_LBracket '[')} {(-s)} 
                                      {($ VSub_DollarName '$RSYNC_PID_FILE')} {(Lit_RBracket ']')}
                                    )
                                    (command.Simple
                                      words: [
                                        {(kill)}
                                        {(-0)}
                                        {
                                          (word_part.CommandSub
                                            left_token: <Left_DollarParen '$('>
                                            command_list: 
                                              (command.CommandList
                                                children: [
                                                  (C {(cat)} {($ VSub_DollarName '$RSYNC_PID_FILE')})
                                                ]
                                              )
                                          )
                                        }
                                      ]
                                      redirects: [
                                        (redir.Redir
                                          op: <Redir_Great '>'>
                                          fd: 16777215
                                          arg_word: {(/dev/null)}
                                        )
                                        (redir.Redir
                                          op: <Redir_GreatAnd '2>&'>
                                          fd: 2
                                          arg_word: {(1)}
                                        )
                                      ]
                                    )
                                  ]
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (command.AndOr
                              ops: [Op_DPipe]
                              children: [
                                (C {(start-stop-daemon)} {(--stop)} {(--quiet)} {(--oknodo)} {(--pidfile)} 
                                  {($ VSub_DollarName '$RSYNC_PID_FILE')}
                                )
                                (C {(true)})
                              ]
                            )
                            (C {(sleep)} {(1)})
                          ]
                        )
                      ]
                      else_action: [
                        (C {(log_warning_msg)} {(DQ ('rsync daemon not running, attempting to start.'))})
                        (C {(rm)} {(-f)} {($ VSub_DollarName '$RSYNC_PID_FILE')})
                      ]
                    )
                    (C {(rsync_start)})
                  ]
                )
              ]
              else_action: [
                (command.If
                  arms: [
                    (if_arm
                      cond: [
                        (command.Sentence
                          child: 
                            (C {(Lit_LBracket '[')} {(-s)} 
                              {(DQ ($ VSub_DollarName '$RSYNC_CONFIG_FILE'))} {(Lit_RBracket ']')}
                            )
                          terminator: <Op_Semi ';'>
                        )
                      ]
                      action: [
                        (command.AndOr
                          ops: [Op_DAmp]
                          children: [
                            (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$VERBOSE'))} 
                              {(KW_Bang '!') (Lit_Other '=')} {(no)} {(Lit_RBracket ']')}
                            )
                            (C {(log_warning_msg)} 
                              {
                                (DQ ('rsync daemon not enabled in ') 
                                  ($ VSub_DollarName '$RSYNC_DEFAULTS_FILE') (', not starting...')
                                )
                              }
                            )
                          ]
                        )
                      ]
                    )
                  ]
                )
              ]
            )
          ]
        )
        (case_arm
          pat_list: [{(status)}]
          action: [
            (C {(status_of_proc)} {(-p)} {($ VSub_DollarName '$RSYNC_PID_FILE')} 
              {(DQ ($ VSub_DollarName '$DAEMON'))} {(rsync)}
            )
            (command.ControlFlow
              token: <ControlFlow_Exit exit>
              arg_word: {($ VSub_QMark '$?')}
            )
          ]
        )
        (case_arm
          pat_list: [{(Lit_Star '*')}]
          action: [
            (C {(echo)} 
              {(DQ ('Usage: /etc/init.d/rsync {start|stop|reload|force-reload|restart|status}'))}
            )
            (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})
          ]
        )
      ]
    )
    (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)})
  ]
)