(CommandList children: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(-r)} {(/etc/defaults/rc.conf)} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [(C {(.)} {(/etc/defaults/rc.conf)}) (C {(source_rc_confs)})] spids: [-1 160] ) (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(-r)} {(/etc/rc.conf)} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [(C {(.)} {(/etc/rc.conf)})] spids: [170 181] ) ] spids: [-1 188] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:EDITOR) op: Equal rhs: { (BracedVarSub token: <VSub_Name EDITOR> suffix_op: (StringUnary op_id: VTest_ColonHyphen arg_word: {(Lit_Slash /) (usr) (Lit_Slash /) (bin) (Lit_Slash /) (vi)} ) spids: [192 201] ) } spids: [191] ) ] spids: [191] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:PAGER) op: Equal rhs: { (BracedVarSub token: <VSub_Name PAGER> suffix_op: (StringUnary op_id: VTest_ColonHyphen arg_word: {(Lit_Slash /) (usr) (Lit_Slash /) (bin) (Lit_Slash /) (more)} ) spids: [204 213] ) } spids: [203] ) ] spids: [203] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:tempfoo) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(basename)} {($ VSub_Number '$0')})]) left_token: <Left_Backtick '`'> spids: [217 221] ) } spids: [216] ) ] spids: [216] ) (AndOr children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:TMPFILE) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(mktemp)} {(-t)} {(${ VSub_Name tempfoo)})] ) left_token: <Left_Backtick '`'> spids: [224 232] ) } spids: [223] ) ] spids: [223] ) (C {(exit)} {(1)}) ] op_id: Op_DPipe ) (FuncDef name: get_yes_no body: (BraceGroup children: [ (While cond: [(C {(true)})] body: (DoGroup children: [ (C {(echo)} {(-n)} {(DQ ($ VSub_Number '$1') (' (Y/N) ? '))}) (C {(read)} {(-t)} {(30)} {(a)}) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {($ VSub_QMark '$?')} {(KW_Bang '!') (Lit_Other '=')} {(0)} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:a) op: Equal rhs: {(DQ (No))} spids: [293] ) ] spids: [293] ) terminator: <Op_Semi ';'> ) (Sentence child: (ControlFlow token:<ControlFlow_Return return>) terminator: <Op_Semi ';'> ) ] spids: [-1 290] ) ] spids: [-1 304] ) (Case to_match: {($ VSub_Name '$a')} arms: [ (case_arm pat_list: [{(Lit_Other '[') (Yy) (Lit_Other ']')}] action: [ (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:a) op: Equal rhs: {(DQ (Yes))} spids: [319] ) ] spids: [319] ) terminator: <Op_Semi ';'> ) (ControlFlow token: <ControlFlow_Return return> ) ] spids: [314 317 327 -1] ) (case_arm pat_list: [{(Lit_Other '[') (Nn) (Lit_Other ']')}] action: [ (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:a) op: Equal rhs: {(DQ (No))} spids: [335] ) ] spids: [335] ) terminator: <Op_Semi ';'> ) (ControlFlow token: <ControlFlow_Return return> ) ] spids: [330 333 343 -1] ) (case_arm pat_list: [{(Lit_Other '*')}] spids: [346 347 348 -1] ) ] spids: [307 311 351] ) ] spids: [253 354] ) ) ] spids: [245] ) spids: [241 244] ) (FuncDef name: restore_rules body: (BraceGroup children: [ (SimpleCommand words: [{(nohup)} {(sh)} {(${ VSub_Name firewall_script)}] redirects: [ (Redir op_id:Redir_Less fd:-1 arg_word:{(/dev/null)} spids:[374]) (Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[377]) (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[380]) ] ) (C {(rm)} {(${ VSub_Name TMPFILE)}) (C {(exit)} {(1)}) ] spids: [363] ) spids: [359 362] ) (Case to_match: {(DQ (${ VSub_Name firewall_type))} arms: [ (case_arm pat_list: [ {(Lit_Other '[') (Cc) (Lit_Other ']') (Lit_Other '[') (Ll) (Lit_Other ']') (Lit_Other '[') (Ii) (Lit_Other ']') (Lit_Other '[') (Ee) (Lit_Other ']') (Lit_Other '[') (Nn) (Lit_Other ']') (Lit_Other '[') (Tt) (Lit_Other ']') } {(Lit_Other '[') (Cc) (Lit_Other ']') (Lit_Other '[') (Ll) (Lit_Other ']') (Lit_Other '[') (Oo) (Lit_Other ']') (Lit_Other '[') (Ss) (Lit_Other ']') (Lit_Other '[') (Ee) (Lit_Other ']') (Lit_Other '[') (Dd) (Lit_Other ']') } {(Lit_Other '[') (Oo) (Lit_Other ']') (Lit_Other '[') (Pp) (Lit_Other ']') (Lit_Other '[') (Ee) (Lit_Other ']') (Lit_Other '[') (Nn) (Lit_Other ']') } {(Lit_Other '[') (Ss) (Lit_Other ']') (Lit_Other '[') (Ii) (Lit_Other ']') (Lit_Other '[') (Mm) (Lit_Other ']') (Lit_Other '[') (Pp) (Lit_Other ']') (Lit_Other '[') (Ll) (Lit_Other ']') (Lit_Other '[') (Ee) (Lit_Other ']') } {(Lit_Other '[') (Uu) (Lit_Other ']') (Lit_Other '[') (Nn) (Lit_Other ']') (Lit_Other '[') (Kk) (Lit_Other ']') (Lit_Other '[') (Nn) (Lit_Other ']') (Lit_Other '[') (Oo) (Lit_Other ']') (Lit_Other '[') (Ww) (Lit_Other ']') (Lit_Other '[') (Nn) (Lit_Other ']') } ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:edit_file) op: Equal rhs: {(DQ (${ VSub_Name firewall_script))} spids: [506] ) ] spids: [506] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:rules_edit) op:Equal rhs:{(no)} spids:[514])] spids: [514] ) ] spids: [408 503 518 -1] ) (case_arm pat_list: [{(Lit_Other '*')}] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(-r)} {(DQ (${ VSub_Name firewall_type))} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:edit_file) op: Equal rhs: {(DQ (${ VSub_Name firewall_type))} spids: [542] ) ] spids: [542] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:rules_edit) op: Equal rhs: {(yes)} spids: [550] ) ] spids: [550] ) ] spids: [-1 539] ) ] spids: [-1 554] ) ] spids: [520 521 557 -1] ) ] spids: [398 406 559] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(-f)} {(${ VSub_Name edit_file) (.new)} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [ (C {(get_yes_no)} {(DQ ('A new rules file already exists, do you want to use it'))}) (AndOr children: [ (C {(Lit_Other '[')} {($ VSub_Name '$a')} {(Lit_Other '=')} {(SQ <No>)} {(Lit_Other ']')}) (C {(cp)} {(${ VSub_Name edit_file)} {(${ VSub_Name edit_file) (.new)}) ] op_id: Op_DAmp ) ] spids: [-1 576] ) ] else_action: [(C {(cp)} {(${ VSub_Name edit_file)} {(${ VSub_Name edit_file) (.new)})] spids: [611 626] ) (C {(trap)} {(restore_rules)} {(SIGHUP)}) (C {(${ VSub_Name EDITOR)} {(${ VSub_Name edit_file) (.new)}) (C {(get_yes_no)} {(DQ ('Do you want to install the new rules'))}) (AndOr children: [ (C {(Lit_Other '[')} {($ VSub_Name '$a')} {(Lit_Other '=')} {(SQ <No>)} {(Lit_Other ']')}) (C {(exit)} {(1)}) ] op_id: Op_DAmp ) (SimpleCommand words: [{(cat)}] redirects: [ (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ("The rules will be changed now. If the message 'Type y to keep the new\n") ("rules' does not appear on the screen or the y key is not pressed in 30\n") ('seconds, the original rules will be restored.\n') ('The TCP/IP connections might be broken during the change. If so, restore\n') ('the ssh/telnet connection being used.\n') ) } do_expansion: True here_end: '!' was_filled: True spids: [674] ) ] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(${ VSub_Name rules_edit)} {(Lit_Other '=')} {(yes)} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (SimpleCommand words: [ {(nohup)} {(sh)} {(${ VSub_Name firewall_script)} {(${ VSub_Name firewall_type) (.new)} ] redirects: [ (Redir op_id:Redir_Less fd:-1 arg_word:{(/dev/null)} spids:[717]) (Redir op_id: Redir_Great fd: -1 arg_word: {(${ VSub_Name TMPFILE)} spids: [721] ) (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[727]) ] ) ] spids: [-1 699] ) ] else_action: [ (SimpleCommand words: [{(nohup)} {(sh)} {(${ VSub_Name firewall_script) (.new)}] redirects: [ (Redir op_id:Redir_Less fd:-1 arg_word:{(/dev/null)} spids:[744]) (Redir op_id:Redir_Great fd:-1 arg_word:{(${ VSub_Name TMPFILE)} spids:[748]) (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[754]) ] ) ] spids: [730 757] ) (Sentence child:(C {(sleep)} {(2)}) terminator:<Op_Semi ';'>) (C {(get_yes_no)} {(DQ ('Would you like to see the resulting new rules'))}) (AndOr children: [ (C {(Lit_Other '[')} {($ VSub_Name '$a')} {(Lit_Other '=')} {(SQ <Yes>)} {(Lit_Other ']')}) (C {(${ VSub_Name PAGER)} {(${ VSub_Name TMPFILE)}) ] op_id: Op_DAmp ) (C {(get_yes_no)} {(DQ ('Type y to keep the new rules'))}) (AndOr children: [ (C {(Lit_Other '[')} {($ VSub_Name '$a')} {(KW_Bang '!') (Lit_Other '=')} {(SQ <Yes>)} {(Lit_Other ']')} ) (C {(restore_rules)}) ] op_id: Op_DAmp ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:DATE) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(date)} {(DQ ('+%Y%m%d%H%M'))})]) left_token: <Left_Backtick '`'> spids: [817 823] ) } spids: [816] ) ] spids: [816] ) (C {(cp)} {(${ VSub_Name edit_file)} {(${ VSub_Name edit_file) (.) ($ VSub_Name '$DATE')}) (C {(mv)} {(${ VSub_Name edit_file) (.new)} {(${ VSub_Name edit_file)}) (SimpleCommand words: [{(cat)}] redirects: [ (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ('The new rules are now installed. The previous rules have been preserved in\n') ('the file ') (${ VSub_Name edit_file) (.) ($ VSub_Name '$DATE') ('\n') ) } do_expansion: True here_end: '!' was_filled: True spids: [851] ) ] ) (Pipeline children: [ (C {(diff)} {(-F)} {(DQ ('^# .*[A-Za-z]'))} {(-u)} {(${ VSub_Name edit_file) (.) ($ VSub_Name '$DATE')} {(${ VSub_Name edit_file)} ) (C {(mail)} {(-s)} { (DQ (CommandSubPart command_list: (CommandList children:[(C {(hostname)})]) left_token: <Left_Backtick '`'> spids: [892 894] ) (' Firewall rule change') ) } {(root)} ) ] negated: False ) (C {(rm)} {(${ VSub_Name TMPFILE)}) (C {(exit)} {(0)}) ] )