(command.CommandList children: [ (C {(set)} {(-e)}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:PATH spids:[34]) op: Equal rhs: {(DQ ('/sbin:/bin'))} spids: [34] ) ] spids: [34] ) (command.AndOr ops: [Op_DPipe] children: [ (C {(Lit_Other '[')} {(-d)} {(/lib/ufw)} {(Lit_Other ']')}) (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_Other '[')} {(-s)} {(DQ ($ VSub_DollarName '$s'))} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [(C {(.)} {(DQ ($ VSub_DollarName '$s'))})] spids: [16777215 96] ) ] else_action: [ (C {(log_failure_msg)} {(DQ ('Could not find ') ($ VSub_DollarName '$s') (' (aborting)'))} ) (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [106 123] ) ] spids: [80 125] ) spids: [65 78] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:error spids:[128]) op: Equal rhs: {(0)} spids: [128] ) ] spids: [128] ) (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_Other '[')} {(DQ ($ VSub_DollarName '$ENABLED'))} {(Lit_Other '=')} {(DQ (yes))} {(Lit_Other ']')} ) (C {(Lit_Other '[')} {(DQ ($ VSub_DollarName '$ENABLED'))} {(Lit_Other '=')} {(DQ (YES))} {(Lit_Other ']')} ) ] ) terminator: <Op_Semi ';'> ) ] action: [ (C {(log_action_begin_msg)} {(DQ ('Starting firewall:'))} {(DQ (ufw))}) (command.AndOr ops: [Op_DPipe] children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:output spids:[190]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(ufw_start)})]) left_token: <Left_Backtick '`'> spids: [191 195] ) } spids: [190] ) ] spids: [190] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:error spids:[199]) op: Equal rhs: {(DQ ($ VSub_QMark '$?'))} spids: [199] ) ] spids: [199] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {(DQ ($ VSub_DollarName '$error'))} {(Lit_Other '=')} {(DQ (0))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (C {(log_action_cont_msg)} { (DQ ('Setting kernel variables (') ($ VSub_DollarName '$IPT_SYSCTL') (')') ) } ) ] spids: [16777215 222] ) ] spids: [16777215 234] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {(KW_Bang '!')} {(-z)} {(DQ ($ VSub_DollarName '$output'))} {(Lit_Other ']')} ) 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'))}) ] spids: [271 281] ) ) ] negated: F ) ] spids: [16777215 252] ) ] spids: [16777215 284] ) ] spids: [16777215 176] ) ] else_action: [ (C {(log_action_begin_msg)} {(DQ ('Skip starting firewall:'))} {(DQ ('ufw (not enabled)'))} ) ] spids: [287 301] ) (C {(log_action_end_msg)} {($ VSub_DollarName '$error')}) (command.ControlFlow token: <ControlFlow_Exit exit> arg_word: {($ VSub_DollarName '$error')} ) ] spids: [139 140 314 16777215] ) (case_arm pat_list: [{(stop)}] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.AndOr ops: [Op_DPipe] children: [ (C {(Lit_Other '[')} {(DQ ($ VSub_DollarName '$ENABLED'))} {(Lit_Other '=')} {(DQ (yes))} {(Lit_Other ']')} ) (C {(Lit_Other '[')} {(DQ ($ VSub_DollarName '$ENABLED'))} {(Lit_Other '=')} {(DQ (YES))} {(Lit_Other ']')} ) ] ) terminator: <Op_Semi ';'> ) ] action: [ (C {(log_action_begin_msg)} {(DQ ('Stopping firewall:'))} {(DQ (ufw))}) (command.AndOr ops: [Op_DPipe] children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:output spids:[367]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(ufw_stop)})]) left_token: <Left_Backtick '`'> spids: [368 372] ) } spids: [367] ) ] spids: [367] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:error spids:[376]) op: Equal rhs: {(DQ ($ VSub_QMark '$?'))} spids: [376] ) ] spids: [376] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {(KW_Bang '!')} {(-z)} {(DQ ($ VSub_DollarName '$output'))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [(C {(log_action_cont_msg)} {(DQ ($ VSub_DollarName '$output'))})] spids: [16777215 397] ) ] spids: [16777215 407] ) ] spids: [16777215 353] ) ] else_action: [ (C {(log_action_begin_msg)} {(DQ ('Skip stopping firewall:'))} {(DQ ('ufw (not enabled)'))} ) ] spids: [410 424] ) (C {(log_action_end_msg)} {($ VSub_DollarName '$error')}) (command.ControlFlow token: <ControlFlow_Exit exit> arg_word: {($ VSub_DollarName '$error')} ) ] spids: [316 317 437 16777215] ) (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 keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:output spids:[456]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(ufw_reload)})]) left_token: <Left_Backtick '`'> spids: [457 461] ) } spids: [456] ) ] spids: [456] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:error spids:[465]) op: Equal rhs: {(DQ ($ VSub_QMark '$?'))} spids: [465] ) ] spids: [465] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {(KW_Bang '!')} {(-z)} {(DQ ($ VSub_DollarName '$output'))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [(C {(log_action_cont_msg)} {(DQ ($ VSub_DollarName '$output'))})] spids: [16777215 486] ) ] spids: [16777215 496] ) (C {(log_action_end_msg)} {($ VSub_DollarName '$error')}) (command.ControlFlow token: <ControlFlow_Exit exit> arg_word: {($ VSub_DollarName '$error')} ) ] spids: [439 442 509 16777215] ) (case_arm pat_list: [{(status)}] action: [ (command.AndOr ops: [Op_DPipe] children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:output spids:[515]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(ufw_status)})]) left_token: <Left_Backtick '`'> spids: [516 520] ) } spids: [515] ) ] spids: [515] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:error spids:[524]) op: Equal rhs: {(DQ ($ VSub_QMark '$?'))} spids: [524] ) ] spids: [524] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {(KW_Bang '!')} {(-z)} {(DQ ($ VSub_DollarName '$output'))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [(C {(log_action_cont_msg)} {(DQ ($ VSub_DollarName '$output'))})] spids: [16777215 545] ) ] spids: [16777215 555] ) (C {(log_action_end_msg)} {($ VSub_DollarName '$error')}) (command.ControlFlow token: <ControlFlow_Exit exit> arg_word: {($ VSub_DollarName '$error')} ) ] spids: [511 512 568 16777215] ) (case_arm pat_list: [{(Lit_Other '*')}] action: [ (C {(echo)} {(DQ ('Usage: /etc/init.d/ufw {start|stop|restart|force-reload|status}'))}) (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [570 571 586 16777215] ) ] spids: [131 137 588] ) (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)}) ] )