(command.CommandList children: [ (C {(set)} {(-e)}) (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:PATH) op:Equal rhs:{(DQ ('/sbin:/bin'))})] ) (command.AndOr ops: [Op_DPipe] children: [ (C {(Lit_LBracket '[')} {(-d)} {(/lib/ufw)} {(Lit_RBracket ']')}) (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)}) ] ) (C {(.)} {(/lib/lsb/init-functions)}) (command.ForEach iter_name: s iter_words: [ {(DQ (/lib/ufw/ufw-init-functions))} {(DQ (/etc/ufw/ufw.conf))} {(DQ (/etc/default/ufw))} ] do_arg_iter: F body: (command.DoGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_LBracket '[')} {(-s)} {(DQ ($ VSub_DollarName '$s'))} {(Lit_RBracket ']')} ) terminator: <Op_Semi ';'> ) ] action: [(C {(.)} {(DQ ($ VSub_DollarName '$s'))})] ) ] else_action: [ (C {(log_failure_msg)} {(DQ ('Could not find ') ($ VSub_DollarName '$s') (' (aborting)'))} ) (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] ) ] ) ) (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:error) op:Equal rhs:{(0)})] ) (command.Case to_match: {(DQ ($ VSub_Number '$1'))} arms: [ (case_arm pat_list: [{(start)}] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.AndOr ops: [Op_DPipe] children: [ (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$ENABLED'))} {(Lit_Other '=')} {(DQ (yes))} {(Lit_RBracket ']')} ) (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$ENABLED'))} {(Lit_Other '=')} {(DQ (YES))} {(Lit_RBracket ']')} ) ] ) terminator: <Op_Semi ';'> ) ] action: [ (C {(log_action_begin_msg)} {(DQ ('Starting firewall:'))} {(DQ (ufw))}) (command.AndOr ops: [Op_DPipe] children: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:output) op: Equal rhs: { (word_part.CommandSub left_token: <Left_Backtick '`'> command_list: (command.CommandList children:[(C {(ufw_start)})]) ) } ) ] ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:error) op: Equal rhs: {(DQ ($ VSub_QMark '$?'))} ) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$error'))} {(Lit_Other '=')} {(DQ (0))} {(Lit_RBracket ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (C {(log_action_cont_msg)} { (DQ ('Setting kernel variables (') ($ VSub_DollarName '$IPT_SYSCTL') (')') ) } ) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_LBracket '[')} {(KW_Bang '!')} {(-z)} {(DQ ($ VSub_DollarName '$output'))} {(Lit_RBracket ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (command.Pipeline children: [ (C {(echo)} {(DQ ($ VSub_DollarName '$output'))}) (command.WhileUntil keyword: <KW_While while> cond: [ (command.Sentence child: (C {(read)} {(line)}) terminator: <Op_Semi ';'> ) ] body: (command.DoGroup children: [ (C {(log_action_cont_msg)} {(DQ ($ VSub_DollarName '$line'))}) ] ) ) ] negated: F ) ] ) ] ) ] ) ] else_action: [ (C {(log_action_begin_msg)} {(DQ ('Skip starting firewall:'))} {(DQ ('ufw (not enabled)'))} ) ] ) (C {(log_action_end_msg)} {($ VSub_DollarName '$error')}) (command.ControlFlow token: <ControlFlow_Exit exit> arg_word: {($ VSub_DollarName '$error')} ) ] ) (case_arm pat_list: [{(stop)}] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.AndOr ops: [Op_DPipe] children: [ (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$ENABLED'))} {(Lit_Other '=')} {(DQ (yes))} {(Lit_RBracket ']')} ) (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$ENABLED'))} {(Lit_Other '=')} {(DQ (YES))} {(Lit_RBracket ']')} ) ] ) terminator: <Op_Semi ';'> ) ] action: [ (C {(log_action_begin_msg)} {(DQ ('Stopping firewall:'))} {(DQ (ufw))}) (command.AndOr ops: [Op_DPipe] children: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:output) op: Equal rhs: { (word_part.CommandSub left_token: <Left_Backtick '`'> command_list: (command.CommandList children:[(C {(ufw_stop)})]) ) } ) ] ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:error) op: Equal rhs: {(DQ ($ VSub_QMark '$?'))} ) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_LBracket '[')} {(KW_Bang '!')} {(-z)} {(DQ ($ VSub_DollarName '$output'))} {(Lit_RBracket ']')} ) terminator: <Op_Semi ';'> ) ] action: [(C {(log_action_cont_msg)} {(DQ ($ VSub_DollarName '$output'))})] ) ] ) ] ) ] else_action: [ (C {(log_action_begin_msg)} {(DQ ('Skip stopping firewall:'))} {(DQ ('ufw (not enabled)'))} ) ] ) (C {(log_action_end_msg)} {($ VSub_DollarName '$error')}) (command.ControlFlow token: <ControlFlow_Exit exit> arg_word: {($ VSub_DollarName '$error')} ) ] ) (case_arm pat_list: [{(restart)} {(force-reload)}] action: [ (C {(log_action_begin_msg)} {(DQ ('Reloading firewall:'))} {(DQ (ufw))}) (command.AndOr ops: [Op_DPipe] children: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:output) op: Equal rhs: { (word_part.CommandSub left_token: <Left_Backtick '`'> command_list: (command.CommandList children:[(C {(ufw_reload)})]) ) } ) ] ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:error) op: Equal rhs: {(DQ ($ VSub_QMark '$?'))} ) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_LBracket '[')} {(KW_Bang '!')} {(-z)} {(DQ ($ VSub_DollarName '$output'))} {(Lit_RBracket ']')} ) terminator: <Op_Semi ';'> ) ] action: [(C {(log_action_cont_msg)} {(DQ ($ VSub_DollarName '$output'))})] ) ] ) (C {(log_action_end_msg)} {($ VSub_DollarName '$error')}) (command.ControlFlow token: <ControlFlow_Exit exit> arg_word: {($ VSub_DollarName '$error')} ) ] ) (case_arm pat_list: [{(status)}] action: [ (command.AndOr ops: [Op_DPipe] children: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:output) op: Equal rhs: { (word_part.CommandSub left_token: <Left_Backtick '`'> command_list: (command.CommandList children:[(C {(ufw_status)})]) ) } ) ] ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:error) op: Equal rhs: {(DQ ($ VSub_QMark '$?'))} ) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_LBracket '[')} {(KW_Bang '!')} {(-z)} {(DQ ($ VSub_DollarName '$output'))} {(Lit_RBracket ']')} ) terminator: <Op_Semi ';'> ) ] action: [(C {(log_action_cont_msg)} {(DQ ($ VSub_DollarName '$output'))})] ) ] ) (C {(log_action_end_msg)} {($ VSub_DollarName '$error')}) (command.ControlFlow token: <ControlFlow_Exit exit> arg_word: {($ VSub_DollarName '$error')} ) ] ) (case_arm pat_list: [{(Lit_Star '*')}] action: [ (C {(echo)} {(DQ ('Usage: /etc/init.d/ufw {start|stop|restart|force-reload|status}'))}) (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] ) ] ) (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)}) ] )